Skip to content

Fix type declarations for "setSelectionRange" API #340

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

Merged
merged 1 commit into from
Jan 4, 2018
Merged
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
6 changes: 4 additions & 2 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5500,8 +5500,9 @@ interface HTMLInputElement extends HTMLElement {
* Sets the start and end positions of a selection in a text field.
* @param start The offset into the text field for the start of the selection.
* @param end The offset into the text field for the end of the selection.
* @param direction The direction in which the selection is performed.
*/
setSelectionRange(start?: number, end?: number, direction?: string): void;
setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void;
/**
* Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.
* @param n Value to decrement the value by.
Expand Down Expand Up @@ -6963,8 +6964,9 @@ interface HTMLTextAreaElement extends HTMLElement {
* Sets the start and end positions of a selection in a text field.
* @param start The offset into the text field for the start of the selection.
* @param end The offset into the text field for the end of the selection.
* @param direction The direction in which the selection is performed.
*/
setSelectionRange(start: number, end: number): void;
setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
4 changes: 2 additions & 2 deletions inputfiles/comments.json
Original file line number Diff line number Diff line change
Expand Up @@ -1948,7 +1948,7 @@
},
{
"name": "setSelectionRange",
"comment": "/**\r\n * Sets the start and end positions of a selection in a text field.\r\n * @param start The offset into the text field for the start of the selection.\r\n * @param end The offset into the text field for the end of the selection.\r\n */"
"comment": "/**\r\n * Sets the start and end positions of a selection in a text field.\r\n * @param start The offset into the text field for the start of the selection.\r\n * @param end The offset into the text field for the end of the selection.\r\n * @param direction The direction in which the selection is performed.\r\n */"
},
{
"name": "select",
Expand Down Expand Up @@ -2335,7 +2335,7 @@
},
{
"name": "setSelectionRange",
"comment": "/**\r\n * Sets the start and end positions of a selection in a text field.\r\n * @param start The offset into the text field for the start of the selection.\r\n * @param end The offset into the text field for the end of the selection.\r\n */"
"comment": "/**\r\n * Sets the start and end positions of a selection in a text field.\r\n * @param start The offset into the text field for the start of the selection.\r\n * @param end The offset into the text field for the end of the selection.\r\n * @param direction The direction in which the selection is performed.\r\n */"
},
{
"name": "select",
Expand Down
16 changes: 16 additions & 0 deletions inputfiles/overridingTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -1739,5 +1739,21 @@
"readonly": true,
"name": "lastModifiedDate",
"type": "Date"
},
{
"kind": "method",
"interface": "HTMLInputElement",
"name": "setSelectionRange",
"signatures": [
"setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void"
]
},
{
"kind": "method",
"interface": "HTMLTextAreaElement",
"name": "setSelectionRange",
"signatures": [
"setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void"
]
}
]