-
Notifications
You must be signed in to change notification settings - Fork 441
Add type to FileReader event target. #398
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
Conversation
baselines/dom.generated.d.ts
Outdated
onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null; | ||
onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null; | ||
onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null; | ||
onabort: ((this: FileReader, ev: ProgressEvent & {target: FileReader}) => any) | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would create a new type FilreReaderProgressEvent
that extends ProgressEvent
and use that instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reviewing. I have added FileReaderProgressEvent
.
baselines/dom.generated.d.ts
Outdated
readonly target: FileReader | null; | ||
} | ||
|
||
declare var FileReaderProgressEvent: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be added. set "no-interface-object": 1,
on the new interface to avoid the creation of a var.
inputfiles/addedTypes.json
Outdated
"override-type": "FileReader | null" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add "no-interface-object": 1,
Removed unnecessary |
Thanks |
This PR fixes microsoft/TypeScript#4163.
The FileReader API spec says the event target is
FileReader
so I giveFileReader
type totarget
ofev
.