import { BurdenoffDesktopBridge, DesktopNotification, DesktopPlatform, DesktopQuickAction, DesktopRuntimeConfig, DesktopThemeOptions, DesktopTitlebarMode, DesktopUpdateState, DesktopWindowState } from './types'; import { GatewayBases } from '../utils/gatewayFetchRewrite'; import { RuntimeGatewayUrls } from '../config/gatewayUrls'; import { RuntimeAuthBridgeConfig } from '../config/authBridgeUrls'; /** Legacy per-product preload global (`window.Electron`). */ export interface LegacyDesktopRuntime { isElectron?: boolean; platform?: string; versions?: { electron?: string; chrome?: string; }; runtimeConfig?: DesktopRuntimeConfig; onDeepLink?: (callback: (url: string) => void) => unknown; openExternal?: (url: string) => Promise | boolean; } export interface BootDesktopShellOptions { /** Router navigate used for deep links + tray/menu navigation. */ navigate?: (path: string) => void; /** Tray / dock quick actions to publish once the bridge is up. */ quickActions?: DesktopQuickAction[]; /** Explicit legacy preload key (defaults to auto-discovery). */ electronGlobalKey?: string; } export interface DesktopShellHandle { isDesktop: boolean; platform?: DesktopPlatform; titlebar?: DesktopTitlebarMode; } /** The `@burdenoff/desktop-shell` preload bridge, or null on web. */ export declare function getDesktopBridge(): BurdenoffDesktopBridge | null; /** * Legacy `window.Electron` runtime. The product key is unknown to * fe-libs, so `window` is scanned ONCE for a `*Electron` global and the result * cached (a full scan on every call would be wasteful in hot paths such as * `resolveGatewayUrls()`). */ export declare function getLegacyDesktopRuntime(globalKey?: string): LegacyDesktopRuntime | null; /** Reset the cached legacy-global lookup (tests / late preload injection). */ export declare function resetDesktopBridgeCache(): void; /** True when running inside a desktop shell (new bridge or legacy preload). */ export declare function isDesktop(): boolean; /** Baked desktop runtime config (bridge first, then the legacy preload). */ export declare function getDesktopRuntimeConfig(): DesktopRuntimeConfig | null; /** Gateway bases from the desktop runtime config, or null on web. */ export declare function getDesktopGatewayBases(): GatewayBases | null; /** Gateway URLs from the desktop runtime config, or null on web. */ export declare function getDesktopGatewayUrls(): RuntimeGatewayUrls | null; /** * Auth bridge config baked into the desktop build, if any. * * NOTE: shells must NOT initialise the cross-TLD iframe bridge in Electron — * see `resolveShellAuthBridgeConfig()` in `shared/config/authBridgeUrls.ts`, * which returns `undefined` on desktop. This accessor exists for tooling and * diagnostics that want to see the baked value. */ export declare function getDesktopAuthBridgeConfig(): RuntimeAuthBridgeConfig | null; /** * Open an http/https/mailto URL in the user's default browser. Falls back to * `window.open` on web so callers never need to branch. */ export declare function desktopOpenExternal(url: string): Promise; /** * Show an OS notification. On desktop this goes through the shell (so clicks * can focus the window / route). On web it uses the browser Notification API * ONLY when permission was already granted — it never prompts. */ export declare function desktopNotify(notification: DesktopNotification): Promise; /** Dock / taskbar badge count. Uses the PWA badging API when not on desktop. */ export declare function desktopSetBadgeCount(count: number): Promise; /** Tell the desktop shell which color scheme + background the UI is using. */ export declare function desktopSetTheme(theme: DesktopThemeOptions): void; /** Publish tray / dock quick actions. */ export declare function desktopSetTrayQuickActions(actions: DesktopQuickAction[]): void; /** Tell the desktop shell which locale the UI switched to (menus, tray). */ export declare function desktopSetLocale(locale: string): void; export declare const DESKTOP_UPDATE_UNSUPPORTED: DesktopUpdateState; /** Subscribe to auto-update state changes. Returns an unsubscribe fn. */ export declare function onDesktopUpdateState(cb: (state: DesktopUpdateState) => void): () => void; export declare function getDesktopUpdateState(): Promise; export declare function desktopCheckForUpdates(): Promise; /** Quit and install a downloaded update. No-op on web. */ export declare function desktopInstallUpdate(): Promise; type DesktopNavigator = (path: string) => void; /** * Register the router navigate fn. Routes that arrived before the router * mounted (cold-start deep links) are flushed immediately. */ export declare function registerDesktopNavigator(navigate: DesktopNavigator): () => void; /** * Convert a deep-link URL to an in-app path. * * `vibecontrols://app/agents?tab=logs` → `/agents?tab=logs` * `https://app.vibecontrols.com/agents` → `/agents` * Already-relative values pass through unchanged. */ export declare function desktopDeepLinkToPath(rawUrl: string): string | null; /** * Subscribe to OS deep links (`://app/...` and universal links). * Returns an unsubscribe fn. */ export declare function installDesktopDeepLinkHandler(onPath: (path: string) => void): () => void; /** Subscribe to in-app routes pushed by the shell (tray, menu, jump list). */ export declare function installDesktopNavigateHandler(onRoute: (route: string) => void): () => void; export declare const DESKTOP_WINDOW_STATE_DEFAULT: DesktopWindowState; export declare function getDesktopWindowState(): DesktopWindowState; /** Subscribe to window focus / fullscreen / maximize changes. */ export declare function onDesktopWindowState(cb: (state: DesktopWindowState) => void): () => void; /** * Boot the desktop renderer integration. Idempotent — repeat calls only merge * newly supplied options (navigate / quick actions). * * DOM contract (see `shared/styles/native.css` section 6): * `html[data-desktop-platform="darwin|win32|linux"]` * `html[data-desktop-titlebar="hidden-inset|native"]` * `html[data-desktop-fullscreen|data-desktop-focused|data-desktop-maximized]` * `body.platform-desktop` */ export declare function bootDesktopShell(opts?: BootDesktopShellOptions): DesktopShellHandle; /** Reset boot state (tests only). */ export declare function resetDesktopShellBootState(): void; export {}; //# sourceMappingURL=desktop.d.ts.map