diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 112a707d5..9d68f28ac 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -10078,7 +10078,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/anchors) */ - readonly anchors: HTMLCollectionOf; + readonly anchors: HTMLCollection; /** * The **`applets`** property of the Document returns an empty HTMLCollection. * @deprecated @@ -10183,7 +10183,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/embeds) */ - readonly embeds: HTMLCollectionOf; + readonly embeds: HTMLCollection; /** * **`fgColor`** gets/sets the foreground color, or text color, of the current document. * @deprecated @@ -10196,7 +10196,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/forms) */ - readonly forms: HTMLCollectionOf; + readonly forms: HTMLCollection; /** * The **`fragmentDirective`** read-only property of the Document interface returns the FragmentDirective for the current document. * @@ -10233,7 +10233,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/images) */ - readonly images: HTMLCollectionOf; + readonly images: HTMLCollection; /** * The **`Document.implementation`** property returns a DOMImplementation object associated with the current document. * @@ -10264,7 +10264,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/links) */ - readonly links: HTMLCollectionOf; + readonly links: HTMLCollection; /** * The **`Document.location`** read-only property returns a Location object, which contains information about the URL of the document and provides methods for changing that URL and loading another URL. * @@ -10296,7 +10296,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/plugins) */ - readonly plugins: HTMLCollectionOf; + readonly plugins: HTMLCollection; /** * The **`Document.readyState`** property describes the loading state of the document. * @@ -10321,7 +10321,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scripts) */ - readonly scripts: HTMLCollectionOf; + readonly scripts: HTMLCollection; /** * The **`scrollingElement`** read-only property of the Document interface returns a reference to the Element that scrolls the document. * @@ -10569,7 +10569,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByClassName) */ - getElementsByClassName(classNames: string): HTMLCollectionOf; + getElementsByClassName(classNames: string): HTMLCollection; /** * The **`getElementsByName()`** method of the Document object returns a NodeList Collection of elements with a given `name` attribute in the document. * @@ -10581,21 +10581,21 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagName) */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; /** @deprecated */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: string): HTMLCollection; /** * Returns a list of elements with the given tag name belonging to the given namespace. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagNameNS) */ - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollection; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollection; /** * The **`getSelection()`** method of the Document interface returns the Selection object associated with this document, representing the range of text selected by the user, or the current position of the caret. * @@ -11203,27 +11203,27 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) */ - getElementsByClassName(classNames: string): HTMLCollectionOf; + getElementsByClassName(classNames: string): HTMLCollection; /** * The **`Element.getElementsByTagName()`** method returns a live HTMLCollection of elements with the given tag name. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; /** @deprecated */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: string): HTMLCollection; /** * The **`Element.getElementsByTagNameNS()`** method returns a live HTMLCollection of elements with the given tag name belonging to the given namespace. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) */ - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollection; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollection; /** * The **`getHTML()`** method of the Element interface is used to serialize an element's DOM to an HTML string. * @@ -13757,7 +13757,7 @@ declare var HTMLCanvasElement: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection) */ -interface HTMLCollectionBase { +interface HTMLCollectionBase { /** * The **`HTMLCollection.length`** property returns the number of items in a HTMLCollection. * @@ -13769,17 +13769,17 @@ interface HTMLCollectionBase { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item) */ - item(index: number): Element | null; - [index: number]: Element; + item(index: number): E | null; + [index: number]: E; } -interface HTMLCollection extends HTMLCollectionBase { +interface HTMLCollection extends HTMLCollectionBase { /** * The **`namedItem()`** method of the HTMLCollection interface returns the first Element in the collection whose `id` or `name` attribute match the specified name, or `null` if no element matches. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection/namedItem) */ - namedItem(name: string): Element | null; + namedItem(name: string): E | N | null; } declare var HTMLCollection: { @@ -13787,12 +13787,6 @@ declare var HTMLCollection: { new(): HTMLCollection; }; -interface HTMLCollectionOf extends HTMLCollectionBase { - item(index: number): T | null; - namedItem(name: string): T | null; - [index: number]: T; -} - /** * The **`HTMLDListElement`** interface provides special properties (beyond those of the regular HTMLElement interface it also has available to it by inheritance) for manipulating definition list (dl) elements. * @@ -13851,7 +13845,7 @@ interface HTMLDataListElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDataListElement/options) */ - readonly options: HTMLCollectionOf; + readonly options: HTMLCollection; addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -14353,7 +14347,7 @@ declare var HTMLFontElement: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormControlsCollection) */ -interface HTMLFormControlsCollection extends HTMLCollectionBase { +interface HTMLFormControlsCollection extends HTMLCollection { /** * The **`HTMLFormControlsCollection.namedItem()`** method returns the RadioNodeList or the Element in the collection whose `name` or `id` match the specified name, or `null` if no node matches. * @@ -15591,7 +15585,7 @@ interface HTMLMapElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMapElement/areas) */ - readonly areas: HTMLCollection; + readonly areas: HTMLCollection; /** * The **`name`** property of the HTMLMapElement represents the unique name `` element. * @@ -16365,7 +16359,7 @@ declare var HTMLOptionElement: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLOptionsCollection) */ -interface HTMLOptionsCollection extends HTMLCollectionOf { +interface HTMLOptionsCollection extends HTMLCollection { /** * The **`length`** property of the HTMLOptionsCollection interface returns the number of option elements in the collection. * @@ -16821,7 +16815,7 @@ interface HTMLSelectElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/selectedOptions) */ - readonly selectedOptions: HTMLCollectionOf; + readonly selectedOptions: HTMLCollection; /** * The **`size`** property of the HTMLSelectElement interface specifies the number of options, or rows, that should be visible at one time. * @@ -17324,7 +17318,7 @@ interface HTMLTableElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/rows) */ - readonly rows: HTMLCollectionOf; + readonly rows: HTMLCollection; /** * The **`HTMLTableElement.rules`** property indicates which cell borders to render in the table. * @deprecated @@ -17344,7 +17338,7 @@ interface HTMLTableElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/tBodies) */ - readonly tBodies: HTMLCollectionOf; + readonly tBodies: HTMLCollection; /** * The **`HTMLTableElement.tFoot`** property represents the tfoot element of a table. * @@ -17462,7 +17456,7 @@ interface HTMLTableRowElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableRowElement/cells) */ - readonly cells: HTMLCollectionOf; + readonly cells: HTMLCollection; /** * The **`ch`** property of the HTMLTableRowElement interface does nothing. * @deprecated @@ -17551,7 +17545,7 @@ interface HTMLTableSectionElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableSectionElement/rows) */ - readonly rows: HTMLCollectionOf; + readonly rows: HTMLCollection; /** * The **`vAlign`** property of the HTMLTableSectionElement interface is a string indicating how to vertically align text in a thead, tbody or tfoot table section. * @deprecated diff --git a/baselines/dom.iterable.generated.d.ts b/baselines/dom.iterable.generated.d.ts index 369e15232..30696b935 100644 --- a/baselines/dom.iterable.generated.d.ts +++ b/baselines/dom.iterable.generated.d.ts @@ -146,14 +146,10 @@ interface HTMLAllCollection { [Symbol.iterator](): ArrayIterator; } -interface HTMLCollectionBase { +interface HTMLCollectionBase { [Symbol.iterator](): ArrayIterator; } -interface HTMLCollectionOf { - [Symbol.iterator](): ArrayIterator; -} - interface HTMLFormElement { [Symbol.iterator](): ArrayIterator; } diff --git a/baselines/serviceworker.generated.d.ts b/baselines/serviceworker.generated.d.ts index 02b5f0403..8aaa26f62 100644 --- a/baselines/serviceworker.generated.d.ts +++ b/baselines/serviceworker.generated.d.ts @@ -11642,6 +11642,8 @@ type GLsizei = number; type GLsizeiptr = number; type GLuint = number; type GLuint64 = number; +/** @deprecated */ +type HTMLCollectionOf = HTMLCollection; type HashAlgorithmIdentifier = AlgorithmIdentifier; type HeadersInit = [string, string][] | Record | Headers; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; diff --git a/baselines/sharedworker.generated.d.ts b/baselines/sharedworker.generated.d.ts index 5bb63c4f4..3158ffff0 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -11331,6 +11331,8 @@ type GLsizei = number; type GLsizeiptr = number; type GLuint = number; type GLuint64 = number; +/** @deprecated */ +type HTMLCollectionOf = HTMLCollection; type HashAlgorithmIdentifier = AlgorithmIdentifier; type HeadersInit = [string, string][] | Record | Headers; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; diff --git a/baselines/ts5.5/dom.generated.d.ts b/baselines/ts5.5/dom.generated.d.ts index 566f7f4bd..80045abfb 100644 --- a/baselines/ts5.5/dom.generated.d.ts +++ b/baselines/ts5.5/dom.generated.d.ts @@ -10070,7 +10070,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/anchors) */ - readonly anchors: HTMLCollectionOf; + readonly anchors: HTMLCollection; /** * The **`applets`** property of the Document returns an empty HTMLCollection. * @deprecated @@ -10175,7 +10175,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/embeds) */ - readonly embeds: HTMLCollectionOf; + readonly embeds: HTMLCollection; /** * **`fgColor`** gets/sets the foreground color, or text color, of the current document. * @deprecated @@ -10188,7 +10188,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/forms) */ - readonly forms: HTMLCollectionOf; + readonly forms: HTMLCollection; /** * The **`fragmentDirective`** read-only property of the Document interface returns the FragmentDirective for the current document. * @@ -10225,7 +10225,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/images) */ - readonly images: HTMLCollectionOf; + readonly images: HTMLCollection; /** * The **`Document.implementation`** property returns a DOMImplementation object associated with the current document. * @@ -10256,7 +10256,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/links) */ - readonly links: HTMLCollectionOf; + readonly links: HTMLCollection; /** * The **`Document.location`** read-only property returns a Location object, which contains information about the URL of the document and provides methods for changing that URL and loading another URL. * @@ -10288,7 +10288,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/plugins) */ - readonly plugins: HTMLCollectionOf; + readonly plugins: HTMLCollection; /** * The **`Document.readyState`** property describes the loading state of the document. * @@ -10313,7 +10313,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scripts) */ - readonly scripts: HTMLCollectionOf; + readonly scripts: HTMLCollection; /** * The **`scrollingElement`** read-only property of the Document interface returns a reference to the Element that scrolls the document. * @@ -10561,7 +10561,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByClassName) */ - getElementsByClassName(classNames: string): HTMLCollectionOf; + getElementsByClassName(classNames: string): HTMLCollection; /** * The **`getElementsByName()`** method of the Document object returns a NodeList Collection of elements with a given `name` attribute in the document. * @@ -10573,21 +10573,21 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagName) */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; /** @deprecated */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: string): HTMLCollection; /** * Returns a list of elements with the given tag name belonging to the given namespace. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagNameNS) */ - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollection; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollection; /** * The **`getSelection()`** method of the Document interface returns the Selection object associated with this document, representing the range of text selected by the user, or the current position of the caret. * @@ -11193,27 +11193,27 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) */ - getElementsByClassName(classNames: string): HTMLCollectionOf; + getElementsByClassName(classNames: string): HTMLCollection; /** * The **`Element.getElementsByTagName()`** method returns a live HTMLCollection of elements with the given tag name. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; /** @deprecated */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: string): HTMLCollection; /** * The **`Element.getElementsByTagNameNS()`** method returns a live HTMLCollection of elements with the given tag name belonging to the given namespace. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) */ - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollection; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollection; /** * The **`getHTML()`** method of the Element interface is used to serialize an element's DOM to an HTML string. * @@ -13744,7 +13744,7 @@ declare var HTMLCanvasElement: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection) */ -interface HTMLCollectionBase { +interface HTMLCollectionBase { /** * The **`HTMLCollection.length`** property returns the number of items in a HTMLCollection. * @@ -13756,17 +13756,17 @@ interface HTMLCollectionBase { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item) */ - item(index: number): Element | null; - [index: number]: Element; + item(index: number): E | null; + [index: number]: E; } -interface HTMLCollection extends HTMLCollectionBase { +interface HTMLCollection extends HTMLCollectionBase { /** * The **`namedItem()`** method of the HTMLCollection interface returns the first Element in the collection whose `id` or `name` attribute match the specified name, or `null` if no element matches. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection/namedItem) */ - namedItem(name: string): Element | null; + namedItem(name: string): E | N | null; } declare var HTMLCollection: { @@ -13774,12 +13774,6 @@ declare var HTMLCollection: { new(): HTMLCollection; }; -interface HTMLCollectionOf extends HTMLCollectionBase { - item(index: number): T | null; - namedItem(name: string): T | null; - [index: number]: T; -} - /** * The **`HTMLDListElement`** interface provides special properties (beyond those of the regular HTMLElement interface it also has available to it by inheritance) for manipulating definition list (dl) elements. * @@ -13838,7 +13832,7 @@ interface HTMLDataListElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDataListElement/options) */ - readonly options: HTMLCollectionOf; + readonly options: HTMLCollection; addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -14340,7 +14334,7 @@ declare var HTMLFontElement: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormControlsCollection) */ -interface HTMLFormControlsCollection extends HTMLCollectionBase { +interface HTMLFormControlsCollection extends HTMLCollection { /** * The **`HTMLFormControlsCollection.namedItem()`** method returns the RadioNodeList or the Element in the collection whose `name` or `id` match the specified name, or `null` if no node matches. * @@ -15573,7 +15567,7 @@ interface HTMLMapElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMapElement/areas) */ - readonly areas: HTMLCollection; + readonly areas: HTMLCollection; /** * The **`name`** property of the HTMLMapElement represents the unique name `` element. * @@ -16347,7 +16341,7 @@ declare var HTMLOptionElement: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLOptionsCollection) */ -interface HTMLOptionsCollection extends HTMLCollectionOf { +interface HTMLOptionsCollection extends HTMLCollection { /** * The **`length`** property of the HTMLOptionsCollection interface returns the number of option elements in the collection. * @@ -16801,7 +16795,7 @@ interface HTMLSelectElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/selectedOptions) */ - readonly selectedOptions: HTMLCollectionOf; + readonly selectedOptions: HTMLCollection; /** * The **`size`** property of the HTMLSelectElement interface specifies the number of options, or rows, that should be visible at one time. * @@ -17303,7 +17297,7 @@ interface HTMLTableElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/rows) */ - readonly rows: HTMLCollectionOf; + readonly rows: HTMLCollection; /** * The **`HTMLTableElement.rules`** property indicates which cell borders to render in the table. * @deprecated @@ -17323,7 +17317,7 @@ interface HTMLTableElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/tBodies) */ - readonly tBodies: HTMLCollectionOf; + readonly tBodies: HTMLCollection; /** * The **`HTMLTableElement.tFoot`** property represents the tfoot element of a table. * @@ -17441,7 +17435,7 @@ interface HTMLTableRowElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableRowElement/cells) */ - readonly cells: HTMLCollectionOf; + readonly cells: HTMLCollection; /** * The **`ch`** property of the HTMLTableRowElement interface does nothing. * @deprecated @@ -17530,7 +17524,7 @@ interface HTMLTableSectionElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableSectionElement/rows) */ - readonly rows: HTMLCollectionOf; + readonly rows: HTMLCollection; /** * The **`vAlign`** property of the HTMLTableSectionElement interface is a string indicating how to vertically align text in a thead, tbody or tfoot table section. * @deprecated diff --git a/baselines/ts5.5/dom.iterable.generated.d.ts b/baselines/ts5.5/dom.iterable.generated.d.ts index 6b1ec511c..38cee3bb7 100644 --- a/baselines/ts5.5/dom.iterable.generated.d.ts +++ b/baselines/ts5.5/dom.iterable.generated.d.ts @@ -142,14 +142,10 @@ interface HTMLAllCollection { [Symbol.iterator](): IterableIterator; } -interface HTMLCollectionBase { +interface HTMLCollectionBase { [Symbol.iterator](): IterableIterator; } -interface HTMLCollectionOf { - [Symbol.iterator](): IterableIterator; -} - interface HTMLFormElement { [Symbol.iterator](): IterableIterator; } diff --git a/baselines/ts5.5/serviceworker.generated.d.ts b/baselines/ts5.5/serviceworker.generated.d.ts index 295e1756e..410320645 100644 --- a/baselines/ts5.5/serviceworker.generated.d.ts +++ b/baselines/ts5.5/serviceworker.generated.d.ts @@ -11642,6 +11642,8 @@ type GLsizei = number; type GLsizeiptr = number; type GLuint = number; type GLuint64 = number; +/** @deprecated */ +type HTMLCollectionOf = HTMLCollection; type HashAlgorithmIdentifier = AlgorithmIdentifier; type HeadersInit = [string, string][] | Record | Headers; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; diff --git a/baselines/ts5.5/sharedworker.generated.d.ts b/baselines/ts5.5/sharedworker.generated.d.ts index 4fb5c5f83..30f5c6388 100644 --- a/baselines/ts5.5/sharedworker.generated.d.ts +++ b/baselines/ts5.5/sharedworker.generated.d.ts @@ -11331,6 +11331,8 @@ type GLsizei = number; type GLsizeiptr = number; type GLuint = number; type GLuint64 = number; +/** @deprecated */ +type HTMLCollectionOf = HTMLCollection; type HashAlgorithmIdentifier = AlgorithmIdentifier; type HeadersInit = [string, string][] | Record | Headers; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; diff --git a/baselines/ts5.5/webworker.generated.d.ts b/baselines/ts5.5/webworker.generated.d.ts index 63867da88..e0c0fd994 100644 --- a/baselines/ts5.5/webworker.generated.d.ts +++ b/baselines/ts5.5/webworker.generated.d.ts @@ -13299,6 +13299,8 @@ type GLsizei = number; type GLsizeiptr = number; type GLuint = number; type GLuint64 = number; +/** @deprecated */ +type HTMLCollectionOf = HTMLCollection; type HashAlgorithmIdentifier = AlgorithmIdentifier; type HeadersInit = [string, string][] | Record | Headers; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; diff --git a/baselines/ts5.6/dom.generated.d.ts b/baselines/ts5.6/dom.generated.d.ts index 9997a7f0b..ae9bc21f4 100644 --- a/baselines/ts5.6/dom.generated.d.ts +++ b/baselines/ts5.6/dom.generated.d.ts @@ -10078,7 +10078,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/anchors) */ - readonly anchors: HTMLCollectionOf; + readonly anchors: HTMLCollection; /** * The **`applets`** property of the Document returns an empty HTMLCollection. * @deprecated @@ -10183,7 +10183,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/embeds) */ - readonly embeds: HTMLCollectionOf; + readonly embeds: HTMLCollection; /** * **`fgColor`** gets/sets the foreground color, or text color, of the current document. * @deprecated @@ -10196,7 +10196,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/forms) */ - readonly forms: HTMLCollectionOf; + readonly forms: HTMLCollection; /** * The **`fragmentDirective`** read-only property of the Document interface returns the FragmentDirective for the current document. * @@ -10233,7 +10233,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/images) */ - readonly images: HTMLCollectionOf; + readonly images: HTMLCollection; /** * The **`Document.implementation`** property returns a DOMImplementation object associated with the current document. * @@ -10264,7 +10264,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/links) */ - readonly links: HTMLCollectionOf; + readonly links: HTMLCollection; /** * The **`Document.location`** read-only property returns a Location object, which contains information about the URL of the document and provides methods for changing that URL and loading another URL. * @@ -10296,7 +10296,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/plugins) */ - readonly plugins: HTMLCollectionOf; + readonly plugins: HTMLCollection; /** * The **`Document.readyState`** property describes the loading state of the document. * @@ -10321,7 +10321,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scripts) */ - readonly scripts: HTMLCollectionOf; + readonly scripts: HTMLCollection; /** * The **`scrollingElement`** read-only property of the Document interface returns a reference to the Element that scrolls the document. * @@ -10569,7 +10569,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByClassName) */ - getElementsByClassName(classNames: string): HTMLCollectionOf; + getElementsByClassName(classNames: string): HTMLCollection; /** * The **`getElementsByName()`** method of the Document object returns a NodeList Collection of elements with a given `name` attribute in the document. * @@ -10581,21 +10581,21 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagName) */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; /** @deprecated */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: string): HTMLCollection; /** * Returns a list of elements with the given tag name belonging to the given namespace. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagNameNS) */ - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollection; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollection; /** * The **`getSelection()`** method of the Document interface returns the Selection object associated with this document, representing the range of text selected by the user, or the current position of the caret. * @@ -11203,27 +11203,27 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, NonDocumentTyp * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) */ - getElementsByClassName(classNames: string): HTMLCollectionOf; + getElementsByClassName(classNames: string): HTMLCollection; /** * The **`Element.getElementsByTagName()`** method returns a live HTMLCollection of elements with the given tag name. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: K): HTMLCollection; /** @deprecated */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollection; + getElementsByTagName(qualifiedName: string): HTMLCollection; /** * The **`Element.getElementsByTagNameNS()`** method returns a live HTMLCollection of elements with the given tag name belonging to the given namespace. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) */ - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollection; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollection; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollection; /** * The **`getHTML()`** method of the Element interface is used to serialize an element's DOM to an HTML string. * @@ -13757,7 +13757,7 @@ declare var HTMLCanvasElement: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection) */ -interface HTMLCollectionBase { +interface HTMLCollectionBase { /** * The **`HTMLCollection.length`** property returns the number of items in a HTMLCollection. * @@ -13769,17 +13769,17 @@ interface HTMLCollectionBase { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item) */ - item(index: number): Element | null; - [index: number]: Element; + item(index: number): E | null; + [index: number]: E; } -interface HTMLCollection extends HTMLCollectionBase { +interface HTMLCollection extends HTMLCollectionBase { /** * The **`namedItem()`** method of the HTMLCollection interface returns the first Element in the collection whose `id` or `name` attribute match the specified name, or `null` if no element matches. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLCollection/namedItem) */ - namedItem(name: string): Element | null; + namedItem(name: string): E | N | null; } declare var HTMLCollection: { @@ -13787,12 +13787,6 @@ declare var HTMLCollection: { new(): HTMLCollection; }; -interface HTMLCollectionOf extends HTMLCollectionBase { - item(index: number): T | null; - namedItem(name: string): T | null; - [index: number]: T; -} - /** * The **`HTMLDListElement`** interface provides special properties (beyond those of the regular HTMLElement interface it also has available to it by inheritance) for manipulating definition list (dl) elements. * @@ -13851,7 +13845,7 @@ interface HTMLDataListElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDataListElement/options) */ - readonly options: HTMLCollectionOf; + readonly options: HTMLCollection; addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -14353,7 +14347,7 @@ declare var HTMLFontElement: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormControlsCollection) */ -interface HTMLFormControlsCollection extends HTMLCollectionBase { +interface HTMLFormControlsCollection extends HTMLCollection { /** * The **`HTMLFormControlsCollection.namedItem()`** method returns the RadioNodeList or the Element in the collection whose `name` or `id` match the specified name, or `null` if no node matches. * @@ -15591,7 +15585,7 @@ interface HTMLMapElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMapElement/areas) */ - readonly areas: HTMLCollection; + readonly areas: HTMLCollection; /** * The **`name`** property of the HTMLMapElement represents the unique name `` element. * @@ -16365,7 +16359,7 @@ declare var HTMLOptionElement: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLOptionsCollection) */ -interface HTMLOptionsCollection extends HTMLCollectionOf { +interface HTMLOptionsCollection extends HTMLCollection { /** * The **`length`** property of the HTMLOptionsCollection interface returns the number of option elements in the collection. * @@ -16821,7 +16815,7 @@ interface HTMLSelectElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/selectedOptions) */ - readonly selectedOptions: HTMLCollectionOf; + readonly selectedOptions: HTMLCollection; /** * The **`size`** property of the HTMLSelectElement interface specifies the number of options, or rows, that should be visible at one time. * @@ -17324,7 +17318,7 @@ interface HTMLTableElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/rows) */ - readonly rows: HTMLCollectionOf; + readonly rows: HTMLCollection; /** * The **`HTMLTableElement.rules`** property indicates which cell borders to render in the table. * @deprecated @@ -17344,7 +17338,7 @@ interface HTMLTableElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/tBodies) */ - readonly tBodies: HTMLCollectionOf; + readonly tBodies: HTMLCollection; /** * The **`HTMLTableElement.tFoot`** property represents the tfoot element of a table. * @@ -17462,7 +17456,7 @@ interface HTMLTableRowElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableRowElement/cells) */ - readonly cells: HTMLCollectionOf; + readonly cells: HTMLCollection; /** * The **`ch`** property of the HTMLTableRowElement interface does nothing. * @deprecated @@ -17551,7 +17545,7 @@ interface HTMLTableSectionElement extends HTMLElement { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableSectionElement/rows) */ - readonly rows: HTMLCollectionOf; + readonly rows: HTMLCollection; /** * The **`vAlign`** property of the HTMLTableSectionElement interface is a string indicating how to vertically align text in a thead, tbody or tfoot table section. * @deprecated diff --git a/baselines/ts5.6/dom.iterable.generated.d.ts b/baselines/ts5.6/dom.iterable.generated.d.ts index da0b4b4e8..a18f82816 100644 --- a/baselines/ts5.6/dom.iterable.generated.d.ts +++ b/baselines/ts5.6/dom.iterable.generated.d.ts @@ -146,14 +146,10 @@ interface HTMLAllCollection { [Symbol.iterator](): ArrayIterator; } -interface HTMLCollectionBase { +interface HTMLCollectionBase { [Symbol.iterator](): ArrayIterator; } -interface HTMLCollectionOf { - [Symbol.iterator](): ArrayIterator; -} - interface HTMLFormElement { [Symbol.iterator](): ArrayIterator; } diff --git a/baselines/ts5.6/serviceworker.generated.d.ts b/baselines/ts5.6/serviceworker.generated.d.ts index 295e1756e..410320645 100644 --- a/baselines/ts5.6/serviceworker.generated.d.ts +++ b/baselines/ts5.6/serviceworker.generated.d.ts @@ -11642,6 +11642,8 @@ type GLsizei = number; type GLsizeiptr = number; type GLuint = number; type GLuint64 = number; +/** @deprecated */ +type HTMLCollectionOf = HTMLCollection; type HashAlgorithmIdentifier = AlgorithmIdentifier; type HeadersInit = [string, string][] | Record | Headers; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; diff --git a/baselines/ts5.6/sharedworker.generated.d.ts b/baselines/ts5.6/sharedworker.generated.d.ts index 4fb5c5f83..30f5c6388 100644 --- a/baselines/ts5.6/sharedworker.generated.d.ts +++ b/baselines/ts5.6/sharedworker.generated.d.ts @@ -11331,6 +11331,8 @@ type GLsizei = number; type GLsizeiptr = number; type GLuint = number; type GLuint64 = number; +/** @deprecated */ +type HTMLCollectionOf = HTMLCollection; type HashAlgorithmIdentifier = AlgorithmIdentifier; type HeadersInit = [string, string][] | Record | Headers; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; diff --git a/baselines/ts5.6/webworker.generated.d.ts b/baselines/ts5.6/webworker.generated.d.ts index 63867da88..e0c0fd994 100644 --- a/baselines/ts5.6/webworker.generated.d.ts +++ b/baselines/ts5.6/webworker.generated.d.ts @@ -13299,6 +13299,8 @@ type GLsizei = number; type GLsizeiptr = number; type GLuint = number; type GLuint64 = number; +/** @deprecated */ +type HTMLCollectionOf = HTMLCollection; type HashAlgorithmIdentifier = AlgorithmIdentifier; type HeadersInit = [string, string][] | Record | Headers; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 41d032889..56465208c 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -13299,6 +13299,8 @@ type GLsizei = number; type GLsizeiptr = number; type GLuint = number; type GLuint64 = number; +/** @deprecated */ +type HTMLCollectionOf = HTMLCollection; type HashAlgorithmIdentifier = AlgorithmIdentifier; type HeadersInit = [string, string][] | Record | Headers; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; diff --git a/inputfiles/addedTypes.jsonc b/inputfiles/addedTypes.jsonc index b022ae90d..d23f470ce 100644 --- a/inputfiles/addedTypes.jsonc +++ b/inputfiles/addedTypes.jsonc @@ -250,45 +250,6 @@ ] } }, - "HTMLCollectionOf": { - "name": "HTMLCollectionOf", - "typeParameters": [ - { - "name": "T", - "extends": "Element" - } - ], - "exposed": "Window", - "extends": "HTMLCollection", - "methods": { - "method": { - "item": { - "getter": true, - "signature": [ - { - "nullable": true, - "overrideType": "T", - "param": [ - { - "name": "index", - "type": "unsigned long" - } - ] - } - ], - "specs": "html5", - "name": "item" - }, - "namedItem": { - "name": "namedItem", - "overrideSignatures": [ - "namedItem(name: string): T | null" - ] - } - } - }, - "noInterfaceObject": true - }, "Element": { "name": "Element", "methods": { @@ -297,7 +258,7 @@ "name": "getElementsByClassName", "signature": { "0": { - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } }, @@ -1173,6 +1134,17 @@ } ] }, + { + "name": "HTMLCollectionOf", + "deprecated": true, + "typeParameters": [ + { + "name": "T", + "extends": "Element" + } + ], + "overrideType": "HTMLCollection" + }, { "name": "ReadableStreamReadResult", "typeParameters": [ diff --git a/inputfiles/knownTypes.json b/inputfiles/knownTypes.json index d0ba44099..9746c695f 100644 --- a/inputfiles/knownTypes.json +++ b/inputfiles/knownTypes.json @@ -83,6 +83,7 @@ "HkdfParams", "HmacImportParams", "HmacKeyGenParams", + "HTMLCollectionOf", "ImageBitmapRenderingContextSettings", "NamedCurve", "Pbkdf2Params", diff --git a/inputfiles/overridingTypes.jsonc b/inputfiles/overridingTypes.jsonc index 8a7e0851f..d0b252cc8 100644 --- a/inputfiles/overridingTypes.jsonc +++ b/inputfiles/overridingTypes.jsonc @@ -669,13 +669,13 @@ "getElementsByTagNameNS": { "name": "getElementsByTagNameNS", "additionalSignatures": [ - "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf", - "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf", - "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1998/Math/MathML\", localName: string): HTMLCollectionOf" + "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollection", + "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollection", + "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1998/Math/MathML\", localName: string): HTMLCollection" ], "signature": { "0": { - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } }, @@ -683,7 +683,7 @@ "name": "getElementsByClassName", "signature": { "0": { - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } }, @@ -719,31 +719,31 @@ }, "anchors": { "name": "anchors", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "embeds": { "name": "embeds", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "forms": { "name": "forms", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "images": { "name": "images", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "links": { "name": "links", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "plugins": { "name": "plugins", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "scripts": { "name": "scripts", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "location": { // Pre-TS-5.1 hack to make document.location assignable @@ -1351,7 +1351,7 @@ }, "selectedOptions": { "name": "selectedOptions", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "labels": { "name": "labels", @@ -1368,7 +1368,7 @@ "property": { "options": { "name": "options", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } } @@ -1415,11 +1415,11 @@ "property": { "rows": { "name": "rows", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "tBodies": { "name": "tBodies", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } } @@ -1429,7 +1429,7 @@ "property": { "rows": { "name": "rows", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } } @@ -1440,13 +1440,13 @@ "getElementsByTagNameNS": { "name": "getElementsByTagNameNS", "additionalSignatures": [ - "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf", - "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf", - "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1998/Math/MathML\", localName: string): HTMLCollectionOf" + "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollection", + "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollection", + "getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1998/Math/MathML\", localName: string): HTMLCollection" ], "signature": { "0": { - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } } @@ -1562,7 +1562,7 @@ ] }, "HTMLOptionsCollection": { - "extends": "HTMLCollectionOf" + "extends": "HTMLCollection" }, "SubtleCrypto": { "methods": { @@ -1982,7 +1982,7 @@ "property": { "cells": { "name": "cells", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } } @@ -2412,6 +2412,16 @@ } } }, + "HTMLMapElement": { + "properties": { + "property": { + "areas": { + "name": "areas", + "overrideType": "HTMLCollection" + } + } + } + }, "HTMLMarqueeElement": { "element": [ { @@ -3395,6 +3405,39 @@ "ContactAddress": { "name": "PaymentAddress" }, + "HTMLCollection": { + "typeParameters": [ + { + "name": "E", + "extends": "Element", + "default": "Element" + }, + { + "name": "N", + "default": "never" + } + ], + "methods": { + "method": { + "item": { + "overrideSignatures": [ + "item(index: number): E | null" + ] + }, + "namedItem": { + "overrideSignatures": [ + "namedItem(name: string): E | N | null" + ] + } + } + }, + "overrideIndexSignatures": [ + "[index: number]: E" + ] + }, + "HTMLFormControlsCollection": { + "extends": "HTMLCollection" + }, "HTMLMediaElement": { "properties": { "property": { diff --git a/src/build/emitter.ts b/src/build/emitter.ts index cd9f2cffe..a4bab7687 100644 --- a/src/build/emitter.ts +++ b/src/build/emitter.ts @@ -600,15 +600,15 @@ export function emitWebIdl( const paramName = m.signature[0].param![0].name; for (const mapName of tagNameMapNames) { printer.printLine( - `getElementsByTagName(${paramName}: K): HTMLCollectionOf<${mapName}[K]>;`, + `getElementsByTagName(${paramName}: K): HTMLCollection<${mapName}[K]>;`, ); } printer.printLine("/** @deprecated */"); printer.printLine( - `getElementsByTagName(${paramName}: K): HTMLCollectionOf;`, + `getElementsByTagName(${paramName}: K): HTMLCollection;`, ); printer.printLine( - `getElementsByTagName(${paramName}: string): HTMLCollectionOf;`, + `getElementsByTagName(${paramName}: string): HTMLCollection;`, ); } }