Skip to content

@jsvision/files / FileDialogOptions

Interface: FileDialogOptions ​

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

Construction options for FileDialog.

Properties ​

directory? ​

optional directory?: Signal<string>

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

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:57

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


filter? ​

optional filter?: (entry) => boolean

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

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:51

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


historyId? ​

optional historyId?: number

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

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


i18n? ​

optional i18n?: I18n

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

Translation service for package-owned labels; defaults to an isolated English service.


inputName? ​

optional inputName?: string

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

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:73

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:59

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:71

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:63

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:55

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