@@ -4522,12 +4522,12 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4522
4522
* Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.
4523
4523
*/
4524
4524
/** @deprecated */
4525
- readonly anchors: HTMLCollectionOf <HTMLAnchorElement>;
4525
+ readonly anchors: HTMLCollection <HTMLAnchorElement>;
4526
4526
/**
4527
4527
* Retrieves a collection of all applet objects in the document.
4528
4528
*/
4529
4529
/** @deprecated */
4530
- readonly applets: HTMLCollectionOf <HTMLAppletElement>;
4530
+ readonly applets: HTMLCollection <HTMLAppletElement>;
4531
4531
/**
4532
4532
* Deprecated. Sets or retrieves a value that indicates the background color behind the object.
4533
4533
*/
@@ -4595,7 +4595,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4595
4595
/**
4596
4596
* Retrieves a collection of all embed objects in the document.
4597
4597
*/
4598
- readonly embeds: HTMLCollectionOf <HTMLEmbedElement>;
4598
+ readonly embeds: HTMLCollection <HTMLEmbedElement>;
4599
4599
/**
4600
4600
* Sets or gets the foreground (text) color of the document.
4601
4601
*/
@@ -4604,7 +4604,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4604
4604
/**
4605
4605
* Retrieves a collection, in source order, of all form objects in the document.
4606
4606
*/
4607
- readonly forms: HTMLCollectionOf <HTMLFormElement>;
4607
+ readonly forms: HTMLCollection <HTMLFormElement>;
4608
4608
/** @deprecated */
4609
4609
readonly fullscreen: boolean;
4610
4610
/**
@@ -4619,7 +4619,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4619
4619
/**
4620
4620
* Retrieves a collection, in source order, of img objects in the document.
4621
4621
*/
4622
- readonly images: HTMLCollectionOf <HTMLImageElement>;
4622
+ readonly images: HTMLCollection <HTMLImageElement>;
4623
4623
/**
4624
4624
* Gets the implementation object of the current document.
4625
4625
*/
@@ -4640,7 +4640,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4640
4640
/**
4641
4641
* Retrieves a collection of all a objects that specify the href property and all area objects in the document.
4642
4642
*/
4643
- readonly links: HTMLCollectionOf <HTMLAnchorElement | HTMLAreaElement>;
4643
+ readonly links: HTMLCollection <HTMLAnchorElement | HTMLAreaElement>;
4644
4644
/**
4645
4645
* Contains information about the current URL.
4646
4646
*/
@@ -4662,7 +4662,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4662
4662
/**
4663
4663
* Return an HTMLCollection of the embed elements in the Document.
4664
4664
*/
4665
- readonly plugins: HTMLCollectionOf <HTMLEmbedElement>;
4665
+ readonly plugins: HTMLCollection <HTMLEmbedElement>;
4666
4666
/**
4667
4667
* Retrieves a value that indicates the current state of the object.
4668
4668
*/
@@ -4674,7 +4674,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4674
4674
/**
4675
4675
* Retrieves a collection of all script objects in the document.
4676
4676
*/
4677
- readonly scripts: HTMLCollectionOf <HTMLScriptElement>;
4677
+ readonly scripts: HTMLCollection <HTMLScriptElement>;
4678
4678
readonly scrollingElement: Element | null;
4679
4679
readonly timeline: DocumentTimeline;
4680
4680
/**
@@ -4889,7 +4889,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4889
4889
/**
4890
4890
* 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.
4891
4891
*/
4892
- getElementsByClassName(classNames: string): HTMLCollectionOf<Element> ;
4892
+ getElementsByClassName(classNames: string): HTMLCollection ;
4893
4893
/**
4894
4894
* Gets a collection of objects based on the value of the NAME or ID attribute.
4895
4895
* @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.
@@ -4899,9 +4899,9 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4899
4899
* Retrieves a collection of objects based on the specified element name.
4900
4900
* @param name Specifies the name of an element.
4901
4901
*/
4902
- getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf <HTMLElementTagNameMap[K]>;
4903
- getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf <SVGElementTagNameMap[K]>;
4904
- getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element> ;
4902
+ getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollection <HTMLElementTagNameMap[K]>;
4903
+ getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollection <SVGElementTagNameMap[K]>;
4904
+ getElementsByTagName(qualifiedName: string): HTMLCollection ;
4905
4905
/**
4906
4906
* If namespace and localName are "*" returns a HTMLCollection of all descendant elements.
4907
4907
*
@@ -4911,9 +4911,9 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
4911
4911
*
4912
4912
* Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName.
4913
4913
*/
4914
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf <HTMLElement>;
4915
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf <SVGElement>;
4916
- getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element> ;
4914
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollection <HTMLElement>;
4915
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollection <SVGElement>;
4916
+ getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollection ;
4917
4917
/**
4918
4918
* Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
4919
4919
*/
@@ -5269,13 +5269,13 @@ interface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTyp
5269
5269
/**
5270
5270
* 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.
5271
5271
*/
5272
- getElementsByClassName(classNames: string): HTMLCollectionOf<Element> ;
5273
- getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf <HTMLElementTagNameMap[K]>;
5274
- getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf <SVGElementTagNameMap[K]>;
5275
- getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element> ;
5276
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf <HTMLElement>;
5277
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf <SVGElement>;
5278
- getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element> ;
5272
+ getElementsByClassName(classNames: string): HTMLCollection ;
5273
+ getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollection <HTMLElementTagNameMap[K]>;
5274
+ getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollection <SVGElementTagNameMap[K]>;
5275
+ getElementsByTagName(qualifiedName: string): HTMLCollection ;
5276
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollection <HTMLElement>;
5277
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollection <SVGElement>;
5278
+ getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollection ;
5279
5279
/**
5280
5280
* Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
5281
5281
*/
@@ -6533,36 +6533,27 @@ declare var HTMLCanvasElement: {
6533
6533
};
6534
6534
6535
6535
/** A generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list. */
6536
- interface HTMLCollectionBase {
6536
+ interface HTMLCollection<E extends Element = Element, N = never> {
6537
6537
/**
6538
6538
* Sets or retrieves the number of objects in a collection.
6539
6539
*/
6540
6540
readonly length: number;
6541
6541
/**
6542
6542
* Retrieves an object from various collections.
6543
6543
*/
6544
- item(index: number): Element | null;
6545
- [index: number]: Element;
6546
- }
6547
-
6548
- interface HTMLCollection extends HTMLCollectionBase {
6544
+ item(index: number): E | null;
6549
6545
/**
6550
6546
* Retrieves a select object or an object from an options collection.
6551
6547
*/
6552
- namedItem(name: string): Element | null;
6548
+ namedItem(name: string): E | N | null;
6549
+ [index: number]: E;
6553
6550
}
6554
6551
6555
6552
declare var HTMLCollection: {
6556
6553
prototype: HTMLCollection;
6557
6554
new(): HTMLCollection;
6558
6555
};
6559
6556
6560
- interface HTMLCollectionOf<T extends Element> extends HTMLCollectionBase {
6561
- item(index: number): T | null;
6562
- namedItem(name: string): T | null;
6563
- [index: number]: T;
6564
- }
6565
-
6566
6557
/** Provides special properties (beyond those of the regular HTMLElement interface it also has available to it by inheritance) for manipulating definition list (<dl>) elements. */
6567
6558
interface HTMLDListElement extends HTMLElement {
6568
6559
/** @deprecated */
@@ -6594,7 +6585,7 @@ declare var HTMLDataElement: {
6594
6585
6595
6586
/** Provides special properties (beyond the HTMLElement object interface it also has available to it by inheritance) to manipulate <datalist> elements and their content. */
6596
6587
interface HTMLDataListElement extends HTMLElement {
6597
- readonly options: HTMLCollectionOf <HTMLOptionElement>;
6588
+ readonly options: HTMLCollection <HTMLOptionElement>;
6598
6589
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
6599
6590
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
6600
6591
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -6814,7 +6805,7 @@ declare var HTMLFontElement: {
6814
6805
};
6815
6806
6816
6807
/** A collection of HTML form control elements. */
6817
- interface HTMLFormControlsCollection extends HTMLCollectionBase {
6808
+ interface HTMLFormControlsCollection extends HTMLCollection<Element, RadioNodeList> {
6818
6809
/**
6819
6810
* Returns the item with ID or name name from the collection.
6820
6811
*
@@ -7581,7 +7572,7 @@ interface HTMLMapElement extends HTMLElement {
7581
7572
/**
7582
7573
* Retrieves a collection of the area objects defined for the given map object.
7583
7574
*/
7584
- readonly areas: HTMLCollection;
7575
+ readonly areas: HTMLCollection<HTMLAreaElement> ;
7585
7576
/**
7586
7577
* Sets or retrieves the name of the object.
7587
7578
*/
@@ -8122,7 +8113,7 @@ declare var HTMLOptionElement: {
8122
8113
};
8123
8114
8124
8115
/** 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. */
8125
- interface HTMLOptionsCollection extends HTMLCollectionOf <HTMLOptionElement> {
8116
+ interface HTMLOptionsCollection extends HTMLCollection <HTMLOptionElement> {
8126
8117
/**
8127
8118
* Returns the number of elements in the collection.
8128
8119
*
@@ -8398,7 +8389,7 @@ interface HTMLSelectElement extends HTMLElement {
8398
8389
* Sets or retrieves the index of the selected option in a select object.
8399
8390
*/
8400
8391
selectedIndex: number;
8401
- readonly selectedOptions: HTMLCollectionOf <HTMLOptionElement>;
8392
+ readonly selectedOptions: HTMLCollection <HTMLOptionElement>;
8402
8393
/**
8403
8394
* Sets or retrieves the number of rows in the list box.
8404
8395
*/
@@ -8714,7 +8705,7 @@ interface HTMLTableElement extends HTMLElement {
8714
8705
/**
8715
8706
* Sets or retrieves the number of horizontal rows contained in the object.
8716
8707
*/
8717
- readonly rows: HTMLCollectionOf <HTMLTableRowElement>;
8708
+ readonly rows: HTMLCollection <HTMLTableRowElement>;
8718
8709
/**
8719
8710
* Sets or retrieves which dividing lines (inner borders) are displayed.
8720
8711
*/
@@ -8728,7 +8719,7 @@ interface HTMLTableElement extends HTMLElement {
8728
8719
/**
8729
8720
* Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.
8730
8721
*/
8731
- readonly tBodies: HTMLCollectionOf <HTMLTableSectionElement>;
8722
+ readonly tBodies: HTMLCollection <HTMLTableSectionElement>;
8732
8723
/**
8733
8724
* Retrieves the tFoot object of the table.
8734
8725
*/
@@ -8816,7 +8807,7 @@ interface HTMLTableRowElement extends HTMLElement {
8816
8807
/**
8817
8808
* Retrieves a collection of all cells in the table row.
8818
8809
*/
8819
- readonly cells: HTMLCollectionOf <HTMLTableDataCellElement | HTMLTableHeaderCellElement>;
8810
+ readonly cells: HTMLCollection <HTMLTableDataCellElement | HTMLTableHeaderCellElement>;
8820
8811
/** @deprecated */
8821
8812
ch: string;
8822
8813
/** @deprecated */
@@ -8866,7 +8857,7 @@ interface HTMLTableSectionElement extends HTMLElement {
8866
8857
/**
8867
8858
* Sets or retrieves the number of horizontal rows contained in the object.
8868
8859
*/
8869
- readonly rows: HTMLCollectionOf <HTMLTableRowElement>;
8860
+ readonly rows: HTMLCollection <HTMLTableRowElement>;
8870
8861
/** @deprecated */
8871
8862
vAlign: string;
8872
8863
/**
0 commit comments