@stencil/mock-doc 5.0.0-next.0

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.
@@ -0,0 +1,960 @@
1
+ //#region src/attribute.d.ts
2
+ declare class MockAttributeMap {
3
+ caseInsensitive: boolean;
4
+ __items: MockAttr[];
5
+ constructor(caseInsensitive?: boolean);
6
+ get length(): number;
7
+ item(index: number): MockAttr;
8
+ setNamedItem(attr: MockAttr): void;
9
+ setNamedItemNS(attr: MockAttr): void;
10
+ getNamedItem(attrName: string): MockAttr;
11
+ getNamedItemNS(namespaceURI: string | null, attrName: string): MockAttr;
12
+ removeNamedItem(attr: MockAttr): void;
13
+ removeNamedItemNS(attr: MockAttr): void;
14
+ [Symbol.iterator](): {
15
+ next: () => {
16
+ done: boolean;
17
+ value: MockAttr;
18
+ };
19
+ };
20
+ get [Symbol.toStringTag](): string;
21
+ }
22
+ declare function cloneAttributes(srcAttrs: MockAttributeMap, sortByName?: boolean): any;
23
+ declare class MockAttr {
24
+ private _localName;
25
+ private _prefix;
26
+ private _value;
27
+ private _namespaceURI;
28
+ constructor(attrName: string, attrValue: string, namespaceURI?: string | null, prefix?: string | null);
29
+ get name(): string;
30
+ set name(value: string);
31
+ get localName(): string;
32
+ set localName(value: string);
33
+ get prefix(): string;
34
+ set prefix(value: string);
35
+ get value(): string;
36
+ set value(value: string);
37
+ get nodeName(): string;
38
+ set nodeName(value: string);
39
+ get nodeValue(): string;
40
+ set nodeValue(value: string);
41
+ get namespaceURI(): string;
42
+ set namespaceURI(namespaceURI: string);
43
+ }
44
+ //#endregion
45
+ //#region src/css-style-declaration.d.ts
46
+ declare class MockCSSStyleDeclaration {
47
+ private _styles;
48
+ setProperty(prop: string, value: string): void;
49
+ getPropertyValue(prop: string): string;
50
+ removeProperty(prop: string): void;
51
+ get length(): number;
52
+ get cssText(): string;
53
+ set cssText(cssText: string);
54
+ }
55
+ //#endregion
56
+ //#region src/css-style-sheet.d.ts
57
+ declare class MockCSSRule {
58
+ parentStyleSheet: MockCSSStyleSheet;
59
+ cssText: string;
60
+ type: number;
61
+ constructor(parentStyleSheet: MockCSSStyleSheet);
62
+ }
63
+ declare class MockCSSStyleSheet {
64
+ ownerNode?: MockStyleElement;
65
+ type: string;
66
+ parentStyleSheet: MockCSSStyleSheet;
67
+ cssRules: MockCSSRule[];
68
+ constructor(ownerNode?: MockStyleElement);
69
+ get rules(): MockCSSRule[];
70
+ set rules(rules: MockCSSRule[]);
71
+ deleteRule(index: number): void;
72
+ insertRule(rule: string, index?: number): number;
73
+ replaceSync(cssText: string): void;
74
+ }
75
+ //#endregion
76
+ //#region src/document-fragment.d.ts
77
+ declare class MockDocumentFragment extends MockHTMLElement {
78
+ constructor(ownerDocument: any);
79
+ getElementById(id: string): MockElement;
80
+ get adoptedStyleSheets(): MockCSSStyleSheet[];
81
+ set adoptedStyleSheets(_adoptedStyleSheets: MockCSSStyleSheet[]);
82
+ cloneNode(deep?: boolean): MockDocumentFragment;
83
+ }
84
+ //#endregion
85
+ //#region src/element.d.ts
86
+ declare class MockStyleElement extends MockHTMLElement {
87
+ sheet: MockCSSStyleSheet;
88
+ constructor(ownerDocument: any);
89
+ get innerHTML(): string;
90
+ set innerHTML(value: string);
91
+ get innerText(): string;
92
+ set innerText(value: string);
93
+ get textContent(): string;
94
+ set textContent(value: string);
95
+ }
96
+ declare class MockSVGElement extends MockElement {
97
+ __namespaceURI: string;
98
+ get ownerSVGElement(): SVGSVGElement;
99
+ get viewportElement(): SVGElement;
100
+ onunload(): void;
101
+ get pathLength(): number;
102
+ isPointInFill(_pt: DOMPoint): boolean;
103
+ isPointInStroke(_pt: DOMPoint): boolean;
104
+ getTotalLength(): number;
105
+ }
106
+ //#endregion
107
+ //#region src/history.d.ts
108
+ declare class MockHistory {
109
+ private items;
110
+ get length(): number;
111
+ back(): void;
112
+ forward(): void;
113
+ go(_value: number): void;
114
+ pushState(_state: any, _title: string, _url: string): void;
115
+ replaceState(_state: any, _title: string, _url: string): void;
116
+ }
117
+ //#endregion
118
+ //#region src/intersection-observer.d.ts
119
+ declare class MockIntersectionObserver {
120
+ constructor();
121
+ disconnect(): void;
122
+ observe(): void;
123
+ takeRecords(): any[];
124
+ unobserve(): void;
125
+ }
126
+ //#endregion
127
+ //#region src/location.d.ts
128
+ declare class MockLocation implements Location {
129
+ ancestorOrigins: any;
130
+ protocol: string;
131
+ host: string;
132
+ hostname: string;
133
+ port: string;
134
+ pathname: string;
135
+ search: string;
136
+ hash: string;
137
+ username: string;
138
+ password: string;
139
+ origin: string;
140
+ private _href;
141
+ get href(): string;
142
+ set href(value: string);
143
+ assign(_url: string): void;
144
+ reload(_forcedReload?: boolean): void;
145
+ replace(_url: string): void;
146
+ toString(): string;
147
+ }
148
+ //#endregion
149
+ //#region src/navigator.d.ts
150
+ declare class MockNavigator {
151
+ appCodeName: string;
152
+ appName: string;
153
+ appVersion: string;
154
+ platform: string;
155
+ userAgent: string;
156
+ }
157
+ //#endregion
158
+ //#region src/resize-observer.d.ts
159
+ declare class MockResizeObserver {
160
+ constructor();
161
+ disconnect(): void;
162
+ observe(): void;
163
+ takeRecords(): any[];
164
+ unobserve(): void;
165
+ }
166
+ //#endregion
167
+ //#region src/shadow-root.d.ts
168
+ declare class MockShadowRoot extends MockDocumentFragment {
169
+ get activeElement(): HTMLElement | null;
170
+ get cloneable(): boolean;
171
+ get delegatesFocus(): boolean;
172
+ get fullscreenElement(): HTMLElement | null;
173
+ get host(): HTMLElement | null;
174
+ get mode(): 'open' | 'closed';
175
+ get pictureInPictureElement(): HTMLElement | null;
176
+ get pointerLockElement(): HTMLElement | null;
177
+ get serializable(): boolean;
178
+ get slotAssignment(): 'named' | 'manual';
179
+ get styleSheets(): StyleSheet[];
180
+ }
181
+ //#endregion
182
+ //#region src/storage.d.ts
183
+ declare class MockStorage {
184
+ private items;
185
+ key(_value: number): void;
186
+ getItem(key: string): string;
187
+ setItem(key: string, value: string): void;
188
+ removeItem(key: string): void;
189
+ clear(): void;
190
+ }
191
+ //#endregion
192
+ //#region src/window.d.ts
193
+ declare const nativeClearInterval: typeof clearInterval;
194
+ declare const nativeClearTimeout: typeof clearTimeout;
195
+ declare const nativeSetInterval: typeof setInterval;
196
+ declare const nativeSetTimeout: typeof setTimeout;
197
+ declare class MockWindow {
198
+ __timeouts: Set<any>;
199
+ __history: MockHistory;
200
+ __elementCstr: any;
201
+ __charDataCstr: any;
202
+ __docTypeCstr: any;
203
+ __docCstr: any;
204
+ __docFragCstr: any;
205
+ __domTokenListCstr: any;
206
+ __nodeCstr: any;
207
+ __nodeListCstr: any;
208
+ __localStorage: MockStorage;
209
+ __sessionStorage: MockStorage;
210
+ __location: MockLocation;
211
+ __navigator: MockNavigator;
212
+ __clearInterval: typeof nativeClearInterval;
213
+ __clearTimeout: typeof nativeClearTimeout;
214
+ __setInterval: typeof nativeSetInterval;
215
+ __setTimeout: typeof nativeSetTimeout;
216
+ __maxTimeout: number;
217
+ __allowInterval: boolean;
218
+ URL: typeof URL;
219
+ console: Console;
220
+ customElements: CustomElementRegistry;
221
+ document: Document;
222
+ performance: Performance;
223
+ devicePixelRatio: number;
224
+ innerHeight: number;
225
+ innerWidth: number;
226
+ pageXOffset: number;
227
+ pageYOffset: number;
228
+ screen: Screen;
229
+ screenLeft: number;
230
+ screenTop: number;
231
+ screenX: number;
232
+ screenY: number;
233
+ scrollX: number;
234
+ scrollY: number;
235
+ CustomEvent: typeof MockCustomEvent;
236
+ Event: typeof MockEvent;
237
+ Headers: typeof MockHeaders;
238
+ FocusEvent: typeof MockFocusEvent;
239
+ KeyboardEvent: typeof MockKeyboardEvent;
240
+ MouseEvent: typeof MockMouseEvent;
241
+ constructor(html?: string | boolean);
242
+ addEventListener(type: string, handler: (ev?: any) => void): void;
243
+ alert(msg: string): void;
244
+ blur(): any;
245
+ cancelAnimationFrame(id: any): void;
246
+ cancelIdleCallback(id: any): void;
247
+ get CharacterData(): any;
248
+ set CharacterData(charDataCstr: any);
249
+ clearInterval(id: any): void;
250
+ clearTimeout(id: any): void;
251
+ close(): void;
252
+ confirm(): boolean;
253
+ get CSS(): {
254
+ supports: () => boolean;
255
+ };
256
+ get Document(): any;
257
+ set Document(docCstr: any);
258
+ get DocumentFragment(): any;
259
+ set DocumentFragment(docFragCstr: any);
260
+ get ShadowRoot(): typeof MockShadowRoot;
261
+ get DocumentType(): any;
262
+ set DocumentType(docTypeCstr: any);
263
+ get DOMTokenList(): any;
264
+ set DOMTokenList(domTokenListCstr: any);
265
+ dispatchEvent(ev: MockEvent): boolean;
266
+ get Element(): typeof MockElement;
267
+ fetch(input: any, init?: any): any;
268
+ focus(): any;
269
+ getComputedStyle(_: any): any;
270
+ get globalThis(): this;
271
+ get history(): any;
272
+ set history(hsty: any);
273
+ get JSON(): JSON;
274
+ get HTMLElement(): typeof MockHTMLElement;
275
+ get SVGElement(): typeof MockSVGElement;
276
+ get IntersectionObserver(): typeof MockIntersectionObserver;
277
+ get ResizeObserver(): typeof MockResizeObserver;
278
+ get localStorage(): MockStorage;
279
+ set localStorage(locStorage: MockStorage);
280
+ get location(): MockLocation;
281
+ set location(val: Location | string);
282
+ matchMedia(media: string): {
283
+ media: string;
284
+ matches: boolean;
285
+ addListener: (_handler: (ev?: any) => void) => void;
286
+ removeListener: (_handler: (ev?: any) => void) => void;
287
+ addEventListener: (_type: string, _handler: (ev?: any) => void) => void;
288
+ removeEventListener: (_type: string, _handler: (ev?: any) => void) => void;
289
+ dispatchEvent: (_ev: any) => void;
290
+ onchange: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null;
291
+ };
292
+ get Node(): typeof MockNode;
293
+ get NodeList(): any;
294
+ get navigator(): any;
295
+ set navigator(nav: any);
296
+ get parent(): any;
297
+ prompt(): string;
298
+ open(): any;
299
+ get origin(): string;
300
+ removeEventListener(type: string, handler: any): void;
301
+ requestAnimationFrame(callback: (timestamp: number) => void): number;
302
+ requestIdleCallback(callback: (deadline: {
303
+ didTimeout: boolean;
304
+ timeRemaining: () => number;
305
+ }) => void): number;
306
+ scroll(_x?: number, _y?: number): void;
307
+ scrollBy(_x?: number, _y?: number): void;
308
+ scrollTo(_x?: number, _y?: number): void;
309
+ get self(): this;
310
+ get sessionStorage(): any;
311
+ set sessionStorage(locStorage: any);
312
+ setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): number;
313
+ setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): number;
314
+ get top(): this;
315
+ get window(): this;
316
+ onanimationstart(): void;
317
+ onanimationend(): void;
318
+ onanimationiteration(): void;
319
+ onabort(): void;
320
+ onauxclick(): void;
321
+ onbeforecopy(): void;
322
+ onbeforecut(): void;
323
+ onbeforepaste(): void;
324
+ onblur(): void;
325
+ oncancel(): void;
326
+ oncanplay(): void;
327
+ oncanplaythrough(): void;
328
+ onchange(): void;
329
+ onclick(): void;
330
+ onclose(): void;
331
+ oncontextmenu(): void;
332
+ oncopy(): void;
333
+ oncuechange(): void;
334
+ oncut(): void;
335
+ ondblclick(): void;
336
+ ondrag(): void;
337
+ ondragend(): void;
338
+ ondragenter(): void;
339
+ ondragleave(): void;
340
+ ondragover(): void;
341
+ ondragstart(): void;
342
+ ondrop(): void;
343
+ ondurationchange(): void;
344
+ onemptied(): void;
345
+ onended(): void;
346
+ onerror(): void;
347
+ onfocus(): void;
348
+ onfocusin(): void;
349
+ onfocusout(): void;
350
+ onformdata(): void;
351
+ onfullscreenchange(): void;
352
+ onfullscreenerror(): void;
353
+ ongotpointercapture(): void;
354
+ oninput(): void;
355
+ oninvalid(): void;
356
+ onkeydown(): void;
357
+ onkeypress(): void;
358
+ onkeyup(): void;
359
+ onload(): void;
360
+ onloadeddata(): void;
361
+ onloadedmetadata(): void;
362
+ onloadstart(): void;
363
+ onlostpointercapture(): void;
364
+ onmousedown(): void;
365
+ onmouseenter(): void;
366
+ onmouseleave(): void;
367
+ onmousemove(): void;
368
+ onmouseout(): void;
369
+ onmouseover(): void;
370
+ onmouseup(): void;
371
+ onmousewheel(): void;
372
+ onpaste(): void;
373
+ onpause(): void;
374
+ onplay(): void;
375
+ onplaying(): void;
376
+ onpointercancel(): void;
377
+ onpointerdown(): void;
378
+ onpointerenter(): void;
379
+ onpointerleave(): void;
380
+ onpointermove(): void;
381
+ onpointerout(): void;
382
+ onpointerover(): void;
383
+ onpointerup(): void;
384
+ onprogress(): void;
385
+ onratechange(): void;
386
+ onreset(): void;
387
+ onresize(): void;
388
+ onscroll(): void;
389
+ onsearch(): void;
390
+ onseeked(): void;
391
+ onseeking(): void;
392
+ onselect(): void;
393
+ onselectstart(): void;
394
+ onstalled(): void;
395
+ onsubmit(): void;
396
+ onsuspend(): void;
397
+ ontimeupdate(): void;
398
+ ontoggle(): void;
399
+ onvolumechange(): void;
400
+ onwaiting(): void;
401
+ onwebkitfullscreenchange(): void;
402
+ onwebkitfullscreenerror(): void;
403
+ onwheel(): void;
404
+ }
405
+ declare function cloneWindow(srcWin: Window, opts?: {
406
+ customElementProxy?: boolean;
407
+ }): MockWindow | null;
408
+ declare function cloneDocument(srcDoc: Document): Document;
409
+ /**
410
+ * Constrain setTimeout() to 1ms, but still async. Also
411
+ * only allow setInterval() to fire once, also constrained to 1ms.
412
+ * @param win the mock window instance to update
413
+ */
414
+ declare function constrainTimeouts(win: any): void;
415
+ //#endregion
416
+ //#region src/event.d.ts
417
+ declare class MockEvent {
418
+ bubbles: boolean;
419
+ cancelBubble: boolean;
420
+ cancelable: boolean;
421
+ composed: boolean;
422
+ currentTarget: MockElement;
423
+ defaultPrevented: boolean;
424
+ srcElement: MockElement;
425
+ target: MockElement;
426
+ timeStamp: number;
427
+ type: string;
428
+ constructor(type: string, eventInitDict?: EventInit);
429
+ preventDefault(): void;
430
+ stopPropagation(): void;
431
+ stopImmediatePropagation(): void;
432
+ /**
433
+ * @ref https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
434
+ * @returns a composed path of the event
435
+ */
436
+ composedPath(): MockElement[];
437
+ }
438
+ declare class MockCustomEvent extends MockEvent {
439
+ detail: any;
440
+ constructor(type: string, customEventInitDic?: CustomEventInit);
441
+ }
442
+ declare class MockKeyboardEvent extends MockEvent {
443
+ code: string;
444
+ key: string;
445
+ altKey: boolean;
446
+ ctrlKey: boolean;
447
+ metaKey: boolean;
448
+ shiftKey: boolean;
449
+ location: number;
450
+ repeat: boolean;
451
+ constructor(type: string, keyboardEventInitDic?: KeyboardEventInit);
452
+ }
453
+ declare class MockMouseEvent extends MockEvent {
454
+ screenX: number;
455
+ screenY: number;
456
+ clientX: number;
457
+ clientY: number;
458
+ ctrlKey: boolean;
459
+ shiftKey: boolean;
460
+ altKey: boolean;
461
+ metaKey: boolean;
462
+ button: number;
463
+ buttons: number;
464
+ relatedTarget: EventTarget;
465
+ constructor(type: string, mouseEventInitDic?: MouseEventInit);
466
+ }
467
+ declare class MockUIEvent extends MockEvent {
468
+ detail: number | null;
469
+ view: MockWindow | null;
470
+ constructor(type: string, uiEventInitDic?: UIEventInit);
471
+ }
472
+ declare class MockFocusEvent extends MockUIEvent {
473
+ relatedTarget: EventTarget | null;
474
+ constructor(type: 'blur' | 'focus', focusEventInitDic?: FocusEventInit);
475
+ }
476
+ declare class MockEventListener {
477
+ type: string;
478
+ handler: (ev?: any) => void;
479
+ constructor(type: string, handler: any);
480
+ }
481
+ interface EventTarget {
482
+ __listeners: MockEventListener[];
483
+ }
484
+ //#endregion
485
+ //#region src/serialize-node.d.ts
486
+ /**
487
+ * Serialize a node (either a DOM node or a mock-doc node) to an HTML string.
488
+ * This operation is similar to `outerHTML` but allows for more control over the
489
+ * serialization process. It is fully synchronous meaning that it will not
490
+ * wait for a component to be fully rendered before serializing it. Use `streamToHtml`
491
+ * for a streaming version of this function.
492
+ *
493
+ * @param elm the node to serialize
494
+ * @param serializationOptions options to control serialization behavior
495
+ * @returns an html string
496
+ */
497
+ declare function serializeNodeToHtml(elm: Node | MockNode, serializationOptions?: SerializeNodeToHtmlOptions): string;
498
+ /**
499
+ * Partially duplicate of https://github.com/stenciljs/core/blob/6017dad2cb6fe366242e2e0594f82c8e3a3b5d15/src/declarations/stencil-public-compiler.ts#L895
500
+ * Types can't be imported in this documented as Eslint will not embed the types
501
+ * in the d.ts file.
502
+ */
503
+ interface SerializeNodeToHtmlOptions {
504
+ approximateLineWidth?: number;
505
+ excludeTagContent?: string[];
506
+ excludeTags?: string[];
507
+ indentSpaces?: number;
508
+ newLines?: boolean;
509
+ outerHtml?: boolean;
510
+ prettyHtml?: boolean;
511
+ removeAttributeQuotes?: boolean;
512
+ removeBooleanAttributeQuotes?: boolean;
513
+ removeEmptyAttributes?: boolean;
514
+ removeHtmlComments?: boolean;
515
+ serializeShadowRoot?: 'declarative-shadow-dom' | 'scoped' | {
516
+ 'declarative-shadow-dom'?: string[];
517
+ scoped?: string[];
518
+ default: 'declarative-shadow-dom' | 'scoped';
519
+ } | boolean;
520
+ fullDocument?: boolean;
521
+ }
522
+ //#endregion
523
+ //#region src/token-list.d.ts
524
+ declare class MockTokenList {
525
+ private elm;
526
+ private attr;
527
+ constructor(elm: HTMLElement, attr: string);
528
+ add(...tokens: string[]): void;
529
+ remove(...tokens: string[]): void;
530
+ contains(token: string): boolean;
531
+ toggle(token: string): void;
532
+ get length(): number;
533
+ item(index: number): string;
534
+ toString(): string;
535
+ }
536
+ //#endregion
537
+ //#region src/node.d.ts
538
+ declare class MockNode {
539
+ private _nodeValue;
540
+ nodeName: string | null;
541
+ nodeType: number;
542
+ ownerDocument: any;
543
+ parentNode: MockNode | null;
544
+ private _childNodes;
545
+ constructor(ownerDocument: any, nodeType: number, nodeName: string | null, nodeValue: string | null);
546
+ get childNodes(): MockNode[];
547
+ set childNodes(value: MockNode[]);
548
+ appendChild(newNode: MockNode): MockNode;
549
+ append(...items: (MockNode | string)[]): void;
550
+ prepend(...items: (MockNode | string)[]): void;
551
+ cloneNode(deep?: boolean): MockNode;
552
+ compareDocumentPosition(_other: MockNode): number;
553
+ get firstChild(): MockNode | null;
554
+ insertBefore(newNode: MockNode, referenceNode: MockNode): MockNode;
555
+ get isConnected(): boolean;
556
+ isSameNode(node: any): boolean;
557
+ get lastChild(): MockNode | null;
558
+ get nextSibling(): MockNode | null;
559
+ get nodeValue(): string;
560
+ set nodeValue(value: string);
561
+ get parentElement(): any;
562
+ set parentElement(value: any);
563
+ get previousSibling(): MockNode | null;
564
+ contains(otherNode: MockNode): boolean;
565
+ removeChild(childNode: MockNode): MockNode;
566
+ remove(): void;
567
+ replaceChild(newChild: MockNode, oldChild: MockNode): MockNode;
568
+ get textContent(): string;
569
+ set textContent(value: string);
570
+ addEventListener(type: string, handler: (ev?: any) => void): void;
571
+ removeEventListener(type: string, handler: any): void;
572
+ dispatchEvent(ev: MockEvent): boolean;
573
+ static ELEMENT_NODE: number;
574
+ static TEXT_NODE: number;
575
+ static PROCESSING_INSTRUCTION_NODE: number;
576
+ static COMMENT_NODE: number;
577
+ static DOCUMENT_NODE: number;
578
+ static DOCUMENT_TYPE_NODE: number;
579
+ static DOCUMENT_FRAGMENT_NODE: number;
580
+ }
581
+ type MockElementInternals = Record<keyof ElementInternals, null>;
582
+ declare class MockElement extends MockNode {
583
+ __namespaceURI: string | null;
584
+ __localName: string | null;
585
+ __attributeMap: MockAttributeMap | null | undefined;
586
+ __shadowRoot: ShadowRoot | null | undefined;
587
+ __style: MockCSSStyleDeclaration | null | undefined;
588
+ attachInternals(): MockElementInternals;
589
+ constructor(ownerDocument: any, nodeName: string | null, namespaceURI?: string | null);
590
+ addEventListener(type: string, handler: (ev?: any) => void): void;
591
+ attachShadow(_opts: ShadowRootInit): any;
592
+ blur(): void;
593
+ get localName(): string;
594
+ get namespaceURI(): string;
595
+ get shadowRoot(): any;
596
+ /**
597
+ * Set shadow root for element
598
+ * @param shadowRoot - ShadowRoot to set
599
+ */
600
+ set shadowRoot(shadowRoot: any);
601
+ get attributes(): MockAttributeMap;
602
+ set attributes(attrs: MockAttributeMap);
603
+ get children(): MockElement[];
604
+ get childElementCount(): number;
605
+ get className(): string;
606
+ set className(value: string);
607
+ get classList(): MockTokenList;
608
+ get part(): string | MockTokenList;
609
+ set part(value: string | MockTokenList);
610
+ click(): void;
611
+ cloneNode(_deep?: boolean): MockElement;
612
+ closest(selector: string): this;
613
+ get dataset(): any;
614
+ get dir(): string;
615
+ set dir(value: string);
616
+ dispatchEvent(ev: MockEvent): boolean;
617
+ get firstElementChild(): MockElement | null;
618
+ focus(_options?: {
619
+ preventScroll?: boolean;
620
+ }): void;
621
+ getAttribute(attrName: string): any;
622
+ getAttributeNS(namespaceURI: string | null, attrName: string): string;
623
+ getAttributeNode(attrName: string): MockAttr | null;
624
+ getAttributeNames(): string[];
625
+ getBoundingClientRect(): {
626
+ bottom: number;
627
+ height: number;
628
+ left: number;
629
+ right: number;
630
+ top: number;
631
+ width: number;
632
+ x: number;
633
+ y: number;
634
+ };
635
+ getRootNode(opts?: {
636
+ composed?: boolean;
637
+ [key: string]: any;
638
+ }): Node;
639
+ get draggable(): boolean;
640
+ set draggable(value: boolean);
641
+ hasChildNodes(): boolean;
642
+ get id(): string;
643
+ set id(value: string);
644
+ get innerHTML(): string;
645
+ set innerHTML(html: string);
646
+ get innerText(): string;
647
+ set innerText(value: string);
648
+ insertAdjacentElement(position: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend', elm: MockHTMLElement): MockHTMLElement;
649
+ insertAdjacentHTML(position: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend', html: string): void;
650
+ insertAdjacentText(position: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend', text: string): void;
651
+ hasAttribute(attrName: string): boolean;
652
+ hasAttributeNS(namespaceURI: string | null, name: string): boolean;
653
+ get hidden(): boolean;
654
+ set hidden(isHidden: boolean);
655
+ get lang(): string;
656
+ set lang(value: string);
657
+ get lastElementChild(): MockElement | null;
658
+ matches(selector: string): boolean;
659
+ get nextElementSibling(): any;
660
+ get outerHTML(): string;
661
+ get previousElementSibling(): any;
662
+ getElementsByClassName(classNames: string): MockElement[];
663
+ getElementsByTagName(tagName: string): MockElement[];
664
+ querySelector(selector: string): any;
665
+ querySelectorAll(selector: string): any;
666
+ removeAttribute(attrName: string): void;
667
+ removeAttributeNS(namespaceURI: string | null, attrName: string): void;
668
+ removeEventListener(type: string, handler: any): void;
669
+ setAttribute(attrName: string, value: any): void;
670
+ setAttributeNS(namespaceURI: string | null, attrName: string, value: any): void;
671
+ get style(): any;
672
+ set style(val: any);
673
+ get tabIndex(): number;
674
+ set tabIndex(value: number);
675
+ get tagName(): string;
676
+ set tagName(value: string);
677
+ get textContent(): string;
678
+ set textContent(value: string);
679
+ get title(): string;
680
+ set title(value: string);
681
+ animate(): void;
682
+ onanimationstart(): void;
683
+ onanimationend(): void;
684
+ onanimationiteration(): void;
685
+ onabort(): void;
686
+ onauxclick(): void;
687
+ onbeforecopy(): void;
688
+ onbeforecut(): void;
689
+ onbeforepaste(): void;
690
+ onblur(): void;
691
+ oncancel(): void;
692
+ oncanplay(): void;
693
+ oncanplaythrough(): void;
694
+ onchange(): void;
695
+ onclick(): void;
696
+ onclose(): void;
697
+ oncontextmenu(): void;
698
+ oncopy(): void;
699
+ oncuechange(): void;
700
+ oncut(): void;
701
+ ondblclick(): void;
702
+ ondrag(): void;
703
+ ondragend(): void;
704
+ ondragenter(): void;
705
+ ondragleave(): void;
706
+ ondragover(): void;
707
+ ondragstart(): void;
708
+ ondrop(): void;
709
+ ondurationchange(): void;
710
+ onemptied(): void;
711
+ onended(): void;
712
+ onerror(): void;
713
+ onfocus(): void;
714
+ onfocusin(): void;
715
+ onfocusout(): void;
716
+ onformdata(): void;
717
+ onfullscreenchange(): void;
718
+ onfullscreenerror(): void;
719
+ ongotpointercapture(): void;
720
+ oninput(): void;
721
+ oninvalid(): void;
722
+ onkeydown(): void;
723
+ onkeypress(): void;
724
+ onkeyup(): void;
725
+ onload(): void;
726
+ onloadeddata(): void;
727
+ onloadedmetadata(): void;
728
+ onloadstart(): void;
729
+ onlostpointercapture(): void;
730
+ onmousedown(): void;
731
+ onmouseenter(): void;
732
+ onmouseleave(): void;
733
+ onmousemove(): void;
734
+ onmouseout(): void;
735
+ onmouseover(): void;
736
+ onmouseup(): void;
737
+ onmousewheel(): void;
738
+ onpaste(): void;
739
+ onpause(): void;
740
+ onplay(): void;
741
+ onplaying(): void;
742
+ onpointercancel(): void;
743
+ onpointerdown(): void;
744
+ onpointerenter(): void;
745
+ onpointerleave(): void;
746
+ onpointermove(): void;
747
+ onpointerout(): void;
748
+ onpointerover(): void;
749
+ onpointerup(): void;
750
+ onprogress(): void;
751
+ onratechange(): void;
752
+ onreset(): void;
753
+ onresize(): void;
754
+ onscroll(): void;
755
+ onsearch(): void;
756
+ onseeked(): void;
757
+ onseeking(): void;
758
+ onselect(): void;
759
+ onselectstart(): void;
760
+ onstalled(): void;
761
+ onsubmit(): void;
762
+ onsuspend(): void;
763
+ ontimeupdate(): void;
764
+ ontoggle(): void;
765
+ onvolumechange(): void;
766
+ onwaiting(): void;
767
+ onwebkitfullscreenchange(): void;
768
+ onwebkitfullscreenerror(): void;
769
+ onwheel(): void;
770
+ requestFullscreen(): void;
771
+ scrollBy(): void;
772
+ scrollTo(): void;
773
+ scrollIntoView(): void;
774
+ toString(opts?: SerializeNodeToHtmlOptions): string;
775
+ }
776
+ declare class MockHTMLElement extends MockElement {
777
+ __namespaceURI: string;
778
+ constructor(ownerDocument: any, nodeName: string | null);
779
+ get tagName(): string;
780
+ set tagName(value: string);
781
+ /**
782
+ * A node’s parent of type Element is known as its parent element.
783
+ * If the node has a parent of a different type, its parent element
784
+ * is null.
785
+ * @returns MockElement
786
+ */
787
+ get parentElement(): any;
788
+ get attributes(): MockAttributeMap;
789
+ set attributes(attrs: MockAttributeMap);
790
+ }
791
+ declare class MockTextNode extends MockNode {
792
+ constructor(ownerDocument: any, text: string);
793
+ cloneNode(_deep?: boolean): MockTextNode;
794
+ get textContent(): string;
795
+ set textContent(text: string);
796
+ get data(): string;
797
+ set data(text: string);
798
+ get wholeText(): string;
799
+ }
800
+ //#endregion
801
+ //#region src/comment-node.d.ts
802
+ declare class MockComment extends MockNode {
803
+ constructor(ownerDocument: any, data: string);
804
+ cloneNode(_deep?: boolean): MockComment;
805
+ get textContent(): string;
806
+ set textContent(text: string);
807
+ }
808
+ //#endregion
809
+ //#region src/constants.d.ts
810
+ declare const enum NODE_TYPES {
811
+ ELEMENT_NODE = 1,
812
+ ATTRIBUTE_NODE = 2,
813
+ TEXT_NODE = 3,
814
+ CDATA_SECTION_NODE = 4,
815
+ ENTITY_REFERENCE_NODE = 5,
816
+ ENTITY_NODE = 6,
817
+ PROCESSING_INSTRUCTION_NODE = 7,
818
+ COMMENT_NODE = 8,
819
+ DOCUMENT_NODE = 9,
820
+ DOCUMENT_TYPE_NODE = 10,
821
+ DOCUMENT_FRAGMENT_NODE = 11,
822
+ NOTATION_NODE = 12
823
+ }
824
+ //#endregion
825
+ //#region src/document-type-node.d.ts
826
+ declare class MockDocumentTypeNode extends MockHTMLElement {
827
+ constructor(ownerDocument: any);
828
+ }
829
+ //#endregion
830
+ //#region src/document.d.ts
831
+ declare class MockDocument extends MockHTMLElement {
832
+ defaultView: any;
833
+ cookie: string;
834
+ referrer: string;
835
+ constructor(html?: string | boolean | null, win?: any);
836
+ get dir(): string;
837
+ set dir(value: string);
838
+ get localName(): never;
839
+ get location(): Location | null;
840
+ set location(val: string);
841
+ get baseURI(): string;
842
+ get URL(): string;
843
+ get styleSheets(): any;
844
+ get scripts(): any;
845
+ get forms(): any;
846
+ get images(): any;
847
+ get scrollingElement(): MockElement | MockHTMLElement;
848
+ get documentElement(): MockElement | MockHTMLElement;
849
+ set documentElement(documentElement: MockElement | MockHTMLElement);
850
+ get head(): MockElement | MockHTMLElement;
851
+ set head(head: MockElement | MockHTMLElement);
852
+ get body(): MockElement | MockHTMLElement;
853
+ set body(body: MockElement | MockHTMLElement);
854
+ appendChild(newNode: MockElement): MockElement;
855
+ createComment(data: string): MockComment;
856
+ createAttribute(attrName: string): MockAttr;
857
+ createAttributeNS(namespaceURI: string, attrName: string): MockAttr;
858
+ createElement(tagName: string): any;
859
+ createElementNS(namespaceURI: string, tagName: string): any;
860
+ createTextNode(text: string): MockTextNode;
861
+ createDocumentFragment(): MockDocumentFragment;
862
+ createDocumentTypeNode(): MockDocumentTypeNode;
863
+ getElementById(id: string): MockElement;
864
+ getElementsByName(elmName: string): MockElement[];
865
+ get title(): string;
866
+ set title(value: string);
867
+ }
868
+ declare function createDocument(html?: string | boolean): Document;
869
+ declare function createFragment(html?: string): DocumentFragment;
870
+ declare function resetDocument(doc: Document): void;
871
+ //#endregion
872
+ //#region src/global.d.ts
873
+ declare function setupGlobal(gbl: any): any;
874
+ declare function teardownGlobal(gbl: any): void;
875
+ declare function patchWindow(winToBePatched: any): void;
876
+ //#endregion
877
+ //#region src/headers.d.ts
878
+ declare class MockHeaders {
879
+ private _values;
880
+ constructor(init?: string[][] | Map<string, string> | any);
881
+ append(key: string, value: string): void;
882
+ delete(key: string): void;
883
+ entries(): any;
884
+ forEach(cb: (value: string, key: string) => void): void;
885
+ get(key: string): string;
886
+ has(key: string): boolean;
887
+ keys(): {
888
+ next(): {
889
+ value: string;
890
+ done: boolean;
891
+ };
892
+ [Symbol.iterator](): any;
893
+ };
894
+ set(key: string, value: string): void;
895
+ values(): any;
896
+ [Symbol.iterator](): any;
897
+ }
898
+ //#endregion
899
+ //#region src/parse-html.d.ts
900
+ declare function parseHtmlToDocument(html: string, ownerDocument?: MockDocument): any;
901
+ declare function parseHtmlToFragment(html: string, ownerDocument?: MockDocument): any;
902
+ //#endregion
903
+ //#region src/request-response.d.ts
904
+ type MockRequestInfo = MockRequest | string;
905
+ interface MockRequestInit {
906
+ body?: any;
907
+ cache?: string;
908
+ credentials?: string;
909
+ headers?: any;
910
+ integrity?: string;
911
+ keepalive?: boolean;
912
+ method?: string;
913
+ mode?: string;
914
+ redirect?: string;
915
+ referrer?: string;
916
+ referrerPolicy?: string;
917
+ }
918
+ declare class MockRequest {
919
+ private _method;
920
+ private _url;
921
+ bodyUsed: boolean;
922
+ cache: string;
923
+ credentials: string;
924
+ headers: MockHeaders;
925
+ integrity: string;
926
+ keepalive: boolean;
927
+ mode: string;
928
+ redirect: string;
929
+ referrer: string;
930
+ referrerPolicy: string;
931
+ constructor(input?: any, init?: MockRequestInit);
932
+ get url(): string;
933
+ set url(value: string);
934
+ get method(): string;
935
+ set method(value: string);
936
+ clone(): MockRequest;
937
+ }
938
+ interface MockResponseInit {
939
+ headers?: any;
940
+ ok?: boolean;
941
+ status?: number;
942
+ statusText?: string;
943
+ type?: string;
944
+ url?: string;
945
+ }
946
+ declare class MockResponse {
947
+ private _body;
948
+ headers: MockHeaders;
949
+ ok: boolean;
950
+ status: number;
951
+ statusText: string;
952
+ type: string;
953
+ url: string;
954
+ constructor(body?: string, init?: MockResponseInit);
955
+ json(): Promise<any>;
956
+ text(): Promise<string>;
957
+ clone(): MockResponse;
958
+ }
959
+ //#endregion
960
+ 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 };