diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index ed0f93dfd..5c8d9e791 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -10035,7 +10035,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 @@ -10140,7 +10140,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 @@ -10153,7 +10153,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. * @@ -10190,7 +10190,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 A DOMImplementation object. * @@ -10221,7 +10221,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 and provides methods for changing that URL and loading another URL. * @@ -10253,7 +10253,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. * @@ -10278,7 +10278,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 scrolls the document. * @@ -10525,7 +10525,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. * @@ -10537,21 +10537,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. * @@ -11159,27 +11159,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 All descendants of the specified element are searched, but not the element itself. * * [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. * @@ -13688,7 +13688,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. * @@ -13700,17 +13700,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: { @@ -13718,12 +13718,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. * @@ -13782,7 +13776,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; @@ -14284,7 +14278,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. * @@ -15522,7 +15516,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. * @@ -16296,7 +16290,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. * @@ -16752,7 +16746,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. * @@ -17255,7 +17249,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 @@ -17275,7 +17269,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 `null` if there is no such element. * @@ -17393,7 +17387,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 @@ -17482,7 +17476,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 1c7b0f4eb..d7e82303e 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 c4b8089df..c60f37977 100644 --- a/baselines/serviceworker.generated.d.ts +++ b/baselines/serviceworker.generated.d.ts @@ -11489,6 +11489,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 b72ab2c8f..35af05efd 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -11178,6 +11178,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 b94da6da0..7ea6e39a2 100644 --- a/baselines/ts5.5/dom.generated.d.ts +++ b/baselines/ts5.5/dom.generated.d.ts @@ -10027,7 +10027,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 @@ -10132,7 +10132,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 @@ -10145,7 +10145,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. * @@ -10182,7 +10182,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 A DOMImplementation object. * @@ -10213,7 +10213,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 and provides methods for changing that URL and loading another URL. * @@ -10245,7 +10245,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. * @@ -10270,7 +10270,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 scrolls the document. * @@ -10517,7 +10517,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. * @@ -10529,21 +10529,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. * @@ -11149,27 +11149,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 All descendants of the specified element are searched, but not the element itself. * * [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. * @@ -13675,7 +13675,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. * @@ -13687,17 +13687,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: { @@ -13705,12 +13705,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. * @@ -13769,7 +13763,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; @@ -14271,7 +14265,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. * @@ -15504,7 +15498,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. * @@ -16278,7 +16272,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. * @@ -16732,7 +16726,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. * @@ -17234,7 +17228,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 @@ -17254,7 +17248,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 `null` if there is no such element. * @@ -17372,7 +17366,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 @@ -17461,7 +17455,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 3bf93bb9a..ddab3c71f 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 42749c941..1a68b35a1 100644 --- a/baselines/ts5.5/serviceworker.generated.d.ts +++ b/baselines/ts5.5/serviceworker.generated.d.ts @@ -11489,6 +11489,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 e1dd7e2be..827716a1a 100644 --- a/baselines/ts5.5/sharedworker.generated.d.ts +++ b/baselines/ts5.5/sharedworker.generated.d.ts @@ -11178,6 +11178,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 be3f9748b..6ab5bf35d 100644 --- a/baselines/ts5.5/webworker.generated.d.ts +++ b/baselines/ts5.5/webworker.generated.d.ts @@ -13146,6 +13146,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 14a864267..053c4e930 100644 --- a/baselines/ts5.6/dom.generated.d.ts +++ b/baselines/ts5.6/dom.generated.d.ts @@ -10035,7 +10035,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 @@ -10140,7 +10140,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 @@ -10153,7 +10153,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. * @@ -10190,7 +10190,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 A DOMImplementation object. * @@ -10221,7 +10221,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 and provides methods for changing that URL and loading another URL. * @@ -10253,7 +10253,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. * @@ -10278,7 +10278,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 scrolls the document. * @@ -10525,7 +10525,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. * @@ -10537,21 +10537,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. * @@ -11159,27 +11159,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 All descendants of the specified element are searched, but not the element itself. * * [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. * @@ -13688,7 +13688,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. * @@ -13700,17 +13700,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: { @@ -13718,12 +13718,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. * @@ -13782,7 +13776,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; @@ -14284,7 +14278,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. * @@ -15522,7 +15516,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. * @@ -16296,7 +16290,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. * @@ -16752,7 +16746,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. * @@ -17255,7 +17249,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 @@ -17275,7 +17269,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 `null` if there is no such element. * @@ -17393,7 +17387,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 @@ -17482,7 +17476,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 f26da3b31..688a76f01 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 42749c941..1a68b35a1 100644 --- a/baselines/ts5.6/serviceworker.generated.d.ts +++ b/baselines/ts5.6/serviceworker.generated.d.ts @@ -11489,6 +11489,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 e1dd7e2be..827716a1a 100644 --- a/baselines/ts5.6/sharedworker.generated.d.ts +++ b/baselines/ts5.6/sharedworker.generated.d.ts @@ -11178,6 +11178,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 be3f9748b..6ab5bf35d 100644 --- a/baselines/ts5.6/webworker.generated.d.ts +++ b/baselines/ts5.6/webworker.generated.d.ts @@ -13146,6 +13146,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 b8a2a5c53..14d582beb 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -13146,6 +13146,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 fbc48d8dd..d7d4ae852 100644 --- a/inputfiles/addedTypes.jsonc +++ b/inputfiles/addedTypes.jsonc @@ -695,45 +695,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": { @@ -742,7 +703,7 @@ "name": "getElementsByClassName", "signature": { "0": { - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } }, @@ -1618,6 +1579,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 8a5a30d30..11f025e6e 100644 --- a/inputfiles/overridingTypes.jsonc +++ b/inputfiles/overridingTypes.jsonc @@ -824,13 +824,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" } } }, @@ -838,7 +838,7 @@ "name": "getElementsByClassName", "signature": { "0": { - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } }, @@ -874,31 +874,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 @@ -1506,7 +1506,7 @@ }, "selectedOptions": { "name": "selectedOptions", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "labels": { "name": "labels", @@ -1523,7 +1523,7 @@ "property": { "options": { "name": "options", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } } @@ -1570,11 +1570,11 @@ "property": { "rows": { "name": "rows", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" }, "tBodies": { "name": "tBodies", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } } @@ -1584,7 +1584,7 @@ "property": { "rows": { "name": "rows", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } } @@ -1595,13 +1595,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" } } } @@ -1717,7 +1717,7 @@ ] }, "HTMLOptionsCollection": { - "extends": "HTMLCollectionOf" + "extends": "HTMLCollection" }, "SubtleCrypto": { "methods": { @@ -2137,7 +2137,7 @@ "property": { "cells": { "name": "cells", - "overrideType": "HTMLCollectionOf" + "overrideType": "HTMLCollection" } } } @@ -2567,6 +2567,16 @@ } } }, + "HTMLMapElement": { + "properties": { + "property": { + "areas": { + "name": "areas", + "overrideType": "HTMLCollection" + } + } + } + }, "HTMLMarqueeElement": { "element": [ { @@ -3550,6 +3560,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 14189ed17..f19c8cc4f 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;`, ); } }