Fix type declaration for "setSelectionRange" API#20459
Conversation
The `start` and `end` parameters aren't optional. Also, the `direction` parameter only accepts one of three string values, which are now modeled as a union of string literal types. More information: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
There was a problem hiding this comment.
This is a file generated with scripts from the TSJS-lib-generator repository, so they can't be edited here.
More specifically, these are generated from Edge's IDL XML, also not allowed to be edited, from https://github.com/Microsoft/TSJS-lib-generator/blob/5b748d4b9e0831c8480d84edf6e65fa6c8f7afd3/inputfiles/browser.webidl.xml#L5162-L5166 and https://github.com/Microsoft/TSJS-lib-generator/blob/5b748d4b9e0831c8480d84edf6e65fa6c8f7afd3/inputfiles/browser.webidl.xml#L5901-L5904.
To correct them, you need to send a PR against https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/overridingTypes.json.
|
@Kovensky Thanks for pointing me in the right direction. Here's the new PR: microsoft/TypeScript-DOM-lib-generator#340 Let me know if you need me to change something else! |
|
This PR should be closed, as this was merged by #21071 |
Fixes #20419.
The
startandendparameters of theHTMLInputElement.setSelectionRange()API are not optional.In addition, the
directionparameter only accepts one of three string values, which is why it's now typed using string literal types.