Trilium Electron API
    Preparing search index...

    Interface ElectronWindowApi

    Window-level controls: zoom, theme, title bar, full screen, lifecycle, and a handful of main → renderer event subscriptions.

    interface ElectronWindowApi {
        clearCache(): Promise<void>;
        closeWindow(): void;
        createExtraWindow(extraWindowHash: string): void;
        getZoomFactor(): number;
        isAlwaysOnTop(): boolean;
        isFullScreen(): boolean;
        isMaximized(): boolean;
        maximizeWindow(): void;
        minimizeWindow(): void;
        onEnterFullScreen(callback: () => void): void;
        onGlobalShortcut(callback: (actionName: string) => void): void;
        onLeaveFullScreen(callback: () => void): void;
        onOpenInSameTab(callback: (noteId: string) => void): void;
        reloadAllWindows(): void;
        restartApp(): void;
        setAlwaysOnTop(enabled: boolean): void;
        setBackgroundMaterial(material: string): void;
        setFullScreen(enabled: boolean): void;
        setNativeThemeSource(source: "system" | "light" | "dark"): void;
        setTitleBarOverlay(options: { color: string; symbolColor: string }): void;
        setVibrancy(vibrancy: string): void;
        setWindowButtonPosition(position: { x: number; y: number }): void;
        setZoomFactor(factor: number): void;
        showWindow(): void;
        toggleAllWindows(): void;
        toggleDevTools(): void;
        unmaximizeWindow(): void;
    }
    Index

    Methods

    • Clears the underlying Chromium HTTP cache. Resolves once the cache is empty.

      Returns Promise<void>

    • Closes the current window.

      Returns void

    • Opens a new top-level Trilium window navigated to the given hash route.

      Parameters

      • extraWindowHash: string

        The URL hash fragment (without the leading #) for the new window.

      Returns void

    • Returns the current page zoom factor (1.0 = 100%).

      Returns number

    • Synchronously returns whether the window is pinned above all others.

      Returns boolean

    • Synchronously returns whether the window is currently in full-screen mode.

      Returns boolean

    • Synchronously returns whether the window is currently maximized.

      Returns boolean

    • Maximizes the current window to fill the available screen area.

      Returns void

    • Minimizes the current window to the taskbar / dock.

      Returns void

    • Registers a callback fired whenever the window enters full-screen mode.

      Parameters

      • callback: () => void

      Returns void

    • Subscribes to globally registered keyboard shortcuts. The callback receives the logical action name (not the keystroke).

      Parameters

      • callback: (actionName: string) => void

      Returns void

    • Registers a callback fired whenever the window leaves full-screen mode.

      Parameters

      • callback: () => void

      Returns void

    • Subscribes to "open note in active tab" requests originating from outside the renderer (e.g. tray menu, deep links).

      Parameters

      • callback: (noteId: string) => void

      Returns void

    • Triggers a hard reload of every open Trilium window.

      Returns void

    • Quits the app and immediately relaunches it.

      Returns void

    • Toggles the always-on-top (pinned) state of the window.

      Parameters

      • enabled: boolean

      Returns void

    • Sets the Windows 11 backdrop material (e.g. "mica", "acrylic", "tabbed", "none") applied behind the window contents. No-op on other platforms.

      Parameters

      • material: string

      Returns void

    • Enters or leaves full-screen mode.

      Parameters

      • enabled: boolean

      Returns void

    • Overrides the operating system's reported color scheme for this app. Use "system" to follow the OS setting.

      Parameters

      • source: "system" | "light" | "dark"

      Returns void

    • Customizes the colors of the Windows native title bar overlay (the area containing the minimize / maximize / close buttons).

      Parameters

      • options: { color: string; symbolColor: string }

      Returns void

    • Sets the macOS vibrancy effect (e.g. "sidebar", "under-window", "fullscreen-ui") applied behind the window contents. No-op on other platforms.

      Parameters

      • vibrancy: string

      Returns void

    • Repositions the macOS traffic-light window buttons. Coordinates are in CSS pixels relative to the window's top-left corner.

      Parameters

      • position: { x: number; y: number }

      Returns void

    • Sets the page zoom factor for the current window.

      Parameters

      • factor: number

        1.0 is 100%; e.g. 1.2 zooms to 120%.

      Returns void

    • Brings the main window to the foreground, restoring it if minimized.

      Returns void

    • Shows all hidden windows or hides all visible ones — used by the "show/hide app" global shortcut and tray menu entry.

      Returns void

    • Opens or closes Chromium DevTools for the current window.

      Returns void

    • Restores the window from a maximized state to its previous size.

      Returns void