Skip to content

@jakguru/vueprint / @jakguru/vueprint/utilities/files

Module: @jakguru/vueprint/utilities/files

Classes

Interfaces

Functions

showOpenFilePicker

showOpenFilePicker(options?): Promise<FileSystemFileHandle[]>

The showOpenFilePicker() method shows a file picker that allows a user to select a file or multiple files and returns a handle for the file(s). This function polyfills the missing functionality if the browser does not support window.showOpenFilePicker() natively.

Parameters

NameTypeDescription
options?FilePickerOptionsThe options for the file picker

Returns

Promise<FileSystemFileHandle[]>

A Promise that resolves with an array of FileSystemFileHandle objects

See

https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker

Defined in

src/utilities/files.ts:96


showSaveFilePicker

showSaveFilePicker(options?): Promise<FileSystemFileHandle | { getFile: () => Promise<Blob> ; kind: string = 'file'; name: string = opts.suggestedName; createWritable: () => Promise<{ close: () => Promise<void> ; write: (content: any) => Promise<void> }> }>

The showSaveFilePicker() method shows a file picker that allows a user to save a file either by selecting an existing file or entering a name for a new file. This function polyfills the missing functionality if the browser does not support window.showSaveFilePicker() natively.

Parameters

NameTypeDescription
options?SaveFilePickerOptionsThe options for the file picker

Returns

Promise<FileSystemFileHandle | { getFile: () => Promise<Blob> ; kind: string = 'file'; name: string = opts.suggestedName; createWritable: () => Promise<{ close: () => Promise<void> ; write: (content: any) => Promise<void> }> }>

A Promise that resolves with a FileSystemFileHandle object that includes a getFile() method to retrieve the Blob.

See

https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker

Defined in

src/utilities/files.ts:184

Vueprint is a commercial work product released under the MIT License and is provided as-is with no warranty or guarantee of support.