目录

SaveDialogOptions

Options for opening a file save dialog.

Example 

import { app } from '@mobrowser/api';

const win = app.createWindow()
const result = await app.showSaveDialog({
  parentWindow: win,
  title: 'Save File',
  defaultPath: '/Users/john/Desktop',
  filters: [{ name: 'Text Files', extensions: ['txt'] }],
  features: {
    canCreateDirectories: true,
    showHiddenFiles: true
  }
})

Properties 

parentWindow 

readonly parentWindow?: BrowserWindow;

The parent window of the dialog. If provided, the dialog will be modal relative to the parent window. Otherwise, the dialog will be modal relative to the application.

title 

readonly title?: string;

The title of the dialog.

message 

readonly message?: string;

The message to be displayed above the input boxes on macOS.

buttonLabelSave 

readonly buttonLabelSave?: string;

The custom label for the dialog’s confirmation button.

defaultPath 

readonly defaultPath?: FilePath;

The path to the directory or file to save by default.

filters 

readonly filters?: FileFilter[];

The file filters to apply to the dialog.

features 

readonly features?: SaveDialogFeatures;

The features of the dialog that can be used to customize its behavior.