incajs 0.0.30 → 0.0.32

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.
@@ -96,7 +96,7 @@ interface NodeListOf<T extends IncaNode> {
96
96
  }
97
97
  /** An attribute of an element. It has no `Node` members. */
98
98
  interface Attr {
99
- /** The attribute name in lower case. */
99
+ /** The attribute name as the element keys it: lower case on an HTML element. */
100
100
  readonly name: string;
101
101
  /** The same as `name`. */
102
102
  readonly localName: string;
@@ -115,6 +115,35 @@ interface Attr {
115
115
  /** The element that holds the attribute, or `null` once the attribute is removed. */
116
116
  readonly ownerElement: IncaElement | null;
117
117
  }
118
+ /**
119
+ * The `data-*` attributes of an element as properties. The key `fooBar` names the attribute
120
+ * `data-foo-bar`. Reads give text and writes convert the value to text.
121
+ */
122
+ interface DOMStringMap {
123
+ [name: string]: string | undefined;
124
+ }
125
+ /** The live set of the tokens of the `class` attribute. It is read from `classList`. */
126
+ interface DOMTokenList {
127
+ /** The number of tokens. */
128
+ readonly length: number;
129
+ /** The attribute text. Assigning sets the attribute. */
130
+ value: string;
131
+ toString(): string;
132
+ /** Returns the token at `index`, or `null`. */
133
+ item(index: number): string | null;
134
+ contains(token: string): boolean;
135
+ add(...tokens: string[]): void;
136
+ remove(...tokens: string[]): void;
137
+ toggle(token: string, force?: boolean): boolean;
138
+ replace(token: string, newToken: string): boolean;
139
+ /** Throws a `TypeError`, because `class` defines no supported tokens. */
140
+ supports(token: string): boolean;
141
+ forEach(callback: (token: string, index: number, list: DOMTokenList) => void, thisArg?: unknown): void;
142
+ keys(): IteratorObject<number, undefined, unknown>;
143
+ values(): IteratorObject<string, undefined, unknown>;
144
+ entries(): IteratorObject<[number, string], undefined, unknown>;
145
+ [Symbol.iterator](): IteratorObject<string, undefined, unknown>;
146
+ }
118
147
  /** A live, read-only list of the attributes of an element in the order they were set. */
119
148
  interface NamedNodeMap {
120
149
  readonly [index: number]: Attr;
@@ -139,28 +168,28 @@ interface NamedNodeMap {
139
168
  /** The members every node has: what it is, its data and its place in the tree. */
140
169
  interface NodeMembers {
141
170
  /**
142
- * `1` for an element, `3` for a text node, `8` for a comment stand-in and `11` for a
143
- * fragment.
171
+ * `1` for an element, `3` for a text node, `8` for a comment stand-in, `9` for the document and
172
+ * `11` for a fragment.
144
173
  */
145
- readonly nodeType: 1 | 3 | 8 | 11;
174
+ readonly nodeType: 1 | 3 | 8 | 9 | 11;
146
175
  /**
147
176
  * The {@link IncaElement.tagName} of an element, `"#text"` for a text node, `"#comment"` for a
148
- * comment stand-in and `"#document-fragment"` for a fragment.
177
+ * comment stand-in, `"#document"` for the document and `"#document-fragment"` for a fragment.
149
178
  */
150
179
  readonly nodeName: string;
151
180
  /**
152
- * The data of a text node or a comment stand-in, and `null` for an element or a
181
+ * The data of a text node or a comment stand-in, and `null` for an element, the document or a
153
182
  * fragment. Assigning `null` or `undefined` stores `""` and any other value stores its string.
154
- * Assigning to an element, a fragment or a freed node does nothing.
183
+ * Assigning to an element, the document, a fragment or a freed node does nothing.
155
184
  */
156
185
  nodeValue: string | null;
157
- /** Whether the node hangs under the mount container, which counts as connected. */
186
+ /** Whether the node hangs under `document`. */
158
187
  readonly isConnected: boolean;
159
- /** The `document` export. */
160
- readonly ownerDocument: IncaDocument;
188
+ /** `document`, and `null` for `document` itself. */
189
+ readonly ownerDocument: IncaDocument | null;
161
190
  /**
162
- * The parent, `document` for the mount container and `null` for a detached node. A node inside
163
- * a fragment reads the fragment. A freed node reads `null`.
191
+ * The parent, or `null` for a detached node. A node inside a fragment reads the fragment. A
192
+ * freed node reads `null`.
164
193
  */
165
194
  readonly parentNode: IncaElement | IncaFragment | IncaDocument | null;
166
195
  /** The first child, or `null`. */
@@ -221,10 +250,10 @@ interface NodeMembers {
221
250
  */
222
251
  contains(other: IncaNode | null): boolean;
223
252
  /**
224
- * The `document` export while the node hangs under the mount container, else the topmost node
225
- * of its subtree, the node itself without a parent.
253
+ * The topmost node above this one: `document` for a connected node, else the top of its
254
+ * subtree, the node itself without a parent.
226
255
  */
227
- getRootNode(): IncaNode | IncaDocument;
256
+ getRootNode(): IncaNode;
228
257
  /**
229
258
  * The position of `other` relative to this node as a bit mask: `1` disconnected, `2` preceding,
230
259
  * `4` following, `8` contains, `16` contained by and `32` implementation specific. Nodes of
@@ -309,6 +338,127 @@ interface TextMembers {
309
338
  */
310
339
  splitText(offset: number): IncaText;
311
340
  }
341
+ /**
342
+ * The inline style of an element. Every style key and every CSS alias is a property in camelCase
343
+ * and in kebab-case, and the host-only style keys are properties too. Reading a property gives the
344
+ * declaration in its serialized form, or an empty string when the block has none.
345
+ * Assigning a property sets the declaration, and an empty string removes it. A value the host
346
+ * cannot read prints a warning and leaves the block as it was. The block of a freed element reads
347
+ * empty and ignores writes. It is not constructible, has no indexed access and is not iterable.
348
+ */
349
+ interface CSSStyleDeclaration {
350
+ /** The number of declarations. */
351
+ readonly length: number;
352
+ /**
353
+ * The declarations as `name: value;` text in the order they were set. Assigning replaces all
354
+ * declarations with the ones the text holds, and `null` assigns `""`.
355
+ */
356
+ cssText: string;
357
+ /**
358
+ * The serialized value of the declaration `property`, or an empty string when it is unset.
359
+ * @param property - The CSS name, such as `background-color`.
360
+ * @returns The value.
361
+ */
362
+ getPropertyValue(property: string): string;
363
+ /**
364
+ * Sets the declaration `property` to `value`, and removes it when `value` is `null` or `""`.
365
+ * A `priority` other than `""` and `"important"` leaves the block as it was.
366
+ * @param property - The CSS name.
367
+ * @param value - The value, converted to text.
368
+ * @param priority - The priority, which the host does not keep.
369
+ */
370
+ setProperty(property: string, value: string | null, priority?: string | null): void;
371
+ /**
372
+ * Removes the declaration `property`.
373
+ * @param property - The CSS name.
374
+ * @returns The value the declaration had, or an empty string when it was unset.
375
+ */
376
+ removeProperty(property: string): string;
377
+ /**
378
+ * The priority of the declaration `property`.
379
+ * @param property - The CSS name.
380
+ * @returns Always an empty string.
381
+ */
382
+ getPropertyPriority(property: string): string;
383
+ /**
384
+ * The CSS name of the declaration at `index`, in the order they were set.
385
+ * @param index - The position, converted to an unsigned 32-bit integer.
386
+ * @returns The name, or an empty string beyond the list.
387
+ */
388
+ item(index: number): string;
389
+ display: string;
390
+ "flex-direction": string;
391
+ flexDirection: string;
392
+ "justify-content": string;
393
+ justifyContent: string;
394
+ "align-items": string;
395
+ alignItems: string;
396
+ gap: string;
397
+ width: string;
398
+ height: string;
399
+ "border-width": string;
400
+ borderWidth: string;
401
+ background: string;
402
+ "background-color": string;
403
+ backgroundColor: string;
404
+ "border-color": string;
405
+ borderColor: string;
406
+ "corner-radius": string;
407
+ cornerRadius: string;
408
+ "border-radius": string;
409
+ borderRadius: string;
410
+ "text-color": string;
411
+ textColor: string;
412
+ color: string;
413
+ "text-size": string;
414
+ textSize: string;
415
+ "font-size": string;
416
+ fontSize: string;
417
+ overflow: string;
418
+ "overflow-x": string;
419
+ overflowX: string;
420
+ "overflow-y": string;
421
+ overflowY: string;
422
+ "flex-grow": string;
423
+ flexGrow: string;
424
+ "flex-shrink": string;
425
+ flexShrink: string;
426
+ opacity: string;
427
+ "min-width": string;
428
+ minWidth: string;
429
+ "min-height": string;
430
+ minHeight: string;
431
+ "max-width": string;
432
+ maxWidth: string;
433
+ "max-height": string;
434
+ maxHeight: string;
435
+ padding: string;
436
+ "padding-x": string;
437
+ paddingX: string;
438
+ "padding-y": string;
439
+ paddingY: string;
440
+ "padding-top": string;
441
+ paddingTop: string;
442
+ "padding-right": string;
443
+ paddingRight: string;
444
+ "padding-bottom": string;
445
+ paddingBottom: string;
446
+ "padding-left": string;
447
+ paddingLeft: string;
448
+ margin: string;
449
+ "margin-x": string;
450
+ marginX: string;
451
+ "margin-y": string;
452
+ marginY: string;
453
+ "margin-top": string;
454
+ marginTop: string;
455
+ "margin-right": string;
456
+ marginRight: string;
457
+ "margin-bottom": string;
458
+ marginBottom: string;
459
+ "margin-left": string;
460
+ marginLeft: string;
461
+ }
312
462
  /** The members that read and write the markup of an element. */
313
463
  interface HtmlMembers {
314
464
  /**
@@ -320,13 +470,15 @@ interface HtmlMembers {
320
470
  /**
321
471
  * The markup of the element and its children. Assigning replaces the element with the nodes the
322
472
  * string parses to in the context of its parent, and `null` assigns `""`. An element without a
323
- * parent keeps its place. The mount container throws a `NoModificationAllowedError`.
473
+ * parent keeps its place. An element whose parent is `document` throws a
474
+ * `NoModificationAllowedError`.
324
475
  */
325
476
  outerHTML: string;
326
477
  /**
327
478
  * Parses `text` and inserts the nodes at `position`: `beforebegin`, `afterbegin`, `beforeend` or
328
479
  * `afterend`, in any ASCII case. Another position throws a `SyntaxError`. `beforebegin` and
329
- * `afterend` on an element without a parent throw a `NoModificationAllowedError`.
480
+ * `afterend` on an element without a parent or whose parent is `document` throw a
481
+ * `NoModificationAllowedError`.
330
482
  */
331
483
  insertAdjacentHTML(position: string, text: string): void;
332
484
  }
@@ -346,16 +498,33 @@ interface IncaElement extends IncaEventTarget, EventHandlers, NodeMembers, TextC
346
498
  * the attribute to the value as a string.
347
499
  */
348
500
  id: string;
501
+ /**
502
+ * The `class` attribute, or an empty string when it is unset. Assigning sets the attribute to the
503
+ * value as a string.
504
+ */
505
+ className: string;
506
+ /**
507
+ * The live token list of the `class` attribute. Every read returns the same list. Assigning a
508
+ * string sets the `value` of the list.
509
+ */
510
+ get classList(): DOMTokenList;
511
+ set classList(value: string);
349
512
  /**
350
513
  * `"comment"` for the hidden stand-in `createCommentNode` makes;
351
514
  * `"element"` for every other container.
352
515
  */
353
516
  readonly kind: "element" | "comment";
354
517
  /**
355
- * The tag of the element in ASCII upper case, such as `"BUTTON"`. The mount container reads
356
- * `"DIV"`.
518
+ * The qualified name of the element. An element of the HTML namespace reads in ASCII upper case,
519
+ * such as `"BUTTON"`, and the mount container reads `"DIV"`.
357
520
  */
358
521
  readonly tagName: string;
522
+ /** The name of the element without its prefix. */
523
+ readonly localName: string;
524
+ /** The namespace of the element, or `null` for none. */
525
+ readonly namespaceURI: string | null;
526
+ /** The prefix of the element name, or `null` for none. */
527
+ readonly prefix: string | null;
359
528
  /** The current parent element or fragment, or `null` if this node isn't attached to the tree. */
360
529
  parent: IncaParent | null;
361
530
  /**
@@ -451,6 +620,20 @@ interface IncaElement extends IncaEventTarget, EventHandlers, NodeMembers, TextC
451
620
  * changes. A key that equals the name of a set attribute reads its `Attr`.
452
621
  */
453
622
  readonly attributes: NamedNodeMap;
623
+ /**
624
+ * The inline style as a live block. Every read returns the same object. Assigning a string
625
+ * writes its `cssText`, and `null` assigns `""`.
626
+ */
627
+ get style(): CSSStyleDeclaration;
628
+ set style(cssText: string | null);
629
+ /**
630
+ * The `data-*` attributes as a live object. Every read returns the same object. A write converts
631
+ * the value to text.
632
+ * @throws DOMException named `SyntaxError` for a write to a key with a dash before a lower case
633
+ * letter, and named `InvalidCharacterError` for a key that makes an invalid attribute name
634
+ * @throws TypeError for a write of a `Symbol` value
635
+ */
636
+ readonly dataset: DOMStringMap;
454
637
  /**
455
638
  * Whether this element matches the selector list. `:focus-visible` and the other interactive and
456
639
  * form-state pseudo-classes never match.
@@ -572,9 +755,9 @@ interface IncaFragment extends NodeMembers, TextContentMember {
572
755
  parent: null;
573
756
  }
574
757
  /** A node that can have children. */
575
- type IncaParent = IncaElement | IncaFragment;
576
- /** Any node the shadow tree holds: an element, comment, text leaf or fragment. */
577
- type IncaNode = IncaElement | IncaText | IncaFragment;
758
+ type IncaParent = IncaElement | IncaFragment | IncaDocument;
759
+ /** Any node the shadow tree holds: an element, comment, text leaf, fragment or the document. */
760
+ type IncaNode = IncaElement | IncaText | IncaFragment | IncaDocument;
578
761
  /**
579
762
  * Stable handle to a node in the native retained tree, returned by `createNode`
580
763
  * and used in every later call that touches that node.
@@ -752,9 +935,16 @@ interface IncaEventTarget {
752
935
  dispatchEvent(event: EventLike): boolean;
753
936
  }
754
937
  /**
755
- * The event target between the elements and `window`.
938
+ * The top node of the tree, the parent of the mount container. It holds at most one element and
939
+ * any number of comments, and no text.
756
940
  */
757
- interface IncaDocument extends IncaEventTarget, EventHandlers<IncaDocument> {
941
+ interface IncaDocument extends IncaEventTarget, EventHandlers<IncaDocument>, Omit<NodeMembers, "cloneNode"> {
942
+ /** Discriminates this node within the {@link IncaNode} union. */
943
+ readonly kind: "document";
944
+ /** The document has no parent. */
945
+ parent: null;
946
+ /** Always `null`. An assignment does nothing. */
947
+ textContent: string | null;
758
948
  /**
759
949
  * The element that has focus, or `null` when no element has focus. A `focus()` or `blur()` call
760
950
  * takes effect for this property at once.
@@ -765,6 +955,57 @@ interface IncaDocument extends IncaEventTarget, EventHandlers<IncaDocument> {
765
955
  * @returns the new fragment
766
956
  */
767
957
  createDocumentFragment(): IncaFragment;
958
+ /**
959
+ * Creates an element. The name converts to a string, and its ASCII upper case becomes lower
960
+ * case. The second argument of the web API is ignored.
961
+ * @param localName - The element name, such as `"div"`.
962
+ * @returns The new element, which has no parent.
963
+ * @throws TypeError when called without an argument
964
+ * @throws DOMException named `InvalidCharacterError` when `localName` is not a valid element name
965
+ */
966
+ createElement(localName: string): IncaElement;
967
+ /**
968
+ * Creates an element with a namespace. The namespace converts to a string, and `null`,
969
+ * `undefined` and `""` mean no namespace. The name converts to a string and splits at its first
970
+ * colon into a prefix and a local name. The element keeps the case of the name.
971
+ * @param namespace - The namespace, such as `"http://www.w3.org/2000/svg"`.
972
+ * @param qualifiedName - The element name, such as `"svg"` or `"x:item"`.
973
+ * @returns The new element, which has no parent.
974
+ * @throws TypeError when called with fewer than two arguments
975
+ * @throws DOMException named `InvalidCharacterError` when the prefix or the local name is not a
976
+ * valid element name
977
+ * @throws DOMException named `NamespaceError` when the prefix and the namespace do not fit
978
+ */
979
+ createElementNS(namespace: string | null, qualifiedName: string): IncaElement;
980
+ /**
981
+ * Creates a text node.
982
+ * @param data - The text. It converts to a string.
983
+ * @returns The new text node, which has no parent.
984
+ * @throws TypeError when called without an argument
985
+ */
986
+ createTextNode(data: string): IncaText;
987
+ /**
988
+ * Creates a comment.
989
+ * @param data - The text. It converts to a string.
990
+ * @returns The new comment, which has no parent.
991
+ * @throws TypeError when called without an argument
992
+ */
993
+ createComment(data: string): IncaElement;
994
+ /**
995
+ * The first element below the document that matches the selector list, or `null`.
996
+ * @throws DOMException named `SyntaxError` for an invalid selector
997
+ * @param selectors - A selector list.
998
+ * @returns The first matching element in document order, or `null`.
999
+ */
1000
+ querySelector(selectors: string): IncaElement | null;
1001
+ /**
1002
+ * The elements below the document that match the selector list, in document order, as a list
1003
+ * that later changes do not reach. Every call returns a new list.
1004
+ * @throws DOMException named `SyntaxError` for an invalid selector
1005
+ * @param selectors - A selector list.
1006
+ * @returns The matching elements.
1007
+ */
1008
+ querySelectorAll(selectors: string): NodeListOf<IncaElement>;
768
1009
  }
769
1010
  /**
770
1011
  * The event target at the top of every event path.
@@ -793,8 +1034,9 @@ interface IncaEvent {
793
1034
  * The element the event is about. It is the deepest element under the pointer for pointer
794
1035
  * events (the capturing element while the pointer is captured), the nearest common ancestor of
795
1036
  * the press and the release for `click`, `dblclick` and `auxclick`, and the focused element for
796
- * key events. With no such element it is the mount container's element. A script dispatch at
797
- * `document` or `window` gives that object.
1037
+ * key events. With no such element it is the mount container's element, or `document` while
1038
+ * the mount container is out of the document. A script dispatch at `document` or `window`
1039
+ * gives that object.
798
1040
  */
799
1041
  readonly target: IncaEventTarget;
800
1042
  /** The same object as {@link IncaEvent.target}. */
@@ -1089,4 +1331,4 @@ type EventListenerOrObject<E = IncaEvent, T = IncaEventTarget> = EventListener<E
1089
1331
  * `dispatchEvent`, and the event handler properties such as `onkeydown`.
1090
1332
  */
1091
1333
  declare const window: IncaWindow;
1092
- export { EventHandler as A, IncaText as B, Overflow as C, TagName as D, StyleProps as E, IncaFragment as F, TextMembers as G, NodeListOf as H, IncaInputElement as I, RectLike as J, ScrollIntoViewOptions as K, IncaNode as L, HTMLCollectionOf as M, HtmlMembers as N, Attr as O, IncaElement as P, IncaParent as R, NodeId as S, ScrollAlignment as T, NodeMembers as U, NamedNodeMap as V, TextContentMember as W, RectValues as Y, IncaPointerEvent as _, EventListener as a, IncaWindow as b, IncaCompositionEvent as c, IncaEventMap as d, IncaEventTarget as f, IncaMouseEvent as g, IncaKeyboardEvent as h, EventLike as i, EventHandlers as j, CharacterDataMembers as k, IncaDocument as l, IncaInputEvent as m, AttributeValue as n, EventListenerObject as o, IncaFocusEvent as p, ScrollOptions as q, CallbackId as r, EventListenerOrObject as s, window as t, IncaEvent as u, IncaUIEvent as v, Px as w, ListenerOptions as x, IncaWheelEvent as y, IncaTemplateElement as z };
1334
+ export { CharacterDataMembers as A, IncaNode as B, Overflow as C, TagName as D, StyleProps as E, HTMLCollectionOf as F, NodeListOf as G, IncaTemplateElement as H, HtmlMembers as I, TextMembers as J, NodeMembers as K, IncaElement as L, DOMTokenList as M, EventHandler as N, Attr as O, EventHandlers as P, RectValues as Q, IncaFragment as R, NodeId as S, ScrollAlignment as T, IncaText as U, IncaParent as V, NamedNodeMap as W, ScrollOptions as X, ScrollIntoViewOptions as Y, RectLike as Z, IncaPointerEvent as _, EventListener as a, IncaWindow as b, IncaCompositionEvent as c, IncaEventMap as d, IncaEventTarget as f, IncaMouseEvent as g, IncaKeyboardEvent as h, EventLike as i, DOMStringMap as j, CSSStyleDeclaration as k, IncaDocument as l, IncaInputEvent as m, AttributeValue as n, EventListenerObject as o, IncaFocusEvent as p, TextContentMember as q, CallbackId as r, EventListenerOrObject as s, window as t, IncaEvent as u, IncaUIEvent as v, Px as w, ListenerOptions as x, IncaWheelEvent as y, IncaInputElement as z };
@@ -0,0 +1,265 @@
1
+ // Copyright (c) 2026 tom96da
2
+ // SPDX-License-Identifier: MIT OR Apache-2.0
3
+
4
+ // The host defines these globals before the app runs. This file carries their types.
5
+ declare global {
6
+ /** The document of the app. The build adds its import to every module that names it. */
7
+ var document: import("incajs").IncaDocument;
8
+
9
+ /** The interface object of `document`. */
10
+ var Document: { readonly prototype: object };
11
+
12
+ /** The interface object of `element.dataset`, which scripts cannot construct. */
13
+ var DOMStringMap: { readonly prototype: import("incajs").DOMStringMap };
14
+
15
+ /** The interface object of shadow roots, which the host never creates. */
16
+ var ShadowRoot: { readonly prototype: object };
17
+
18
+ /** The interface object of token lists. It cannot be called or constructed. */
19
+ var DOMTokenList: { readonly prototype: import("incajs").DOMTokenList };
20
+
21
+ /** The interface object of the `style` of an element, which a script cannot construct. */
22
+ var CSSStyleDeclaration: { readonly prototype: import("incajs").CSSStyleDeclaration };
23
+
24
+ function setTimeout<A extends unknown[]>(
25
+ handler: (...args: A) => void,
26
+ delay?: number,
27
+ ...args: A
28
+ ): number;
29
+ function setInterval<A extends unknown[]>(
30
+ handler: (...args: A) => void,
31
+ delay?: number,
32
+ ...args: A
33
+ ): number;
34
+ function clearTimeout(id?: number): void;
35
+ function clearInterval(id?: number): void;
36
+
37
+ type FrameRequestCallback = (time: number) => void;
38
+ function requestAnimationFrame(callback: FrameRequestCallback): number;
39
+ function cancelAnimationFrame(handle: number): void;
40
+
41
+ interface PerformanceEntry {
42
+ readonly name: string;
43
+ readonly entryType: string;
44
+ readonly startTime: number;
45
+ readonly duration: number;
46
+ toJSON(): any;
47
+ }
48
+ var PerformanceEntry: { prototype: PerformanceEntry; new (): PerformanceEntry };
49
+ type PerformanceEntryList = PerformanceEntry[];
50
+
51
+ interface PerformanceMarkOptions {
52
+ detail?: any;
53
+ startTime?: number;
54
+ }
55
+ interface PerformanceMark extends PerformanceEntry {
56
+ readonly detail: any;
57
+ }
58
+ var PerformanceMark: {
59
+ prototype: PerformanceMark;
60
+ new (markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
61
+ };
62
+
63
+ interface PerformanceMeasureOptions {
64
+ detail?: any;
65
+ start?: string | number;
66
+ duration?: number;
67
+ end?: string | number;
68
+ }
69
+ interface PerformanceMeasure extends PerformanceEntry {
70
+ readonly detail: any;
71
+ }
72
+ var PerformanceMeasure: { prototype: PerformanceMeasure; new (): PerformanceMeasure };
73
+
74
+ interface Performance {
75
+ readonly timeOrigin: number;
76
+ now(): number;
77
+ toJSON(): any;
78
+ mark(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
79
+ measure(
80
+ measureName: string,
81
+ startOrMeasureOptions?: string | PerformanceMeasureOptions,
82
+ endMark?: string,
83
+ ): PerformanceMeasure;
84
+ getEntries(): PerformanceEntryList;
85
+ getEntriesByName(name: string, type?: string): PerformanceEntryList;
86
+ getEntriesByType(type: string): PerformanceEntryList;
87
+ clearMarks(markName?: string): void;
88
+ clearMeasures(measureName?: string): void;
89
+ }
90
+ var Performance: { prototype: Performance; new (): Performance };
91
+ var performance: Performance;
92
+
93
+ interface Console {
94
+ assert(condition?: boolean, ...data: unknown[]): void;
95
+ clear(): void;
96
+ count(label?: string): void;
97
+ countReset(label?: string): void;
98
+ debug(...data: unknown[]): void;
99
+ dir(item?: unknown, options?: unknown): void;
100
+ dirxml(...data: unknown[]): void;
101
+ error(...data: unknown[]): void;
102
+ group(...data: unknown[]): void;
103
+ groupCollapsed(...data: unknown[]): void;
104
+ groupEnd(): void;
105
+ info(...data: unknown[]): void;
106
+ log(...data: unknown[]): void;
107
+ table(tabularData?: unknown, properties?: string[]): void;
108
+ time(label?: string): void;
109
+ timeEnd(label?: string): void;
110
+ timeLog(label?: string, ...data: unknown[]): void;
111
+ trace(...data: unknown[]): void;
112
+ warn(...data: unknown[]): void;
113
+ }
114
+ var console: Console;
115
+
116
+ interface TextEncoderEncodeIntoResult {
117
+ read: number;
118
+ written: number;
119
+ }
120
+ interface TextEncoder {
121
+ readonly encoding: string;
122
+ encode(input?: string): Uint8Array<ArrayBuffer>;
123
+ encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
124
+ }
125
+ var TextEncoder: {
126
+ new (): TextEncoder;
127
+ prototype: TextEncoder;
128
+ };
129
+
130
+ type AllowSharedBufferSource = ArrayBufferLike | ArrayBufferView;
131
+ interface TextDecoderOptions {
132
+ fatal?: boolean;
133
+ ignoreBOM?: boolean;
134
+ }
135
+ interface TextDecodeOptions {
136
+ stream?: boolean;
137
+ }
138
+ interface TextDecoder {
139
+ readonly encoding: string;
140
+ readonly fatal: boolean;
141
+ readonly ignoreBOM: boolean;
142
+ decode(input?: AllowSharedBufferSource, options?: TextDecodeOptions): string;
143
+ }
144
+ var TextDecoder: {
145
+ new (label?: string, options?: TextDecoderOptions): TextDecoder;
146
+ prototype: TextDecoder;
147
+ };
148
+
149
+ interface URL {
150
+ href: string;
151
+ protocol: string;
152
+ username: string;
153
+ password: string;
154
+ host: string;
155
+ hostname: string;
156
+ port: string;
157
+ pathname: string;
158
+ search: string;
159
+ hash: string;
160
+ readonly origin: string;
161
+ readonly searchParams: URLSearchParams;
162
+ toString(): string;
163
+ toJSON(): string;
164
+ }
165
+ var URL: {
166
+ new (url: string | URL, base?: string | URL): URL;
167
+ prototype: URL;
168
+ canParse(url: string | URL, base?: string | URL): boolean;
169
+ parse(url: string | URL, base?: string | URL): URL | null;
170
+ };
171
+
172
+ interface URLSearchParamsIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
173
+ [Symbol.iterator](): URLSearchParamsIterator<T>;
174
+ }
175
+ interface URLSearchParams {
176
+ readonly size: number;
177
+ append(name: string, value: string): void;
178
+ delete(name: string, value?: string): void;
179
+ get(name: string): string | null;
180
+ getAll(name: string): string[];
181
+ has(name: string, value?: string): boolean;
182
+ set(name: string, value: string): void;
183
+ sort(): void;
184
+ forEach(
185
+ callback: (value: string, key: string, parent: URLSearchParams) => void,
186
+ thisArg?: unknown,
187
+ ): void;
188
+ entries(): URLSearchParamsIterator<[string, string]>;
189
+ keys(): URLSearchParamsIterator<string>;
190
+ values(): URLSearchParamsIterator<string>;
191
+ [Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
192
+ toString(): string;
193
+ }
194
+ var URLSearchParams: {
195
+ new (init?: string | string[][] | Record<string, string> | URLSearchParams): URLSearchParams;
196
+ prototype: URLSearchParams;
197
+ };
198
+ }
199
+
200
+ // The JavaScript engine provides these globals.
201
+ declare global {
202
+ interface DOMException {
203
+ readonly name: string;
204
+ readonly message: string;
205
+ readonly code: number;
206
+ stack?: string;
207
+ toString(): string;
208
+ readonly INDEX_SIZE_ERR: 1;
209
+ readonly DOMSTRING_SIZE_ERR: 2;
210
+ readonly HIERARCHY_REQUEST_ERR: 3;
211
+ readonly WRONG_DOCUMENT_ERR: 4;
212
+ readonly INVALID_CHARACTER_ERR: 5;
213
+ readonly NO_DATA_ALLOWED_ERR: 6;
214
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
215
+ readonly NOT_FOUND_ERR: 8;
216
+ readonly NOT_SUPPORTED_ERR: 9;
217
+ readonly INUSE_ATTRIBUTE_ERR: 10;
218
+ readonly INVALID_STATE_ERR: 11;
219
+ readonly SYNTAX_ERR: 12;
220
+ readonly INVALID_MODIFICATION_ERR: 13;
221
+ readonly NAMESPACE_ERR: 14;
222
+ readonly INVALID_ACCESS_ERR: 15;
223
+ readonly VALIDATION_ERR: 16;
224
+ readonly TYPE_MISMATCH_ERR: 17;
225
+ readonly SECURITY_ERR: 18;
226
+ readonly NETWORK_ERR: 19;
227
+ readonly ABORT_ERR: 20;
228
+ readonly URL_MISMATCH_ERR: 21;
229
+ readonly QUOTA_EXCEEDED_ERR: 22;
230
+ readonly TIMEOUT_ERR: 23;
231
+ readonly INVALID_NODE_TYPE_ERR: 24;
232
+ readonly DATA_CLONE_ERR: 25;
233
+ }
234
+ var DOMException: {
235
+ prototype: DOMException;
236
+ new (message?: string, name?: string): DOMException;
237
+ readonly INDEX_SIZE_ERR: 1;
238
+ readonly DOMSTRING_SIZE_ERR: 2;
239
+ readonly HIERARCHY_REQUEST_ERR: 3;
240
+ readonly WRONG_DOCUMENT_ERR: 4;
241
+ readonly INVALID_CHARACTER_ERR: 5;
242
+ readonly NO_DATA_ALLOWED_ERR: 6;
243
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
244
+ readonly NOT_FOUND_ERR: 8;
245
+ readonly NOT_SUPPORTED_ERR: 9;
246
+ readonly INUSE_ATTRIBUTE_ERR: 10;
247
+ readonly INVALID_STATE_ERR: 11;
248
+ readonly SYNTAX_ERR: 12;
249
+ readonly INVALID_MODIFICATION_ERR: 13;
250
+ readonly NAMESPACE_ERR: 14;
251
+ readonly INVALID_ACCESS_ERR: 15;
252
+ readonly VALIDATION_ERR: 16;
253
+ readonly TYPE_MISMATCH_ERR: 17;
254
+ readonly SECURITY_ERR: 18;
255
+ readonly NETWORK_ERR: 19;
256
+ readonly ABORT_ERR: 20;
257
+ readonly URL_MISMATCH_ERR: 21;
258
+ readonly QUOTA_EXCEEDED_ERR: 22;
259
+ readonly TIMEOUT_ERR: 23;
260
+ readonly INVALID_NODE_TYPE_ERR: 24;
261
+ readonly DATA_CLONE_ERR: 25;
262
+ };
263
+ }
264
+
265
+ export {};