@@ -4562,12 +4562,12 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4562
4562
* Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.
4563
4563
*/
4564
4564
/** @deprecated */
4565
- readonly anchors: HTMLCollectionOf <HTMLAnchorElement>;
4565
+ readonly anchors: HTMLCollection <HTMLAnchorElement>;
4566
4566
/**
4567
4567
* Retrieves a collection of all applet objects in the document.
4568
4568
*/
4569
4569
/** @deprecated */
4570
- readonly applets: HTMLCollectionOf <HTMLAppletElement>;
4570
+ readonly applets: HTMLCollection <HTMLAppletElement>;
4571
4571
/**
4572
4572
* Deprecated. Sets or retrieves a value that indicates the background color behind the object.
4573
4573
*/
@@ -4635,7 +4635,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4635
4635
/**
4636
4636
* Retrieves a collection of all embed objects in the document.
4637
4637
*/
4638
- readonly embeds: HTMLCollectionOf <HTMLEmbedElement>;
4638
+ readonly embeds: HTMLCollection <HTMLEmbedElement>;
4639
4639
/**
4640
4640
* Sets or gets the foreground (text) color of the document.
4641
4641
*/
@@ -4644,7 +4644,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4644
4644
/**
4645
4645
* Retrieves a collection, in source order, of all form objects in the document.
4646
4646
*/
4647
- readonly forms: HTMLCollectionOf <HTMLFormElement>;
4647
+ readonly forms: HTMLCollection <HTMLFormElement>;
4648
4648
/** @deprecated */
4649
4649
readonly fullscreen: boolean;
4650
4650
/**
@@ -4659,7 +4659,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4659
4659
/**
4660
4660
* Retrieves a collection, in source order, of img objects in the document.
4661
4661
*/
4662
- readonly images: HTMLCollectionOf <HTMLImageElement>;
4662
+ readonly images: HTMLCollection <HTMLImageElement>;
4663
4663
/**
4664
4664
* Gets the implementation object of the current document.
4665
4665
*/
@@ -4680,7 +4680,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4680
4680
/**
4681
4681
* Retrieves a collection of all a objects that specify the href property and all area objects in the document.
4682
4682
*/
4683
- readonly links: HTMLCollectionOf <HTMLAnchorElement | HTMLAreaElement>;
4683
+ readonly links: HTMLCollection <HTMLAnchorElement | HTMLAreaElement>;
4684
4684
/**
4685
4685
* Contains information about the current URL.
4686
4686
*/
@@ -4702,7 +4702,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4702
4702
/**
4703
4703
* Return an HTMLCollection of the embed elements in the Document.
4704
4704
*/
4705
- readonly plugins: HTMLCollectionOf <HTMLEmbedElement>;
4705
+ readonly plugins: HTMLCollection <HTMLEmbedElement>;
4706
4706
/**
4707
4707
* Retrieves a value that indicates the current state of the object.
4708
4708
*/
@@ -4714,7 +4714,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4714
4714
/**
4715
4715
* Retrieves a collection of all script objects in the document.
4716
4716
*/
4717
- readonly scripts: HTMLCollectionOf <HTMLScriptElement>;
4717
+ readonly scripts: HTMLCollection <HTMLScriptElement>;
4718
4718
readonly scrollingElement: Element | null;
4719
4719
readonly timeline: DocumentTimeline;
4720
4720
/**
@@ -4928,7 +4928,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4928
4928
/**
4929
4929
* Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
4930
4930
*/
4931
- getElementsByClassName(classNames: string): HTMLCollectionOf<Element> ;
4931
+ getElementsByClassName(classNames: string): HTMLCollection ;
4932
4932
/**
4933
4933
* Gets a collection of objects based on the value of the NAME or ID attribute.
4934
4934
* @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.
@@ -4938,9 +4938,9 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4938
4938
* Retrieves a collection of objects based on the specified element name.
4939
4939
* @param name Specifies the name of an element.
4940
4940
*/
4941
- getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf <HTMLElementTagNameMap[K]>;
4942
- getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf <SVGElementTagNameMap[K]>;
4943
- getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element> ;
4941
+ getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollection <HTMLElementTagNameMap[K]>;
4942
+ getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollection <SVGElementTagNameMap[K]>;
4943
+ getElementsByTagName(qualifiedName: string): HTMLCollection ;
4944
4944
/**
4945
4945
* If namespace and localName are "*" returns a HTMLCollection of all descendant elements.
4946
4946
*
@@ -4950,9 +4950,9 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4950
4950
*
4951
4951
* Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName.
4952
4952
*/
4953
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf <HTMLElement>;
4954
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf <SVGElement>;
4955
- getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element> ;
4953
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollection <HTMLElement>;
4954
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollection <SVGElement>;
4955
+ getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollection ;
4956
4956
/**
4957
4957
* Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
4958
4958
*/
@@ -5307,13 +5307,13 @@ interface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTyp
5307
5307
/**
5308
5308
* Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
5309
5309
*/
5310
- getElementsByClassName(classNames: string): HTMLCollectionOf<Element> ;
5311
- getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf <HTMLElementTagNameMap[K]>;
5312
- getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf <SVGElementTagNameMap[K]>;
5313
- getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element> ;
5314
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf <HTMLElement>;
5315
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf <SVGElement>;
5316
- getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element> ;
5310
+ getElementsByClassName(classNames: string): HTMLCollection ;
5311
+ getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollection <HTMLElementTagNameMap[K]>;
5312
+ getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollection <SVGElementTagNameMap[K]>;
5313
+ getElementsByTagName(qualifiedName: string): HTMLCollection ;
5314
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollection <HTMLElement>;
5315
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollection <SVGElement>;
5316
+ getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollection ;
5317
5317
/**
5318
5318
* Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
5319
5319
*/
@@ -6562,36 +6562,27 @@ declare var HTMLCanvasElement: {
6562
6562
};
6563
6563
6564
6564
/** A generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list. */
6565
- interface HTMLCollectionBase {
6565
+ interface HTMLCollection<E extends Element = Element, N = never> {
6566
6566
/**
6567
6567
* Sets or retrieves the number of objects in a collection.
6568
6568
*/
6569
6569
readonly length: number;
6570
6570
/**
6571
6571
* Retrieves an object from various collections.
6572
6572
*/
6573
- item(index: number): Element | null;
6574
- [index: number]: Element;
6575
- }
6576
-
6577
- interface HTMLCollection extends HTMLCollectionBase {
6573
+ item(index: number): E | null;
6578
6574
/**
6579
6575
* Retrieves a select object or an object from an options collection.
6580
6576
*/
6581
- namedItem(name: string): Element | null;
6577
+ namedItem(name: string): E | N | null;
6578
+ [index: number]: E;
6582
6579
}
6583
6580
6584
6581
declare var HTMLCollection: {
6585
6582
prototype: HTMLCollection;
6586
6583
new(): HTMLCollection;
6587
6584
};
6588
6585
6589
- interface HTMLCollectionOf<T extends Element> extends HTMLCollectionBase {
6590
- item(index: number): T | null;
6591
- namedItem(name: string): T | null;
6592
- [index: number]: T;
6593
- }
6594
-
6595
6586
/** Provides special properties (beyond those of the regular HTMLElement interface it also has available to it by inheritance) for manipulating definition list (<dl>) elements. */
6596
6587
interface HTMLDListElement extends HTMLElement {
6597
6588
/** @deprecated */
@@ -6623,7 +6614,7 @@ declare var HTMLDataElement: {
6623
6614
6624
6615
/** Provides special properties (beyond the HTMLElement object interface it also has available to it by inheritance) to manipulate <datalist> elements and their content. */
6625
6616
interface HTMLDataListElement extends HTMLElement {
6626
- readonly options: HTMLCollectionOf <HTMLOptionElement>;
6617
+ readonly options: HTMLCollection <HTMLOptionElement>;
6627
6618
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
6628
6619
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
6629
6620
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -6843,7 +6834,7 @@ declare var HTMLFontElement: {
6843
6834
};
6844
6835
6845
6836
/** A collection of HTML form control elements. */
6846
- interface HTMLFormControlsCollection extends HTMLCollectionBase {
6837
+ interface HTMLFormControlsCollection extends HTMLCollection<Element, RadioNodeList> {
6847
6838
/**
6848
6839
* Returns the item with ID or name name from the collection.
6849
6840
*
@@ -7606,7 +7597,7 @@ interface HTMLMapElement extends HTMLElement {
7606
7597
/**
7607
7598
* Retrieves a collection of the area objects defined for the given map object.
7608
7599
*/
7609
- readonly areas: HTMLCollection;
7600
+ readonly areas: HTMLCollection<HTMLAreaElement> ;
7610
7601
/**
7611
7602
* Sets or retrieves the name of the object.
7612
7603
*/
@@ -8147,7 +8138,7 @@ declare var HTMLOptionElement: {
8147
8138
};
8148
8139
8149
8140
/** HTMLOptionsCollection is an interface representing a collection of HTML option elements (in document order) and offers methods and properties for traversing the list as well as optionally altering its items. This type is returned solely by the "options" property of select. */
8150
- interface HTMLOptionsCollection extends HTMLCollectionOf <HTMLOptionElement> {
8141
+ interface HTMLOptionsCollection extends HTMLCollection <HTMLOptionElement> {
8151
8142
/**
8152
8143
* Returns the number of elements in the collection.
8153
8144
*
@@ -8420,7 +8411,7 @@ interface HTMLSelectElement extends HTMLElement {
8420
8411
* Sets or retrieves the index of the selected option in a select object.
8421
8412
*/
8422
8413
selectedIndex: number;
8423
- readonly selectedOptions: HTMLCollectionOf <HTMLOptionElement>;
8414
+ readonly selectedOptions: HTMLCollection <HTMLOptionElement>;
8424
8415
/**
8425
8416
* Sets or retrieves the number of rows in the list box.
8426
8417
*/
@@ -8736,7 +8727,7 @@ interface HTMLTableElement extends HTMLElement {
8736
8727
/**
8737
8728
* Sets or retrieves the number of horizontal rows contained in the object.
8738
8729
*/
8739
- readonly rows: HTMLCollectionOf <HTMLTableRowElement>;
8730
+ readonly rows: HTMLCollection <HTMLTableRowElement>;
8740
8731
/**
8741
8732
* Sets or retrieves which dividing lines (inner borders) are displayed.
8742
8733
*/
@@ -8750,7 +8741,7 @@ interface HTMLTableElement extends HTMLElement {
8750
8741
/**
8751
8742
* Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.
8752
8743
*/
8753
- readonly tBodies: HTMLCollectionOf <HTMLTableSectionElement>;
8744
+ readonly tBodies: HTMLCollection <HTMLTableSectionElement>;
8754
8745
/**
8755
8746
* Retrieves the tFoot object of the table.
8756
8747
*/
@@ -8838,7 +8829,7 @@ interface HTMLTableRowElement extends HTMLElement {
8838
8829
/**
8839
8830
* Retrieves a collection of all cells in the table row.
8840
8831
*/
8841
- readonly cells: HTMLCollectionOf <HTMLTableDataCellElement | HTMLTableHeaderCellElement>;
8832
+ readonly cells: HTMLCollection <HTMLTableDataCellElement | HTMLTableHeaderCellElement>;
8842
8833
/** @deprecated */
8843
8834
ch: string;
8844
8835
/** @deprecated */
@@ -8888,7 +8879,7 @@ interface HTMLTableSectionElement extends HTMLElement {
8888
8879
/**
8889
8880
* Sets or retrieves the number of horizontal rows contained in the object.
8890
8881
*/
8891
- readonly rows: HTMLCollectionOf <HTMLTableRowElement>;
8882
+ readonly rows: HTMLCollection <HTMLTableRowElement>;
8892
8883
/** @deprecated */
8893
8884
vAlign: string;
8894
8885
/**
0 commit comments