@@ -2308,11 +2308,11 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
2308
2308
/**
2309
2309
* Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.
2310
2310
*/
2311
- anchors: HTMLCollection ;
2311
+ anchors: HTMLCollectionOf<HTMLAnchorElement> ;
2312
2312
/**
2313
2313
* Retrieves a collection of all applet objects in the document.
2314
2314
*/
2315
- applets: HTMLCollection ;
2315
+ applets: HTMLCollectionOf<HTMLAppletElement> ;
2316
2316
/**
2317
2317
* Deprecated. Sets or retrieves a value that indicates the background color behind the object.
2318
2318
*/
@@ -2360,23 +2360,23 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
2360
2360
/**
2361
2361
* Retrieves a collection of all embed objects in the document.
2362
2362
*/
2363
- embeds: HTMLCollection ;
2363
+ embeds: HTMLCollectionOf<HTMLEmbedElement> ;
2364
2364
/**
2365
2365
* Sets or gets the foreground (text) color of the document.
2366
2366
*/
2367
2367
fgColor: string;
2368
2368
/**
2369
2369
* Retrieves a collection, in source order, of all form objects in the document.
2370
2370
*/
2371
- forms: HTMLCollection ;
2371
+ forms: HTMLCollectionOf<HTMLFormElement> ;
2372
2372
fullscreenElement: Element;
2373
2373
fullscreenEnabled: boolean;
2374
2374
head: HTMLHeadElement;
2375
2375
hidden: boolean;
2376
2376
/**
2377
2377
* Retrieves a collection, in source order, of img objects in the document.
2378
2378
*/
2379
- images: HTMLCollection ;
2379
+ images: HTMLCollectionOf<HTMLImageElement> ;
2380
2380
/**
2381
2381
* Gets the implementation object of the current document.
2382
2382
*/
@@ -2396,7 +2396,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
2396
2396
/**
2397
2397
* Retrieves a collection of all a objects that specify the href property and all area objects in the document.
2398
2398
*/
2399
- links: HTMLCollection ;
2399
+ links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement> ;
2400
2400
/**
2401
2401
* Contains information about the current URL.
2402
2402
*/
@@ -2711,7 +2711,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
2711
2711
onwaiting: (ev: Event) => any;
2712
2712
onwebkitfullscreenchange: (ev: Event) => any;
2713
2713
onwebkitfullscreenerror: (ev: Event) => any;
2714
- plugins: HTMLCollection ;
2714
+ plugins: HTMLCollectionOf<HTMLEmbedElement> ;
2715
2715
pointerLockElement: Element;
2716
2716
/**
2717
2717
* Retrieves a value that indicates the current state of the object.
@@ -2728,7 +2728,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
2728
2728
/**
2729
2729
* Retrieves a collection of all script objects in the document.
2730
2730
*/
2731
- scripts: HTMLCollection ;
2731
+ scripts: HTMLCollectionOf<HTMLScriptElement> ;
2732
2732
scrollingElement: Element;
2733
2733
/**
2734
2734
* Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.
@@ -4455,7 +4455,7 @@ interface HTMLCollection {
4455
4455
/**
4456
4456
* Retrieves an object from various collections.
4457
4457
*/
4458
- item(nameOrIndex?: any, optionalIndex?: any ): Element;
4458
+ item(index: number ): Element;
4459
4459
/**
4460
4460
* Retrieves a select object or an object from an options collection.
4461
4461
*/
@@ -4478,7 +4478,7 @@ declare var HTMLDListElement: {
4478
4478
}
4479
4479
4480
4480
interface HTMLDataListElement extends HTMLElement {
4481
- options: HTMLCollection ;
4481
+ options: HTMLCollectionOf<HTMLOptionElement> ;
4482
4482
}
4483
4483
4484
4484
declare var HTMLDataListElement: {
@@ -6773,7 +6773,7 @@ interface HTMLSelectElement extends HTMLElement {
6773
6773
* Sets or retrieves the name of the object.
6774
6774
*/
6775
6775
name: string;
6776
- options: HTMLCollection ;
6776
+ options: HTMLCollectionOf<HTMLOptionElement> ;
6777
6777
/**
6778
6778
* When present, marks an element that can't be submitted without a value.
6779
6779
*/
@@ -6782,7 +6782,7 @@ interface HTMLSelectElement extends HTMLElement {
6782
6782
* Sets or retrieves the index of the selected option in a select object.
6783
6783
*/
6784
6784
selectedIndex: number;
6785
- selectedOptions: HTMLCollection ;
6785
+ selectedOptions: HTMLCollectionOf<HTMLOptionElement> ;
6786
6786
/**
6787
6787
* Sets or retrieves the number of rows in the list box.
6788
6788
*/
@@ -7035,7 +7035,7 @@ interface HTMLTableElement extends HTMLElement {
7035
7035
/**
7036
7036
* Sets or retrieves the number of horizontal rows contained in the object.
7037
7037
*/
7038
- rows: HTMLCollection ;
7038
+ rows: HTMLCollectionOf<HTMLTableRowElement> ;
7039
7039
/**
7040
7040
* Sets or retrieves which dividing lines (inner borders) are displayed.
7041
7041
*/
@@ -7047,7 +7047,7 @@ interface HTMLTableElement extends HTMLElement {
7047
7047
/**
7048
7048
* Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.
7049
7049
*/
7050
- tBodies: HTMLCollection ;
7050
+ tBodies: HTMLCollectionOf<HTMLTableSectionElement> ;
7051
7051
/**
7052
7052
* Retrieves the tFoot object of the table.
7053
7053
*/
@@ -7126,7 +7126,7 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment {
7126
7126
/**
7127
7127
* Retrieves a collection of all cells in the table row.
7128
7128
*/
7129
- cells: HTMLCollection ;
7129
+ cells: HTMLCollectionOf<HTMLTableDataCellElement | HTMLTableHeaderCellElement> ;
7130
7130
/**
7131
7131
* Sets or retrieves the height of the object.
7132
7132
*/
@@ -7148,7 +7148,7 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment {
7148
7148
* Creates a new cell in the table row, and adds the cell to the cells collection.
7149
7149
* @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.
7150
7150
*/
7151
- insertCell(index?: number): HTMLTableCellElement ;
7151
+ insertCell(index?: number): HTMLTableDataCellElement ;
7152
7152
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
7153
7153
}
7154
7154
@@ -7165,7 +7165,7 @@ interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment {
7165
7165
/**
7166
7166
* Sets or retrieves the number of horizontal rows contained in the object.
7167
7167
*/
7168
- rows: HTMLCollection ;
7168
+ rows: HTMLCollectionOf<HTMLTableRowElement> ;
7169
7169
/**
7170
7170
* Removes the specified row (tr) from the element and from the rows collection.
7171
7171
* @param index Number that specifies the zero-based position in the rows collection of the row to remove.
@@ -13625,6 +13625,12 @@ interface NodeListOf<TNode extends Node> extends NodeList {
13625
13625
[index: number]: TNode;
13626
13626
}
13627
13627
13628
+ interface HTMLCollectionOf<T extends Element> extends HTMLCollection {
13629
+ item(index: number): T;
13630
+ namedItem(name: string): T;
13631
+ [index: number]: T;
13632
+ }
13633
+
13628
13634
interface BlobPropertyBag {
13629
13635
type?: string;
13630
13636
endings?: string;
0 commit comments