SaveDialogResult
The result of a file save dialog.
import { SaveDialogResult } from '@mobrowser/api';
Example
import { app, SaveDialogResult } from '@mobrowser/api';
const result: SaveDialogResult = await app.showSaveDialog({
title: 'Save File',
defaultPath: '/Users/john/Desktop',
filters: [{ name: 'Text Files', extensions: ['txt'] }]
})
if (!result.canceled) {
console.log('Save to:', result.path)
}
Properties
path
readonly path: FilePath;
The path that was selected. If the dialog was canceled, this will be an empty string.
canceled
readonly canceled: boolean;
Whether the dialog was canceled.