//#region src/attribute.d.ts declare class MockAttributeMap { caseInsensitive: boolean; __items: MockAttr[]; constructor(caseInsensitive?: boolean); get length(): number; item(index: number): MockAttr; setNamedItem(attr: MockAttr): void; setNamedItemNS(attr: MockAttr): void; getNamedItem(attrName: string): MockAttr; getNamedItemNS(namespaceURI: string | null, attrName: string): MockAttr; removeNamedItem(attr: MockAttr): void; removeNamedItemNS(attr: MockAttr): void; [Symbol.iterator](): { next: () => { done: boolean; value: MockAttr; }; }; get [Symbol.toStringTag](): string; } declare function cloneAttributes(srcAttrs: MockAttributeMap, sortByName?: boolean): any; declare class MockAttr { private _localName; private _prefix; private _value; private _namespaceURI; constructor(attrName: string, attrValue: string, namespaceURI?: string | null, prefix?: string | null); get name(): string; set name(value: string); get localName(): string; set localName(value: string); get prefix(): string; set prefix(value: string); get value(): string; set value(value: string); get nodeName(): string; set nodeName(value: string); get nodeValue(): string; set nodeValue(value: string); get namespaceURI(): string; set namespaceURI(namespaceURI: string); } //#endregion //#region src/css-style-declaration.d.ts declare class MockCSSStyleDeclaration { private _styles; setProperty(prop: string, value: string): void; getPropertyValue(prop: string): string; removeProperty(prop: string): void; get length(): number; get cssText(): string; set cssText(cssText: string); } //#endregion //#region src/css-style-sheet.d.ts declare class MockCSSRule { parentStyleSheet: MockCSSStyleSheet; cssText: string; type: number; constructor(parentStyleSheet: MockCSSStyleSheet); } declare class MockCSSStyleSheet { ownerNode?: MockStyleElement; type: string; parentStyleSheet: MockCSSStyleSheet | null; cssRules: MockCSSRule[]; constructor(ownerNode?: MockStyleElement); get rules(): MockCSSRule[]; set rules(rules: MockCSSRule[]); deleteRule(index: number): void; insertRule(rule: string, index?: number): number; replaceSync(cssText: string): void; } //#endregion //#region src/document-fragment.d.ts declare class MockDocumentFragment extends MockHTMLElement { constructor(ownerDocument: any); getElementById(id: string): MockElement; get adoptedStyleSheets(): MockCSSStyleSheet[]; set adoptedStyleSheets(_adoptedStyleSheets: MockCSSStyleSheet[]); cloneNode(deep?: boolean): MockDocumentFragment; } //#endregion //#region src/element.d.ts declare class MockStyleElement extends MockHTMLElement { sheet: MockCSSStyleSheet; constructor(ownerDocument: any); get innerHTML(): string; set innerHTML(value: string); get innerText(): string; set innerText(value: string); get textContent(): string; set textContent(value: string); } declare class MockSVGElement extends MockElement { __namespaceURI: string; get ownerSVGElement(): SVGSVGElement; get viewportElement(): SVGElement; onunload(): void; get pathLength(): number; isPointInFill(_pt: DOMPoint): boolean; isPointInStroke(_pt: DOMPoint): boolean; getTotalLength(): number; } //#endregion //#region src/history.d.ts declare class MockHistory { private items; get length(): number; back(): void; forward(): void; go(_value: number): void; pushState(_state: any, _title: string, _url: string): void; replaceState(_state: any, _title: string, _url: string): void; } //#endregion //#region src/intersection-observer.d.ts declare class MockIntersectionObserver { disconnect(): void; observe(): void; takeRecords(): any[]; unobserve(): void; } //#endregion //#region src/location.d.ts declare class MockLocation implements Location { ancestorOrigins: any; protocol: string; host: string; hostname: string; port: string; pathname: string; search: string; hash: string; username: string; password: string; origin: string; private _href; get href(): string; set href(value: string); constructor(); assign(_url: string): void; reload(_forcedReload?: boolean): void; replace(_url: string): void; toString(): string; } //#endregion //#region src/navigator.d.ts declare class MockNavigator { appCodeName: string; appName: string; appVersion: string; platform: string; userAgent: string; } //#endregion //#region src/resize-observer.d.ts declare class MockResizeObserver { disconnect(): void; observe(): void; takeRecords(): any[]; unobserve(): void; } //#endregion //#region src/shadow-root.d.ts declare class MockShadowRoot extends MockDocumentFragment { private _mode; private _delegatesFocus; private _clonable; private _serializable; get activeElement(): HTMLElement | null; get clonable(): boolean; set clonable(value: boolean); get delegatesFocus(): boolean; set delegatesFocus(value: boolean); get fullscreenElement(): HTMLElement | null; get host(): HTMLElement | null; get mode(): 'open' | 'closed'; set mode(value: 'open' | 'closed'); get pictureInPictureElement(): HTMLElement | null; get pointerLockElement(): HTMLElement | null; get serializable(): boolean; set serializable(value: boolean); get slotAssignment(): 'named' | 'manual'; get styleSheets(): StyleSheet[]; } //#endregion //#region src/storage.d.ts declare class MockStorage { private items; key(_value: number): void; getItem(key: string): string; setItem(key: string, value: string): void; removeItem(key: string): void; clear(): void; } //#endregion //#region src/window.d.ts declare const nativeClearInterval: typeof clearInterval; declare const nativeClearTimeout: typeof clearTimeout; declare const nativeSetInterval: typeof setInterval; declare const nativeSetTimeout: typeof setTimeout; declare class MockWindow { __timeouts: Set; __history: MockHistory; __elementCstr: any; __charDataCstr: any; __docTypeCstr: any; __docCstr: any; __docFragCstr: any; __domTokenListCstr: any; __nodeCstr: any; __nodeListCstr: any; __localStorage: MockStorage; __sessionStorage: MockStorage; __location: MockLocation; __navigator: MockNavigator; __clearInterval: typeof nativeClearInterval; __clearTimeout: typeof nativeClearTimeout; __setInterval: typeof nativeSetInterval; __setTimeout: typeof nativeSetTimeout; __maxTimeout: number; __allowInterval: boolean; URL: typeof URL; console: Console; customElements: CustomElementRegistry | null; document: Document; performance: Performance; devicePixelRatio: number; innerHeight: number; innerWidth: number; pageXOffset: number; pageYOffset: number; screen: Screen; screenLeft: number; screenTop: number; screenX: number; screenY: number; scrollX: number; scrollY: number; CustomEvent: typeof MockCustomEvent; Event: typeof MockEvent; Headers: typeof MockHeaders; FocusEvent: typeof MockFocusEvent; KeyboardEvent: typeof MockKeyboardEvent; MouseEvent: typeof MockMouseEvent; constructor(html?: string | boolean); addEventListener(type: string, handler: (ev?: any) => void, options?: boolean | AddEventListenerOptions): void; alert(msg: string): void; blur(): any; cancelAnimationFrame(id: any): void; cancelIdleCallback(id: any): void; get CharacterData(): any; set CharacterData(charDataCstr: any); clearInterval(id: any): void; clearTimeout(id: any): void; close(): void; confirm(): boolean; get CSS(): { supports: () => boolean; }; get Document(): any; set Document(docCstr: any); get DocumentFragment(): any; set DocumentFragment(docFragCstr: any); get ShadowRoot(): typeof MockShadowRoot; get DocumentType(): any; set DocumentType(docTypeCstr: any); get DOMTokenList(): any; set DOMTokenList(domTokenListCstr: any); dispatchEvent(ev: MockEvent): boolean; get Element(): typeof MockElement; get DOMException(): { new (message?: string, name?: string): DOMException; prototype: DOMException; readonly INDEX_SIZE_ERR: 1; readonly DOMSTRING_SIZE_ERR: 2; readonly HIERARCHY_REQUEST_ERR: 3; readonly WRONG_DOCUMENT_ERR: 4; readonly INVALID_CHARACTER_ERR: 5; readonly NO_DATA_ALLOWED_ERR: 6; readonly NO_MODIFICATION_ALLOWED_ERR: 7; readonly NOT_FOUND_ERR: 8; readonly NOT_SUPPORTED_ERR: 9; readonly INUSE_ATTRIBUTE_ERR: 10; readonly INVALID_STATE_ERR: 11; readonly SYNTAX_ERR: 12; readonly INVALID_MODIFICATION_ERR: 13; readonly NAMESPACE_ERR: 14; readonly INVALID_ACCESS_ERR: 15; readonly VALIDATION_ERR: 16; readonly TYPE_MISMATCH_ERR: 17; readonly SECURITY_ERR: 18; readonly NETWORK_ERR: 19; readonly ABORT_ERR: 20; readonly URL_MISMATCH_ERR: 21; readonly QUOTA_EXCEEDED_ERR: 22; readonly TIMEOUT_ERR: 23; readonly INVALID_NODE_TYPE_ERR: 24; readonly DATA_CLONE_ERR: 25; }; fetch(input: any, init?: any): any; focus(): any; getComputedStyle(_: any): any; get globalThis(): this; get history(): any; set history(hsty: any); get JSON(): JSON; get HTMLElement(): typeof MockHTMLElement; get SVGElement(): typeof MockSVGElement; get IntersectionObserver(): typeof MockIntersectionObserver; get ResizeObserver(): typeof MockResizeObserver; get localStorage(): MockStorage; set localStorage(locStorage: MockStorage); get location(): MockLocation; set location(val: Location | string); matchMedia(media: string): { media: string; matches: boolean; addListener: (_handler: (ev?: any) => void) => void; removeListener: (_handler: (ev?: any) => void) => void; addEventListener: (_type: string, _handler: (ev?: any) => void) => void; removeEventListener: (_type: string, _handler: (ev?: any) => void) => void; dispatchEvent: (_ev: any) => void; onchange: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null; }; get Node(): typeof MockNode; get NodeList(): any; get navigator(): any; set navigator(nav: any); get parent(): any; prompt(): string; open(): any; get origin(): string; removeEventListener(type: string, handler: any, options?: boolean | EventListenerOptions): void; requestAnimationFrame(callback: (timestamp: number) => void): number; requestIdleCallback(callback: (deadline: { didTimeout: boolean; timeRemaining: () => number; }) => void): number; scroll(_x?: number, _y?: number): void; scrollBy(_x?: number, _y?: number): void; scrollTo(_x?: number, _y?: number): void; get self(): this; get sessionStorage(): any; set sessionStorage(locStorage: any); setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): number; setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): number; get top(): this; get window(): this; onanimationstart(): void; onanimationend(): void; onanimationiteration(): void; onabort(): void; onauxclick(): void; onbeforecopy(): void; onbeforecut(): void; onbeforepaste(): void; onblur(): void; oncancel(): void; oncanplay(): void; oncanplaythrough(): void; onchange(): void; onclick(): void; onclose(): void; oncontextmenu(): void; oncopy(): void; oncuechange(): void; oncut(): void; ondblclick(): void; ondrag(): void; ondragend(): void; ondragenter(): void; ondragleave(): void; ondragover(): void; ondragstart(): void; ondrop(): void; ondurationchange(): void; onemptied(): void; onended(): void; onerror(): void; onfocus(): void; onfocusin(): void; onfocusout(): void; onformdata(): void; onfullscreenchange(): void; onfullscreenerror(): void; ongotpointercapture(): void; oninput(): void; oninvalid(): void; onkeydown(): void; onkeypress(): void; onkeyup(): void; onload(): void; onloadeddata(): void; onloadedmetadata(): void; onloadstart(): void; onlostpointercapture(): void; onmousedown(): void; onmouseenter(): void; onmouseleave(): void; onmousemove(): void; onmouseout(): void; onmouseover(): void; onmouseup(): void; onmousewheel(): void; onpaste(): void; onpause(): void; onplay(): void; onplaying(): void; onpointercancel(): void; onpointerdown(): void; onpointerenter(): void; onpointerleave(): void; onpointermove(): void; onpointerout(): void; onpointerover(): void; onpointerup(): void; onprogress(): void; onratechange(): void; onreset(): void; onresize(): void; onscroll(): void; onsearch(): void; onseeked(): void; onseeking(): void; onselect(): void; onselectstart(): void; onstalled(): void; onsubmit(): void; onsuspend(): void; ontimeupdate(): void; ontoggle(): void; onvolumechange(): void; onwaiting(): void; onwebkitfullscreenchange(): void; onwebkitfullscreenerror(): void; onwheel(): void; } declare function cloneWindow(srcWin: Window | MockWindow, opts?: { customElementProxy?: boolean; }): MockWindow | null; declare function cloneDocument(srcDoc: Document): Document; /** * Constrain setTimeout() to 1ms, but still async. Also * only allow setInterval() to fire once, also constrained to 1ms. * @param win the mock window instance to update */ declare function constrainTimeouts(win: MockWindow): void; //#endregion //#region src/event.d.ts declare class MockEvent { bubbles: boolean; cancelBubble: boolean; cancelable: boolean; composed: boolean; currentTarget: MockElement | null; defaultPrevented: boolean; srcElement: MockElement | null; target: MockElement | null; timeStamp: number; type: string; constructor(type: string, eventInitDict?: EventInit); preventDefault(): void; stopPropagation(): void; stopImmediatePropagation(): void; /** * Get the composed path of event propagation. * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath * @returns a composed path of the event */ composedPath(): MockElement[]; } declare class MockCustomEvent extends MockEvent { detail: any; constructor(type: string, customEventInitDic?: CustomEventInit); } declare class MockKeyboardEvent extends MockEvent { code: string; key: string; altKey: boolean; ctrlKey: boolean; metaKey: boolean; shiftKey: boolean; location: number; repeat: boolean; constructor(type: string, keyboardEventInitDic?: KeyboardEventInit); } declare class MockMouseEvent extends MockEvent { screenX: number; screenY: number; clientX: number; clientY: number; ctrlKey: boolean; shiftKey: boolean; altKey: boolean; metaKey: boolean; button: number; buttons: number; relatedTarget: EventTarget | null; constructor(type: string, mouseEventInitDic?: MouseEventInit); } declare class MockUIEvent extends MockEvent { detail: number | null; view: MockWindow | null; constructor(type: string, uiEventInitDic?: UIEventInit); } declare class MockFocusEvent extends MockUIEvent { relatedTarget: EventTarget | null; constructor(type: 'blur' | 'focus', focusEventInitDic?: FocusEventInit); } declare class MockEventListener { type: string; handler: (ev?: any) => void; capture: boolean; once: boolean; constructor(type: string, handler: any, options?: boolean | AddEventListenerOptions); } interface EventTarget { __listeners: MockEventListener[]; } //#endregion //#region src/serialize-node.d.ts /** * Serialize a node (either a DOM node or a mock-doc node) to an HTML string. * This operation is similar to `outerHTML` but allows for more control over the * serialization process. It is fully synchronous meaning that it will not * wait for a component to be fully rendered before serializing it. Use `streamToHtml` * for a streaming version of this function. * * @param elm the node to serialize * @param serializationOptions options to control serialization behavior * @returns an html string */ declare function serializeNodeToHtml(elm: Node | MockNode, serializationOptions?: SerializeNodeToHtmlOptions): string; /** * Partially duplicate of https://github.com/stenciljs/core/blob/6017dad2cb6fe366242e2e0594f82c8e3a3b5d15/src/declarations/stencil-public-compiler.ts#L895 * Types can't be imported in this documented as Eslint will not embed the types * in the d.ts file. */ interface SerializeNodeToHtmlOptions { approximateLineWidth?: number; excludeTagContent?: string[]; excludeTags?: string[]; indentSpaces?: number; newLines?: boolean; outerHtml?: boolean; prettyHtml?: boolean; removeAttributeQuotes?: boolean; removeBooleanAttributeQuotes?: boolean; removeEmptyAttributes?: boolean; removeHtmlComments?: boolean; serializeShadowRoot?: 'declarative-shadow-dom' | 'scoped' | { 'declarative-shadow-dom'?: string[]; scoped?: string[]; default: 'declarative-shadow-dom' | 'scoped'; } | boolean; fullDocument?: boolean; } //#endregion //#region src/token-list.d.ts declare class MockTokenList { private elm; private attr; constructor(elm: HTMLElement, attr: string); add(...tokens: string[]): void; remove(...tokens: string[]): void; contains(token: string): boolean; toggle(token: string): void; get length(): number; item(index: number): string; toString(): string; } //#endregion //#region src/node.d.ts declare class MockNode { private _nodeValue; nodeName: string | null; nodeType: number; ownerDocument: any; parentNode: MockNode | null; private _childNodes; constructor(ownerDocument: any, nodeType: number, nodeName: string | null, nodeValue: string | null); get childNodes(): MockNode[]; set childNodes(value: MockNode[]); appendChild(newNode: MockNode): MockNode; append(...items: (MockNode | string)[]): void; prepend(...items: (MockNode | string)[]): void; cloneNode(deep?: boolean): MockNode; compareDocumentPosition(other: MockNode): number; get firstChild(): MockNode | null; insertBefore(newNode: MockNode, referenceNode: MockNode | null): MockNode; get isConnected(): boolean; isSameNode(node: any): boolean; get lastChild(): MockNode | null; get nextSibling(): MockNode | null; get nodeValue(): string; set nodeValue(value: string); get parentElement(): any; set parentElement(value: any); get previousSibling(): MockNode | null; contains(otherNode: MockNode): boolean; removeChild(childNode: MockNode): MockNode; remove(): void; replaceChild(newChild: MockNode, oldChild: MockNode): MockNode; get textContent(): string; set textContent(value: string); addEventListener(type: string, handler: (ev?: any) => void, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, handler: any, options?: boolean | EventListenerOptions): void; dispatchEvent(ev: MockEvent): boolean; static ELEMENT_NODE: number; static TEXT_NODE: number; static PROCESSING_INSTRUCTION_NODE: number; static COMMENT_NODE: number; static DOCUMENT_NODE: number; static DOCUMENT_TYPE_NODE: number; static DOCUMENT_FRAGMENT_NODE: number; } type MockElementInternals = Record; declare class MockElement extends MockNode { __namespaceURI: string | null; __localName: string | null; __attributeMap: MockAttributeMap | null | undefined; __shadowRoot: ShadowRoot | null | undefined; __style: MockCSSStyleDeclaration | null | undefined; attachInternals(): MockElementInternals; constructor(ownerDocument: any, nodeName: string | null, namespaceURI?: string | null); addEventListener(type: string, handler: (ev?: any) => void, options?: boolean | AddEventListenerOptions): void; attachShadow(_opts: ShadowRootInit): any; blur(): void; get localName(): string; get namespaceURI(): string; get shadowRoot(): any; /** * Set shadow root for element * @param shadowRoot - ShadowRoot to set */ set shadowRoot(shadowRoot: any); get attributes(): MockAttributeMap; set attributes(attrs: MockAttributeMap); get children(): MockElement[]; get childElementCount(): number; get className(): string; set className(value: string); get classList(): MockTokenList; get part(): string | MockTokenList; set part(value: string | MockTokenList); click(): void; cloneNode(_deep?: boolean): MockElement; closest(selector: K): HTMLElementTagNameMap[K] | null; closest(selector: K): SVGElementTagNameMap[K] | null; closest(selector: string): E | null; get dataset(): any; get dir(): string; set dir(value: string); dispatchEvent(ev: MockEvent): boolean; get firstElementChild(): MockElement | null; focus(_options?: { preventScroll?: boolean; }): void; getAttribute(attrName: string): any; getAttributeNS(namespaceURI: string | null, attrName: string): string; getAttributeNode(attrName: string): MockAttr | null; getAttributeNames(): string[]; getBoundingClientRect(): { bottom: number; height: number; left: number; right: number; top: number; width: number; x: number; y: number; }; getRootNode(opts?: { composed?: boolean; [key: string]: any; }): Node; get draggable(): boolean; set draggable(value: boolean); hasChildNodes(): boolean; get id(): string; set id(value: string); get innerHTML(): string; set innerHTML(html: string); get innerText(): string; set innerText(value: string); insertAdjacentElement(position: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend', elm: MockHTMLElement): MockHTMLElement; insertAdjacentHTML(position: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend', html: string): void; insertAdjacentText(position: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend', text: string): void; hasAttribute(attrName: string): boolean; hasAttributeNS(namespaceURI: string | null, name: string): boolean; get hidden(): boolean; set hidden(isHidden: boolean); get lang(): string; set lang(value: string); get lastElementChild(): MockElement | null; matches(selector: string): boolean; get nextElementSibling(): any; get outerHTML(): string; get previousElementSibling(): any; getElementsByClassName(classNames: string): MockElement[]; getElementsByTagName(tagName: string): MockElement[]; querySelector(selectors: K | `${K}.${string}` | `${K}#${string}` | `${K}[${string}` | `${K}:${string}`): HTMLElementTagNameMap[K] | null; querySelector(selectors: K | `${K}.${string}` | `${K}#${string}` | `${K}[${string}` | `${K}:${string}`): SVGElementTagNameMap[K] | null; querySelector(selectors: string): E | null; querySelectorAll(selectors: K): HTMLElementTagNameMap[K][]; querySelectorAll(selectors: K): SVGElementTagNameMap[K][]; querySelectorAll(selectors: string): E[]; removeAttribute(attrName: string): void; removeAttributeNS(namespaceURI: string | null, attrName: string): void; removeEventListener(type: string, handler: any, options?: boolean | EventListenerOptions): void; setAttribute(attrName: string, value: any): void; setAttributeNS(namespaceURI: string | null, attrName: string, value: any): void; get style(): any; set style(val: any); get tabIndex(): number; set tabIndex(value: number); get tagName(): string; set tagName(value: string); get textContent(): string; set textContent(value: string); get title(): string; set title(value: string); animate(): void; onanimationstart(): void; onanimationend(): void; onanimationiteration(): void; onabort(): void; onauxclick(): void; onbeforecopy(): void; onbeforecut(): void; onbeforepaste(): void; onblur(): void; oncancel(): void; oncanplay(): void; oncanplaythrough(): void; onchange(): void; onclick(): void; onclose(): void; oncontextmenu(): void; oncopy(): void; oncuechange(): void; oncut(): void; ondblclick(): void; ondrag(): void; ondragend(): void; ondragenter(): void; ondragleave(): void; ondragover(): void; ondragstart(): void; ondrop(): void; ondurationchange(): void; onemptied(): void; onended(): void; onerror(): void; onfocus(): void; onfocusin(): void; onfocusout(): void; onformdata(): void; onfullscreenchange(): void; onfullscreenerror(): void; ongotpointercapture(): void; oninput(): void; oninvalid(): void; onkeydown(): void; onkeypress(): void; onkeyup(): void; onload(): void; onloadeddata(): void; onloadedmetadata(): void; onloadstart(): void; onlostpointercapture(): void; onmousedown(): void; onmouseenter(): void; onmouseleave(): void; onmousemove(): void; onmouseout(): void; onmouseover(): void; onmouseup(): void; onmousewheel(): void; onpaste(): void; onpause(): void; onplay(): void; onplaying(): void; onpointercancel(): void; onpointerdown(): void; onpointerenter(): void; onpointerleave(): void; onpointermove(): void; onpointerout(): void; onpointerover(): void; onpointerup(): void; onprogress(): void; onratechange(): void; onreset(): void; onresize(): void; onscroll(): void; onsearch(): void; onseeked(): void; onseeking(): void; onselect(): void; onselectstart(): void; onstalled(): void; onsubmit(): void; onsuspend(): void; ontimeupdate(): void; ontoggle(): void; onvolumechange(): void; onwaiting(): void; onwebkitfullscreenchange(): void; onwebkitfullscreenerror(): void; onwheel(): void; requestFullscreen(): void; scrollBy(): void; scrollTo(): void; scrollIntoView(): void; toString(opts?: SerializeNodeToHtmlOptions): string; } declare class MockHTMLElement extends MockElement { __namespaceURI: string; constructor(ownerDocument: any, nodeName: string | null); get tagName(): string; set tagName(value: string); /** * A node’s parent of type Element is known as its parent element. * If the node has a parent of a different type, its parent element * is null. * @returns MockElement */ get parentElement(): any; get attributes(): MockAttributeMap; set attributes(attrs: MockAttributeMap); } declare class MockTextNode extends MockNode { constructor(ownerDocument: any, text: string); cloneNode(_deep?: boolean): MockTextNode; get textContent(): string; set textContent(text: string); get data(): string; set data(text: string); get wholeText(): string; } //#endregion //#region src/comment-node.d.ts declare class MockComment extends MockNode { constructor(ownerDocument: any, data: string); cloneNode(_deep?: boolean): MockComment; get textContent(): string; set textContent(text: string); } //#endregion //#region src/constants.d.ts declare const enum NODE_TYPES { ELEMENT_NODE = 1, TEXT_NODE = 3, COMMENT_NODE = 8, DOCUMENT_NODE = 9, DOCUMENT_TYPE_NODE = 10, DOCUMENT_FRAGMENT_NODE = 11 } //#endregion //#region src/document-type-node.d.ts declare class MockDocumentTypeNode extends MockHTMLElement { constructor(ownerDocument: any); } //#endregion //#region src/document.d.ts /** * Interface for nwsapi instance methods we use. */ interface NwsapiInstance { configure(config: { LOGERRORS?: boolean; VERBOSITY?: boolean; IDS_DUPES?: boolean; }): void; match(selector: string, element: unknown): boolean; first(selector: string, context: unknown): unknown | null; select(selector: string, context: unknown): unknown[]; closest(selector: string, element: unknown): unknown | null; } declare class MockDocument extends MockHTMLElement { #private; defaultView: any; cookie: string; referrer: string; /** * Returns 'CSS1Compat' for standards mode (the default). * Required by nwsapi for quirks mode detection. */ readonly compatMode = "CSS1Compat"; /** * Returns the MIME type of the document. * Required by nwsapi for HTML document detection. */ readonly contentType = "text/html"; constructor(html?: string | boolean | null, win?: any); /** * Get the nwsapi instance for this document. * Lazily creates one if it doesn't exist. * Creates a window if the document doesn't have one. * @returns the nwsapi instance */ _getDOMSelector(): NwsapiInstance; /** * Clear the nwsapi cache. Call this when the document structure changes significantly. */ _clearDOMSelector(): void; get dir(): string; set dir(value: string); get localName(): never; get location(): Location | null; set location(val: string); get baseURI(): string; get URL(): string; get styleSheets(): HTMLStyleElement[]; get scripts(): HTMLScriptElement[]; get forms(): HTMLFormElement[]; get images(): HTMLImageElement[]; get scrollingElement(): MockHTMLElement | MockElement; get documentElement(): MockHTMLElement | MockElement; set documentElement(documentElement: MockHTMLElement | MockElement); get head(): MockHTMLElement | MockElement; set head(head: MockHTMLElement | MockElement); get body(): MockHTMLElement | MockElement; set body(body: MockHTMLElement | MockElement); appendChild(newNode: MockElement): MockElement; createComment(data: string): MockComment; createAttribute(attrName: string): MockAttr; createAttributeNS(namespaceURI: string, attrName: string): MockAttr; createElement(tagName: string): any; createElementNS(namespaceURI: string, tagName: string): any; createTextNode(text: string): MockTextNode; createDocumentFragment(): MockDocumentFragment; createDocumentTypeNode(): MockDocumentTypeNode; /** * Creates a TreeWalker for traversing the document tree. * This is a simplified implementation for dom-selector compatibility. * @param root - the root node for the tree walker * @param whatToShow - a bitmask specifying which nodes to show * @param filter - an optional node filter * @returns a new TreeWalker instance */ createTreeWalker(root: MockElement, whatToShow?: number, filter?: NodeFilter | null): TreeWalker; getElementById(id: string): MockElement; getElementsByName(elmName: string): MockElement[]; get title(): string; set title(value: string); } declare function createDocument(html?: string | boolean | null): Document; declare function createFragment(html?: string): DocumentFragment; declare function resetDocument(doc: Document): void; //#endregion //#region src/global.d.ts declare function setupGlobal(gbl: any): any; declare function teardownGlobal(gbl: any): void; declare function patchWindow(winToBePatched: any): void; //#endregion //#region src/headers.d.ts declare class MockHeaders { private _values; constructor(init?: string[][] | Map | any); append(key: string, value: string): void; delete(key: string): void; entries(): any; forEach(cb: (value: string, key: string) => void): void; get(key: string): string; has(key: string): boolean; keys(): { next(): { value: string; done: boolean; }; [Symbol.iterator](): /*elided*/ any; }; set(key: string, value: string): void; values(): any; [Symbol.iterator](): any; } //#endregion //#region src/parse-html.d.ts declare function parseHtmlToDocument(html: string, ownerDocument?: MockDocument | null): any; declare function parseHtmlToFragment(html: string, ownerDocument?: MockDocument | null): any; //#endregion //#region src/request-response.d.ts type MockRequestInfo = MockRequest | string; interface MockRequestInit { body?: any; cache?: string; credentials?: string; headers?: any; integrity?: string; keepalive?: boolean; method?: string; mode?: string; redirect?: string; referrer?: string; referrerPolicy?: string; } declare class MockRequest { private _method; private _url; bodyUsed: boolean; cache: string; credentials: string; headers: MockHeaders; integrity: string; keepalive: boolean; mode: string; redirect: string; referrer: string; referrerPolicy: string; constructor(input?: any, init?: MockRequestInit); get url(): string; set url(value: string); get method(): string; set method(value: string); clone(): MockRequest; } interface MockResponseInit { headers?: any; ok?: boolean; status?: number; statusText?: string; type?: string; url?: string; } declare class MockResponse { private _body; headers: MockHeaders; ok: boolean; status: number; statusText: string; type: string; url: string; constructor(body?: string, init?: MockResponseInit); json(): Promise; text(): Promise; clone(): MockResponse; } //#endregion export { MockAttr, MockAttributeMap, MockComment, MockCustomEvent, MockDocument, MockElement, MockHTMLElement, MockHeaders, MockKeyboardEvent, MockMouseEvent, MockNode, MockRequest, type MockRequestInfo, type MockRequestInit, MockResponse, type MockResponseInit, MockTextNode, MockWindow, NODE_TYPES, type SerializeNodeToHtmlOptions, cloneAttributes, cloneDocument, cloneWindow, constrainTimeouts, createDocument, createFragment, parseHtmlToDocument, parseHtmlToFragment, patchWindow, resetDocument, serializeNodeToHtml, setupGlobal, teardownGlobal };