foo-webview-sdk
    Preparing search index...

    Variable dialogConst

    dialog: {
        confirm: (opts?: DialogConfirmParams) => Promise<DialogConfirmResponse>;
        openFile: (opts?: DialogOpenFileParams) => Promise<DialogOpenFileResponse>;
        openFolder: (
            opts?: DialogOpenFolderParams,
        ) => Promise<DialogOpenFolderResponse>;
        saveFile: (opts?: DialogSaveFileParams) => Promise<DialogSaveFileResponse>;
    } = ...

    dialog — file/folder pickers + confirm/prompt.

    Type Declaration

    • confirm: (opts?: DialogConfirmParams) => Promise<DialogConfirmResponse>

      Shows a modal confirmation dialog.

      Resolves with { response }, the zero-based index of the clicked button in buttons. The default button set is ['OK', 'Cancel'], so 0 means confirmed and 1 means cancelled - there is no confirmed flag. The task dialog is created without TDF_ALLOW_DIALOG_CANCELLATION, so Escape and the close button do not dismiss it and every result comes from an actual button click. -1 appears only on the host's fallback path, when even a plain message box could not be shown.

    • openFile: (opts?: DialogOpenFileParams) => Promise<DialogOpenFileResponse>

      Resolves with { success: true, canceled, filePaths }; filePaths is empty when cancelled. When the dialog cannot be shown at all it resolves with the failure envelope { success: false, error, code } instead.

    • openFolder: (opts?: DialogOpenFolderParams) => Promise<DialogOpenFolderResponse>

      Resolves like openFile, with folderPath (empty when cancelled) in place of filePaths.

    • saveFile: (opts?: DialogSaveFileParams) => Promise<DialogSaveFileResponse>

      Resolves like openFile, with filePath (empty when cancelled) in place of filePaths.