1/// <reference lib="dom" /> 2 3interface DOMTokenList { 4 [Symbol.iterator](): IterableIterator<string>; 5} 6 7interface Headers { 8 [Symbol.iterator](): IterableIterator<[string, string]>; 9 /** 10 * Returns an iterator allowing to go through all key/value pairs contained in this object. 11 */ 12 entries(): IterableIterator<[string, string]>; 13 /** 14 * Returns an iterator allowing to go through all keys f the key/value pairs contained in this object. 15 */ 16 keys(): IterableIterator<string>; 17 /** 18 * Returns an iterator allowing to go through all values of the key/value pairs contained in this object. 19 */ 20 values(): IterableIterator<string>; 21} 22 23interface NodeList { 24 /** 25 * Returns an array of key, value pairs for every entry in the list 26 */ 27 entries(): IterableIterator<[number, Node]>; 28 /** 29 * Performs the specified action for each node in an list. 30 * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list. 31 * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. 32 */ 33 forEach(callbackfn: (value: Node, index: number, listObj: NodeList) => void, thisArg?: any): void; 34 /** 35 * Returns an list of keys in the list 36 */ 37 keys(): IterableIterator<number>; 38 39 /** 40 * Returns an list of values in the list 41 */ 42 values(): IterableIterator<Node>; 43 44 45 [Symbol.iterator](): IterableIterator<Node>; 46} 47 48interface NodeListOf<TNode extends Node> { 49 50 /** 51 * Returns an array of key, value pairs for every entry in the list 52 */ 53 entries(): IterableIterator<[number, TNode]>; 54 55 /** 56 * Performs the specified action for each node in an list. 57 * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list. 58 * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. 59 */ 60 forEach(callbackfn: (value: TNode, index: number, listObj: NodeListOf<TNode>) => void, thisArg?: any): void; 61 /** 62 * Returns an list of keys in the list 63 */ 64 keys(): IterableIterator<number>; 65 /** 66 * Returns an list of values in the list 67 */ 68 values(): IterableIterator<TNode>; 69 70 [Symbol.iterator](): IterableIterator<TNode>; 71} 72 73interface HTMLCollectionBase { 74 [Symbol.iterator](): IterableIterator<Element>; 75} 76 77interface HTMLCollectionOf<T extends Element> { 78 [Symbol.iterator](): IterableIterator<T>; 79} 80 81interface FormData { 82 /** 83 * Returns an array of key, value pairs for every entry in the list 84 */ 85 entries(): IterableIterator<[string, string | File]>; 86 /** 87 * Returns a list of keys in the list 88 */ 89 keys(): IterableIterator<string>; 90 /** 91 * Returns a list of values in the list 92 */ 93 values(): IterableIterator<string | File>; 94 95 [Symbol.iterator](): IterableIterator<string | File>; 96} 97 98interface URLSearchParams { 99 /** 100 * Returns an array of key, value pairs for every entry in the search params 101 */ 102 entries(): IterableIterator<[string, string]>; 103 /** 104 * Returns a list of keys in the search params 105 */ 106 keys(): IterableIterator<string>; 107 /** 108 * Returns a list of values in the search params 109 */ 110 values(): IterableIterator<string>; 111 /** 112 * iterate over key/value pairs 113 */ 114 [Symbol.iterator](): IterableIterator<[string, string]>; 115} 116