very-happy-dom 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +251 -0
- package/dist/apis/BrowserAPIs.d.ts +93 -0
- package/dist/apis/Clipboard.d.ts +24 -0
- package/dist/apis/FileAPI.d.ts +56 -0
- package/dist/browser/Browser.d.ts +23 -0
- package/dist/browser/BrowserContext.d.ts +21 -0
- package/dist/browser/BrowserFrame.d.ts +25 -0
- package/dist/browser/BrowserPage.d.ts +82 -0
- package/dist/browser/CookieContainer.d.ts +25 -0
- package/dist/events/CustomEvent.d.ts +14 -0
- package/dist/events/VirtualEvent.d.ts +16 -0
- package/dist/http/XMLHttpRequest.d.ts +66 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +3792 -0
- package/dist/network/RequestInterceptor.d.ts +31 -0
- package/dist/network/WebSocket.d.ts +47 -0
- package/dist/nodes/VirtualCommentNode.d.ts +10 -0
- package/dist/nodes/VirtualDocument.d.ts +50 -0
- package/dist/nodes/VirtualElement.d.ts +43 -0
- package/dist/nodes/VirtualNode.d.ts +47 -0
- package/dist/nodes/VirtualTextNode.d.ts +10 -0
- package/dist/observers/IntersectionObserver.d.ts +49 -0
- package/dist/observers/MutationObserver.d.ts +37 -0
- package/dist/observers/ResizeObserver.d.ts +41 -0
- package/dist/parsers/html-parser.d.ts +5 -0
- package/dist/selectors/engine.d.ts +132 -0
- package/dist/storage/Storage.d.ts +14 -0
- package/dist/timers/TimerManager.d.ts +21 -0
- package/dist/webcomponents/CustomElementRegistry.d.ts +22 -0
- package/dist/webcomponents/ShadowRoot.d.ts +23 -0
- package/dist/window/DetachedWindowAPI.d.ts +19 -0
- package/dist/window/GlobalWindow.d.ts +15 -0
- package/dist/window/Window.d.ts +93 -0
- package/dist/xpath/XPathEvaluator.d.ts +16 -0
- package/dist/xpath/XPathResult.d.ts +32 -0
- package/package.json +55 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare interface ProgressEvent extends Event {
|
|
2
|
+
lengthComputable: boolean
|
|
3
|
+
loaded: number
|
|
4
|
+
total: number
|
|
5
|
+
}
|
|
6
|
+
declare type XMLHttpRequestBodyInit = Blob | BufferSource | FormData | URLSearchParams | string
|
|
7
|
+
declare type EventListener = (event: Event) => void
|
|
8
|
+
/**
|
|
9
|
+
* XMLHttpRequest implementation
|
|
10
|
+
* Wraps Bun's native fetch API to provide legacy XHR interface
|
|
11
|
+
*/
|
|
12
|
+
export declare class XMLHttpRequest {
|
|
13
|
+
static readonly UNSENT: any;
|
|
14
|
+
static readonly OPENED: any;
|
|
15
|
+
static readonly HEADERS_RECEIVED: any;
|
|
16
|
+
static readonly LOADING: any;
|
|
17
|
+
static readonly DONE: any;
|
|
18
|
+
readyState: number;
|
|
19
|
+
response: any;
|
|
20
|
+
responseText: string;
|
|
21
|
+
responseType: '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';
|
|
22
|
+
responseURL: string;
|
|
23
|
+
responseXML: Document | null;
|
|
24
|
+
status: number;
|
|
25
|
+
statusText: string;
|
|
26
|
+
timeout: number;
|
|
27
|
+
upload: XMLHttpRequestUpload;
|
|
28
|
+
withCredentials: boolean;
|
|
29
|
+
onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;
|
|
30
|
+
onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
31
|
+
onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
32
|
+
onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
33
|
+
onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
34
|
+
onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
35
|
+
onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
36
|
+
ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
37
|
+
private _method: any;
|
|
38
|
+
private _url: any;
|
|
39
|
+
private _requestHeaders: any;
|
|
40
|
+
private _responseHeaders: any;
|
|
41
|
+
private _aborted: any;
|
|
42
|
+
private _eventListeners: any;
|
|
43
|
+
constructor();
|
|
44
|
+
open(method: string, url: string, _async?: any, _username?: string | null, _password?: string | null): void;
|
|
45
|
+
send(body?: Document | XMLHttpRequestBodyInit | null): void;
|
|
46
|
+
abort(): void;
|
|
47
|
+
setRequestHeader(name: string, value: string): void;
|
|
48
|
+
getResponseHeader(name: string): string | null;
|
|
49
|
+
getAllResponseHeaders(): string;
|
|
50
|
+
overrideMimeType(_mime: string): void;
|
|
51
|
+
addEventListener(type: string, listener: EventListener): void;
|
|
52
|
+
removeEventListener(type: string, listener: EventListener): void;
|
|
53
|
+
dispatchEvent(event: Event): boolean;
|
|
54
|
+
private _triggerEvent(type: string, isProgressEvent?: any): void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* XMLHttpRequestUpload placeholder
|
|
58
|
+
*/
|
|
59
|
+
declare class XMLHttpRequestUpload {
|
|
60
|
+
onprogress: ((this: XMLHttpRequestUpload, ev: ProgressEvent) => any) | null;
|
|
61
|
+
onload: ((this: XMLHttpRequestUpload, ev: ProgressEvent) => any) | null;
|
|
62
|
+
onerror: ((this: XMLHttpRequestUpload, ev: ProgressEvent) => any) | null;
|
|
63
|
+
addEventListener(_type: string, _listener: EventListener): void;
|
|
64
|
+
removeEventListener(_type: string, _listener: EventListener): void;
|
|
65
|
+
dispatchEvent(_event: Event): boolean;
|
|
66
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type { IBrowserPageViewport, PageEventHandler, PageEventType } from './browser/BrowserPage';
|
|
2
|
+
export type { ICookie } from './browser/CookieContainer';
|
|
3
|
+
export type { CustomEventInit } from './events/CustomEvent';
|
|
4
|
+
export type { EventListener, EventListenerOptions, History, HistoryState, Location, NodeType, VirtualNode } from './nodes/VirtualNode';
|
|
5
|
+
export type { IntersectionObserverCallback, IntersectionObserverEntry, IntersectionObserverInit } from './observers/IntersectionObserver';
|
|
6
|
+
export type { MutationCallback, MutationObserverInit, MutationRecord } from './observers/MutationObserver';
|
|
7
|
+
export type { ResizeObserverCallback, ResizeObserverEntry, ResizeObserverSize } from './observers/ResizeObserver';
|
|
8
|
+
export type { IBrowserSettings, IOptionalBrowserSettings, WindowOptions } from './window/Window';
|
|
9
|
+
export { DataTransfer, EnhancedConsole, Geolocation, Notification, Performance } from './apis/BrowserAPIs';
|
|
10
|
+
export { Clipboard, Navigator } from './apis/Clipboard';
|
|
11
|
+
export { VeryHappyFile as File, VeryHappyFileList as FileList, VeryHappyFileReader as FileReader } from './apis/FileAPI';
|
|
12
|
+
export { Browser } from './browser/Browser';
|
|
13
|
+
export { BrowserContext } from './browser/BrowserContext';
|
|
14
|
+
export { BrowserFrame } from './browser/BrowserFrame';
|
|
15
|
+
export { BrowserPage } from './browser/BrowserPage';
|
|
16
|
+
export { CookieContainer, CookieSameSiteEnum } from './browser/CookieContainer';
|
|
17
|
+
export { CustomEvent } from './events/CustomEvent';
|
|
18
|
+
export { VirtualEvent } from './events/VirtualEvent';
|
|
19
|
+
export { XMLHttpRequest } from './http/XMLHttpRequest';
|
|
20
|
+
export { type InterceptedRequest, type RequestInterceptionHandler, RequestInterceptor } from './network/RequestInterceptor';
|
|
21
|
+
export { VeryHappyWebSocket as WebSocket } from './network/WebSocket';
|
|
22
|
+
export { VirtualCommentNode } from './nodes/VirtualCommentNode';
|
|
23
|
+
export { createDocument, VirtualDocument } from './nodes/VirtualDocument';
|
|
24
|
+
export { VirtualElement } from './nodes/VirtualElement';
|
|
25
|
+
export { VirtualTextNode } from './nodes/VirtualTextNode';
|
|
26
|
+
export { IntersectionObserver } from './observers/IntersectionObserver';
|
|
27
|
+
export { MutationObserver } from './observers/MutationObserver';
|
|
28
|
+
export { ResizeObserver } from './observers/ResizeObserver';
|
|
29
|
+
export { parseHTML } from './parsers/html-parser';
|
|
30
|
+
export {
|
|
31
|
+
matchesAttributeSelector,
|
|
32
|
+
matchesPseudoClass,
|
|
33
|
+
matchesSimpleSelector,
|
|
34
|
+
querySelectorAllEngine,
|
|
35
|
+
querySelectorEngine,
|
|
36
|
+
} from './selectors/engine';
|
|
37
|
+
export { createStorage, Storage } from './storage/Storage';
|
|
38
|
+
export { TimerManager } from './timers/TimerManager';
|
|
39
|
+
export { CustomElementRegistry, HTMLElement } from './webcomponents/CustomElementRegistry';
|
|
40
|
+
export { ShadowRoot, type ShadowRootInit } from './webcomponents/ShadowRoot';
|
|
41
|
+
export { DetachedWindowAPI } from './window/DetachedWindowAPI';
|
|
42
|
+
export { GlobalWindow } from './window/GlobalWindow';
|
|
43
|
+
export { Window } from './window/Window';
|
|
44
|
+
export { XPathEvaluator } from './xpath/XPathEvaluator';
|
|
45
|
+
export { XPathResult, XPathResultType } from './xpath/XPathResult';
|