We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In example in readme
const fileHandle = await showSaveFilePicker({ _preferPolyfill: false, suggestedName: 'Untitled.png', types: [ { accept: { 'image/png': ['png'] } }, { accept: { 'image/jpg': ['jpg'] } }, { accept: { 'image/webp': ['webp'] } }, ], excludeAcceptAllOption: false, // default }); // Look at what extension they chosen const extensionChosen = fileHandle.name.split('.').pop(); const blob = { jpg: generateCanvasBlob({ type: 'blob', format: 'jpg' }), png: generateCanvasBlob({ type: 'blob', format: 'png' }), webp: generateCanvasBlob({ type: 'blob', format: 'webp' }), }[extensionChosen]; await blob.stream().pipeTo(fileHandle.createWritable()); // or const writer = await fileHandle.createWritable(); await writer.write(blob); await writer.close();
Error in ` types: [
Argument of type '{ _preferPolyfill: false; suggestedName: string; types: ({ accept: { 'image/png': string[]; }; } | { accept: { 'image/jpg': string[]; }; } | { accept: { 'image/webp': string[]; }; })[]; excludeAcceptAllOption: false; }' is not assignable to parameter of type '{ excludeAcceptAllOption?: boolean | undefined; accepts?: any[] | undefined; suggestedName?: string | undefined; _name?: string | undefined; _preferPolyfill?: boolean | undefined; }'. Object literal may only specify known properties, and 'types' does not exist in type '{ excludeAcceptAllOption?: boolean | undefined; accepts?: any[] | undefined; suggestedName?: string | undefined; _name?: string | undefined; _preferPolyfill?: boolean | undefined; }'.ts(2345)
"native-file-system-adapter": "^3.0.0",
The text was updated successfully, but these errors were encountered:
Also in showOpenFilePicker
const [fileHandle] = await showOpenFilePicker({ _preferPolyfill: false, multiple: false, excludeAcceptAllOption: true, types: [ { description: 'JSON file', accept: { 'application/json': ['.json'], }, }, ], });
Argument of type '{ _preferPolyfill: false; multiple: false; excludeAcceptAllOption: true; types: { description: string; accept: { 'application/json': string[]; }; }[]; }' is not assignable to parameter of type '{ multiple?: boolean | undefined; excludeAcceptAllOption?: boolean | undefined; accepts?: any[] | undefined; _preferPolyfill?: boolean | undefined; }'. Object literal may only specify known properties, and 'types' does not exist in type '{ multiple?: boolean | undefined; excludeAcceptAllOption?: boolean | undefined; accepts?: any[] | undefined; _preferPolyfill?: boolean | undefined; }'.ts(2345)
Sorry, something went wrong.
showSaveFilePicker
No branches or pull requests
In example in readme
Error in ` types: [
"native-file-system-adapter": "^3.0.0",
The text was updated successfully, but these errors were encountered: