import { type DesktopBridge, type DesktopCapability, type DesktopPlatform } from "@opengeni/sdk/desktop-bridge"; export declare const desktopBridge: DesktopBridge | null; /** * The name a window this app opens without an opener handle carries * (`openBlankTab`), so its page still knows it is not the app's own window. */ export declare const OPENED_WINDOW_NAME = "opengeni-opened-window"; /** * The platform of the Opengeni desktop app from its user agent, which * Electron writes as `… Opengeni/ Chrome/… Electron/ …`; * null anywhere else, including other Electron apps. */ export declare function desktopPlatformFromUserAgent(userAgent: string): DesktopPlatform | null; /** The desktop app's version from its user agent (`Opengeni/`), or null. */ export declare function desktopAppVersionFromUserAgent(userAgent: string): string | null; /** The parts of a window that decide whether it is the desktop app's own. */ export type DesktopWindowView = { opener: unknown; top: unknown; name: string; navigator: { userAgent: string; }; }; /** * The desktop app's platform in a window. The bridge says so; without it (a * page the shell's preload didn't reach) the app's user agent still does, so * the page keeps room for the native window controls drawn over it. * Capabilities come only from the bridge. A window the page opened (sign-in * and connect flows, `openBlankTab`) has the system title bar and no bridge, * so it keeps the web layout; so does a page in a frame. */ export declare function desktopPlatformIn(bridge: DesktopBridge | null, view: DesktopWindowView): DesktopPlatform | null; /** The desktop app's platform for this page; see `desktopPlatformIn`. */ export declare const desktopPlatform: DesktopPlatform | null; /** * Count once when the page is the desktop app's own window by its user agent * but the shell's bridge is missing, so we learn how often and where that * happens. Call after the client signal reporter is installed; while the page * loads, pass the pattern of the route the router is loading, since the * route it shows is not resolved yet. */ export declare function reportMissingDesktopBridge(routePattern?: () => string): void; /** * Whether the page runs in the macOS app. * @deprecated The desktop window bar now holds the window controls above the * page, so no page layout needs to make room for them. */ export declare const windowControlsInPage: boolean; export declare function desktopCapability(capability: DesktopCapability): DesktopBridge | null; /** * Marks the console's API requests inside the desktop app, so a sign-in that * finishes in the person's browser brings them back to the app. */ export declare function desktopAppHeaders(): Record; declare global { interface Window { /** The shell calls this to move the app to a path without a reload. */ __opengeniDesktopNavigate?: ((path: string) => void) | undefined; } } /** * How far down the macOS window the traffic lights' centre is, in CSS pixels * at the page's zoom, or null for other platforms (and without the bridge, * where the page keeps the current shell's 22px). The sidebar toggle and a * chat's header are centred on this line, so they line up with the lights. * The shell centres the lights on its window bar (`windowBarHeight`); shells * that don't report it (0.1.33 and older) centre them on a 56px row. */ export declare function desktopWindowControlsCentre(bridge: DesktopBridge | null): number | null; /** * Tells the page where the traffic lights' centre line is * (`--og-window-controls-center`) and its zoom (`--og-window-zoom`), so the * window bar's controls keep their place in the window beside the lights; * kept up to date when the page zooms (which resizes its viewport). See * `desktopWindowControlsCentre`. */ export declare function applyDesktopWindowBar(root: HTMLElement, bridge: DesktopBridge | null): void; /** * Before the first render: mark the document so the desktop layout applies * from the first frame (the window bar for the window controls, draggable title areas, * window materials), and let the shell navigate client-side. */ export declare function installDesktopShell(navigate: (path: string) => void): void; /** * The desktop app is one long-lived window: once it is idle after opening, * fetch the code for the pages people move between, so the first visit to * each one renders at once instead of showing a loading state. */ export declare function warmDesktopPages(pages: readonly { preload?: (() => unknown) | undefined; }[]): void; /** * The page found itself signed out inside the desktop app. The app is still * signed in, so it renews the window's web sign-in and the page reloads. At * most once a minute, so a server that keeps refusing can't loop the page. */ export declare function restoreDesktopWebSession(): Promise;