Skip to content

save

Module @netwiv/api/plugins/dialog · Kind Function

import { save } from '@netwiv/api/plugins/dialog';

Open a file/directory save dialog.

The selected path is added to the filesystem and asset protocol scopes. When security is more important than the easy of use of this API, prefer writing a dedicated command instead.

Note that the scope change is not persisted, so the values are cleared when the application is restarted. You can save it to the filesystem using tauri-plugin-persisted-scope.

function save(options?: SaveDialogOptions | undefined): Promise<string | null>
import { save } from '@netwiv/api/plugins/dialog';
const filePath = await save({
filters: [{
name: 'Image',
extensions: ['png', 'jpeg']
}]
});

Upstream since 2.0.0


Descriptions come from the pinned @tauri-apps/plugin-dialog@2.7.3 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.