-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Navigator interface no longer extends MSFileSaver #45612
Comments
Both of these have been marked from removal from the browsers and removed from the W3C specs, which means they were removed from the DOM.d.ts files as they follow the specs as summarized in microsoft/TypeScript-DOM-lib-generator#1029 |
You can use declaration merging and declare the types locally in your project. |
I figured it was probably something like that. We already worked around it with the declaration merging, so no issues there. Now to focus on the real fix. Thanks! |
Hi everyone! Сan someone give an example of how this can be done? |
@NickGrava interface Navigator {
msSaveOrOpenBlob: (blob: Blob) => void
} this will add |
Microsoft is removing these APIs, microsoft/TypeScript#45612
Microsoft is removing these APIs, microsoft/TypeScript#45612
In case anyone comes looking here, This fixed it for me: declare global {
interface Navigator {
msSaveOrOpenBlob: (blobOrBase64: Blob | string, filename: string) => void
}
} I just added this at the top of the file where I was using this function. |
Bug Report
Recent changes to the Navigator interface for 4.4 removed previous extensions; however, the previously extended type is still present in lib.dom.d.ts and should be added back to the interface.
🔎 Search Terms
Navigator, MSFileSaver, msSaveBlob, msSaveOrOpenBlob
🕗 Version & Regression Information
Injected starting with 9d443b7
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
TS2339: Property 'msSaveOrOpenBlob' does not exist on type 'Navigator'.
TS2339: Property 'msSaveBlob' does not exist on type 'Navigator'.
🙂 Expected behavior
Appropriately typed file continues to build as it did previously.
The text was updated successfully, but these errors were encountered: