Skip to content

@jsvision/files / FileDialogOptions

Interface: FileDialogOptions

Defined in: files/src/dialog/file-dialog.ts:31

Construction options for FileDialog.

Properties

directory?

optional directory?: Signal<string>

Defined in: files/src/dialog/file-dialog.ts:35

The current directory (default the filesystem's cwd). Shared with the listing and info pane.


filename?

optional filename?: Signal<string>

Defined in: files/src/dialog/file-dialog.ts:39

The filename field value (default an internal empty signal).


filter?

optional filter?: (entry) => boolean

Defined in: files/src/dialog/file-dialog.ts:47

An extra predicate AND-ed with the wildcard when listing files.

Parameters

entry

DirEntry

Returns

boolean


fs?

optional fs?: FileSystem

Defined in: files/src/dialog/file-dialog.ts:33

The filesystem to read and write through (default nodeFileSystem).


historyId?

optional historyId?: number

Defined in: files/src/dialog/file-dialog.ts:49

The id keying this dialog's recent-path history (default a file-dialog id distinct from chdir).


inputName?

optional inputName?: string

Defined in: files/src/dialog/file-dialog.ts:43

The filename label text (default '~N~ame'; wrap the hotkey letter in tildes).


onResolve?

optional onResolve?: (path) => void

Defined in: files/src/dialog/file-dialog.ts:53

Called when the dialog resolves — with the chosen absolute path, or null on cancel.

Parameters

path

string | null

Returns

void


save?

optional save?: boolean

Defined in: files/src/dialog/file-dialog.ts:41

Save mode — shows the OK/Replace/Clear/Cancel/Help strip instead of Open/Cancel/Help.


showError?

optional showError?: (message) => void

Defined in: files/src/dialog/file-dialog.ts:51

Called to show an error (bad filename / directory). Wire it to errorBox in an app.

Parameters

message

string

Returns

void


title?

optional title?: string

Defined in: files/src/dialog/file-dialog.ts:45

The dialog title (default 'Open a File', or 'Save File As' in save mode).


wildcard?

optional wildcard?: Signal<string>

Defined in: files/src/dialog/file-dialog.ts:37

The file wildcard (default '*.*').