Reputation: 1117
In a Svelte app, how can we access native web APIs, such as the File System Access API, to, for example, use the window.showOpenFilePicker() method?
Upvotes: 1
Views: 1501
Reputation: 539
To get Typescript support for the new WICG File System Access APIs you'll need to make the following two changes:
@types/wicg-file-system-access
npm package into your dev dependencies (i.e., for npm npm install --save-dev @types/wicg-file-system-access
).{
...
"compilerOptions": {
"types": ["@types/wicg-file-system-access"]
}
...
}
Upvotes: 9