Trilium Electron API
    Preparing search index...

    Interface ElectronDialogApi

    Native OS pickers that hand the renderer a location the user chose themselves.

    interface ElectronDialogApi {
        confirmStartOver(): Promise<boolean>;
        pickDirectory(
            opts?: { defaultPath?: string },
        ): Promise<NativeDirectoryPickResult>;
    }
    Index
    • Prompts a native message box before the application restarts into the setup screen, where the user may replace or erase their knowledge base.

      An OS dialog rather than one of the application's own, for the reason the security toggles use one: a note script can reach every dialog the app draws for itself, and this one guards the path to losing everything. It is never suppressible, so there is no "don't ask again" here.

      Returns Promise<boolean>

    • Prompts a native "select folder" dialog, starting at defaultPath when it is given. The renderer cannot supply the answer: a script can at most pop the dialog, which the user still has to accept before any path comes back.

      Parameters

      • Optionalopts: { defaultPath?: string }

      Returns Promise<NativeDirectoryPickResult>