Skip to content

Auto emit comments for iteration methods #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 36 additions & 9 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1959,6 +1959,11 @@ declare var AudioParam: {
};

interface AudioParamMap {
/**
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: AudioParam, key: string, parent: AudioParamMap) => void, thisArg?: any): void;
}

Expand Down Expand Up @@ -3757,6 +3762,11 @@ interface DOMTokenList {
*/
supports(token: string): boolean;
toggle(token: string, force?: boolean): boolean;
/**
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: string, key: number, parent: DOMTokenList) => void, thisArg?: any): void;
[index: number]: string;
}
Expand Down Expand Up @@ -4515,9 +4525,6 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par
* @param content The text and HTML tags to write.
*/
writeln(...text: string[]): void;
/**
* Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
*/
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -5150,6 +5157,11 @@ interface FormData {
getAll(name: string): FormDataEntryValue[];
has(name: string): boolean;
set(name: string, value: string | Blob, fileName?: string): void;
/**
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
}

Expand Down Expand Up @@ -8618,6 +8630,11 @@ interface Headers {
get(name: string): string | null;
has(name: string): boolean;
set(name: string, value: string): void;
/**
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
}

Expand Down Expand Up @@ -10523,9 +10540,9 @@ interface NodeList {
*/
item(index: number): Node | null;
/**
* Performs the specified action for each node in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: Node, key: number, parent: NodeList) => void, thisArg?: any): void;
[index: number]: Node;
Expand All @@ -10540,9 +10557,9 @@ interface NodeListOf<TNode extends Node> extends NodeList {
length: number;
item(index: number): TNode;
/**
* Performs the specified action for each node in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: TNode, key: number, parent: NodeListOf<TNode>) => void, thisArg?: any): void;
[index: number]: TNode;
Expand Down Expand Up @@ -11745,6 +11762,11 @@ declare var RTCStatsProvider: {
};

interface RTCStatsReport {
/**
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: any, key: string, parent: RTCStatsReport) => void, thisArg?: any): void;
}

Expand Down Expand Up @@ -14997,6 +15019,11 @@ interface URLSearchParams {
*/
set(name: string, value: string): void;
sort(): void;
/**
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
}

Expand Down
33 changes: 21 additions & 12 deletions baselines/dom.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,17 @@ interface DOMStringList {

interface DOMTokenList {
[Symbol.iterator](): IterableIterator<string>;
/**
* Returns an iterator allowing to go through all key/value pairs contained in this object.
*/
entries(): IterableIterator<[number, string]>;
/**
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
*/
keys(): IterableIterator<number>;
/**
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
*/
values(): IterableIterator<string>;
}

Expand All @@ -47,15 +56,15 @@ interface FileList {
interface FormData {
[Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
/**
* Returns an array of key, value pairs for every entry in the list.
* Returns an iterator allowing to go through all key/value pairs contained in this object.
*/
entries(): IterableIterator<[string, FormDataEntryValue]>;
/**
* Returns a list of keys in the list.
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
*/
keys(): IterableIterator<string>;
/**
* Returns a list of values in the list.
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
*/
values(): IterableIterator<FormDataEntryValue>;
}
Expand Down Expand Up @@ -111,31 +120,31 @@ interface NamedNodeMap {
interface NodeList {
[Symbol.iterator](): IterableIterator<Node>;
/**
* Returns an array of key, value pairs for every entry in the list.
* Returns an iterator allowing to go through all key/value pairs contained in this object.
*/
entries(): IterableIterator<[number, Node]>;
/**
* Returns an list of keys in the list.
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
*/
keys(): IterableIterator<number>;
/**
* Returns an list of values in the list.
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
*/
values(): IterableIterator<Node>;
}

interface NodeListOf<TNode extends Node> {
[Symbol.iterator](): IterableIterator<TNode>;
/**
* Returns an array of key, value pairs for every entry in the list.
* Returns an iterator allowing to go through all key/value pairs contained in this object.
*/
entries(): IterableIterator<[number, TNode]>;
/**
* Returns an list of keys in the list.
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
*/
keys(): IterableIterator<number>;
/**
* Returns an list of values in the list.
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
*/
values(): IterableIterator<TNode>;
}
Expand Down Expand Up @@ -198,15 +207,15 @@ interface TouchList {
interface URLSearchParams {
[Symbol.iterator](): IterableIterator<[string, string]>;
/**
* Returns an array of key, value pairs for every entry in the search params.
* Returns an iterator allowing to go through all key/value pairs contained in this object.
*/
entries(): IterableIterator<[string, string]>;
/**
* Returns a list of keys in the search params.
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
*/
keys(): IterableIterator<string>;
/**
* Returns a list of values in the search params.
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
*/
values(): IterableIterator<string>;
}
Expand Down
15 changes: 15 additions & 0 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,11 @@ interface FormData {
getAll(name: string): FormDataEntryValue[];
has(name: string): boolean;
set(name: string, value: string | Blob, fileName?: string): void;
/**
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
}

Expand All @@ -1303,6 +1308,11 @@ interface Headers {
get(name: string): string | null;
has(name: string): boolean;
set(name: string, value: string): void;
/**
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
}

Expand Down Expand Up @@ -2675,6 +2685,11 @@ interface URLSearchParams {
*/
set(name: string, value: string): void;
sort(): void;
/**
* Performs the specified action for each element in an list.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.
* @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.
*/
forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
}

Expand Down
70 changes: 0 additions & 70 deletions inputfiles/comments.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,64 +146,6 @@
},
"interfaces": {
"interface": {
"Headers": {
"iterator": {
"comments": {
"comment": {
"entries": "/**\r\n * Returns an iterator allowing to go through all key/value pairs contained in this object.\r\n */",
"keys": "/**\r\n * Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.\r\n */",
"values": "/**\r\n * Returns an iterator allowing to go through all values of the key/value pairs contained in this object.\r\n */"
}
}
}
},
"FormData": {
"iterator": {
"comments": {
"comment": {
"entries": "/**\r\n * Returns an array of key, value pairs for every entry in the list.\r\n */",
"keys": "/**\r\n * Returns a list of keys in the list.\r\n */",
"values": "/**\r\n * Returns a list of values in the list.\r\n */"
}
}
}
},
"NodeListOf<TNode extends Node>": {
"methods": {
"method": {
"forEach": {
"comment": "/**\r\n * Performs the specified action for each node in an list.\r\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.\r\n * @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.\r\n */"
}
}
},
"iterator": {
"comments": {
"comment": {
"entries": "/**\r\n * Returns an array of key, value pairs for every entry in the list.\r\n */",
"keys": "/**\r\n * Returns an list of keys in the list.\r\n */",
"values": "/**\r\n * Returns an list of values in the list.\r\n */"
}
}
}
},
"NodeList": {
"methods": {
"method": {
"forEach": {
"comment": "/**\r\n * Performs the specified action for each node in an list.\r\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.\r\n * @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.\r\n */"
}
}
},
"iterator": {
"comments": {
"comment": {
"entries": "/**\r\n * Returns an array of key, value pairs for every entry in the list.\r\n */",
"keys": "/**\r\n * Returns an list of keys in the list.\r\n */",
"values": "/**\r\n * Returns an list of values in the list.\r\n */"
}
}
}
},
"HTMLTableElement": {
"properties": {
"property": {
Expand Down Expand Up @@ -839,9 +781,6 @@
"createNodeIterator": {
"comment": "/**\r\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\r\n * @param root The root element or node to start traversing on.\r\n * @param whatToShow The type of nodes or elements to appear in the node list\r\n * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.\r\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\r\n */"
},
"getSelection": {
"comment": "/**\r\n * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.\r\n */"
},
"getElementById": {
"comment": "/**\r\n * Returns a reference to the first object with the specified value of the ID or NAME attribute.\r\n * @param elementId String that specifies the ID value. Case-insensitive.\r\n */"
}
Expand Down Expand Up @@ -1891,15 +1830,6 @@
}
},
"constructor": "/**\r\n * Constructor returning a URLSearchParams object.\r\n */"
},
"iterator": {
"comments": {
"comment": {
"entries": "/**\r\n * Returns an array of key, value pairs for every entry in the search params.\r\n */",
"keys": "/**\r\n * Returns a list of keys in the search params.\r\n */",
"values": "/**\r\n * Returns a list of values in the search params.\r\n */"
}
}
}
}
}
Expand Down
Loading