/** Native capabilities available to trusted Murasaki renderer code. */ export interface DialogFilter { name: string; extensions: string[]; } export interface OpenFileOptions { title?: string; defaultPath?: string; filters?: DialogFilter[]; multiple?: boolean; } export interface SaveFileOptions { title?: string; defaultPath?: string; defaultName?: string; filters?: DialogFilter[]; } export interface NotificationOptions { title: string; body?: string; icon?: string; sound?: boolean; } export interface MessageDialogOptions { title?: string; message: string; level?: 'info' | 'warning' | 'error'; buttons?: 'ok' | 'okCancel' | 'yesNo'; } export type MessageDialogResult = 'ok' | 'cancel' | 'yes' | 'no'; export type AutostartStatus = 'enabled' | 'disabled'; export interface ClipboardImageData { width: number; height: number; pngBase64: string; } export type SystemPermissionName = 'camera' | 'microphone' | 'screenRecording' | 'accessibility' | 'inputMonitoring' | 'location' | 'fullDiskAccess' | 'photos' | 'contacts' | 'calendar' | 'reminders' | 'speechRecognition' | 'bluetooth' | 'appleEvents' | 'localNetwork'; export type SystemPermissionStatus = 'granted' | 'denied' | 'restricted' | 'notDetermined' | 'notGranted' | 'unsupported' /** * Returned by kinds with no real TCC query: `fullDiskAccess`'s heuristic * status check could not be performed, or `appleEvents`/`localNetwork` * (which have no query API at all — see `MacOSDeclarationOnlyPermissionConfig`). */ | 'unknown'; export interface TrayOptions { /** Tooltip shown by the host OS. */ tooltip?: string; /** 8-bit RGB/RGBA PNG. Defaults to `config.icon`. */ icon?: string; /** macOS: render the icon as a monochrome template image. */ template?: boolean; /** Native status-item/system-tray menu. Clickable entries require unique ids. */ menu?: TrayMenuItem[]; /** Show the native menu on left click. Host default is true. */ menuOnLeftClick?: boolean; /** Show the native menu on right click. Host default is true. */ menuOnRightClick?: boolean; } export type TrayMenuItem = { id: string; label: string; enabled?: boolean; accelerator?: string; } | { label: string; enabled?: boolean; submenu: TrayMenuItem[]; } | { separator: true; }; export interface TrayClickEvent { button: 'left' | 'right' | 'middle'; double: boolean; } /** Resolved process-wide shortcut identity returned by registration/events. */ export interface GlobalShortcutRegistration { id: string; /** Platform-resolved canonical accelerator (for example `Control+Shift+KeyK`). */ accelerator: string; } /** Serializable state returned for each declared native window. */ export interface WindowInfo { label: string; primary: boolean; visible: boolean; focused: boolean; minimized: boolean; maximized: boolean; } /** One OS display, as returned by `appWindow.getMonitors()`. Geometry is in * physical pixels — divide by `scaleFactor` for logical/CSS pixels. */ export interface WindowMonitorInfo { name: string | null; isPrimary: boolean; isCurrent: boolean; x: number; y: number; width: number; height: number; scaleFactor: number; } export declare const app: { /** Request graceful application shutdown through the native host. */ quit(): Promise; /** * Read-only, best-effort query of whether the native host process is * already running elevated. On Windows this reflects the process token's * elevation state; on macOS/Linux "elevated" means effective root (rare * and discouraged for a GUI app) — never fails, so a query that can't * determine elevation just resolves `false`. Requires `app:isElevated`. */ isElevated(): Promise; }; /** Per-user login autostart for packaged applications. Development calls are * rejected so `murasaki dev` can never persist the Node executable. */ export declare const autostart: { /** Returns whether the exact current packaged executable is registered. */ status(): Promise; /** Registers the current packaged application for login startup. */ enable(): Promise; /** Removes this application's per-user login startup registration. */ disable(): Promise; }; export declare const dialog: { openFile(options?: OpenFileOptions): Promise; openDirectory(options?: Omit): Promise; saveFile(options?: SaveFileOptions): Promise; /** Native message box. Defaults to an info-level dialog with a single OK button. */ showMessage(options: MessageDialogOptions): Promise; }; export declare const clipboard: { readText(): Promise; writeText(text: string): Promise; /** Reads the clipboard's image, PNG-encoded, or null when it holds no image. */ readImage(): Promise; /** Writes a PNG (base64-encoded) to the clipboard as an image. */ writeImage(image: { pngBase64: string; }): Promise; /** Writes HTML, with an optional plain-text fallback, to the clipboard. */ writeHtml(html: { html: string; altText?: string; }): Promise; }; export declare const notification: { /** Shows a system notification and returns a generated id for local bookkeeping. * Upstream notify-rust cannot deliver click/action callbacks on macOS or Windows, * so this id does not correlate with any later event. */ show(options: NotificationOptions): Promise; }; export interface RunElevatedOptions { /** Absolute, non-traversing path to an existing executable. */ executable: string; /** Optional command-line arguments, passed directly — never through a shell. */ args?: string[]; } export declare const shell: { openExternal(target: string): Promise; showItemInFolder(target: string): Promise; /** Moves an existing absolute, non-traversing path to the OS trash/recycle bin. */ trashItem(path: string): Promise; /** Opens an existing local file/directory with the OS default handler. Paths * only — URLs and UNC/device paths are rejected; use `shell.openExternal` for URLs. */ openPath(path: string): Promise; /** * Launches `executable` elevated through the Windows UAC "runas" verb — * Windows only, every other platform rejects with an `unsupported` error. * `executable` must be an absolute, non-traversing path to an existing * file. A structured `shell:runElevated` capability scope matches the * executable and exact argument list together. `args` are passed directly (never * through a shell) and are bounded to 64 entries of at most 4096 UTF-8 * bytes each. Fire-and-forget: resolves once the elevated process has * launched, not when it exits. * * If the user declines the UAC consent prompt, this rejects with an error * whose message is exactly `"elevation was cancelled by the user"`, so * callers can handle a declined prompt distinctly from every other * failure. Requires `shell:runElevated`. */ runElevated(options: RunElevatedOptions): Promise; }; /** OS credential storage, namespaced by `config.appId`. */ export declare const secureStorage: { /** Read a UTF-8 string, or null when the key does not exist. */ get(key: string): Promise; /** Create or replace a UTF-8 string value. */ set(key: string, value: string): Promise; /** Delete a value. Deleting an absent key succeeds. */ delete(key: string): Promise; }; /** Host OS consent, separate from Murasaki renderer capabilities. */ export declare const systemPermission: { status(permission: SystemPermissionName): Promise; request(permission: SystemPermissionName): Promise; }; export declare const appWindow: { getLabel(): Promise; setTitle(title: string): Promise; setSize(width: number, height: number): Promise; minimize(): Promise; toggleMaximize(): Promise; show(): Promise; hide(): Promise; focus(): Promise; close(): Promise; setAlwaysOnTop(enabled: boolean): Promise; isVisible(): Promise; isFocused(): Promise; isMaximized(): Promise; isMinimized(): Promise; /** * Starts an OS window drag from a custom (frameless) titlebar region. Call * on primary-button pointerdown — see `useWindowDrag()` for the typical * caller. Resolves silently even when the native drag could not start (for * example outside an active mouse-down); that failure is not surfaced. */ startDragging(): Promise; /** Enters/exits borderless fullscreen on the window's current monitor. */ setFullscreen(fullscreen: boolean): Promise; isFullscreen(): Promise; /** Sets the maximum inner size. Both `width`/`height` omitted or `null` * clears the bound; a single axis is rejected — provide both or neither. */ setMaxSize(size?: { width?: number | null; height?: number | null; }): Promise; /** Every OS display visible to this window, in physical pixels. */ getMonitors(): Promise<{ monitors: WindowMonitorInfo[]; }>; }; /** Controls windows declared in `murasaki.config.*` by label. */ export declare const windows: { open(label: string): Promise; list(): Promise; show(label: string): Promise; hide(label: string): Promise; focus(label: string): Promise; close(label: string): Promise; }; /** Process-wide keyboard shortcuts owned by the renderer that registers them. */ export declare const globalShortcut: { /** Register a modifier + known-key chord. The optional id must be process-unique. */ register(accelerator: string, id?: string): Promise; /** Unregister one shortcut owned by this renderer. */ unregister(id: string): Promise; /** Unregister every shortcut owned by this renderer. */ unregisterAll(): Promise; /** Subscribe to presses for shortcuts owned by this renderer. */ onTriggered(listener: (event: GlobalShortcutRegistration) => void): () => void; }; export declare const tray: { create(options?: TrayOptions): Promise; remove(): Promise; setTooltip(text: string): Promise; setIcon(icon: string): Promise; setMenu(items: TrayMenuItem[]): Promise; onClick(listener: (event: TrayClickEvent) => void): () => void; onMenuItem(listener: (id: string) => void): () => void; }; /** A cookie as returned by `webview.getCookies()`. The legacy reserved * `murasaki_runtime` name is always filtered out and never appears here. */ export interface WebviewCookie { name: string; value: string; domain: string | null; path: string | null; secure: boolean; httpOnly: boolean; /** Unix epoch milliseconds, or absent for a session cookie. */ expiresAt?: number; } export interface WebviewSetCookieOptions { /** Absolute http/https URL the cookie applies to. */ url: string; name: string; value: string; /** Defaults to the URL's host. When provided it must match that host exactly * (a leading dot is ignored); parent-domain cookies are intentionally rejected. */ domain?: string; /** Defaults to `/`. Must start with `/`, contain no controls or semicolon, * and remain within any structured `webview:writeCookies` URL scope. */ path?: string; secure?: boolean; httpOnly?: boolean; /** Unix epoch milliseconds. Omitted creates a session cookie. */ expiresAt?: number; } /** WebView content features: cookies, page zoom, and printing. */ export declare const webview: { /** Reads the WebView's cookies, optionally scoped to `url`. Capped at 1000 * entries with each value truncated at 4 KiB. The murasaki runtime's own * reserved runtime cookie name is never included. Requires * `webview:readCookies`. */ getCookies(options?: { url?: string; }): Promise<{ cookies: WebviewCookie[]; }>; /** Creates or replaces a cookie. Requires `webview:writeCookies`. Rejects * the legacy reserved murasaki runtime cookie name. */ setCookie(options: WebviewSetCookieOptions): Promise; /** Deletes a cookie (matched by name, the URL's host as domain, and the * default `/` path). Requires `webview:writeCookies`. Rejects the murasaki * legacy reserved runtime cookie name. */ deleteCookie(options: { url: string; name: string; }): Promise; /** Sets the page zoom factor, from 0.25 to 5.0 inclusive. Requires * `webview:zoom`. */ setZoom(factor: number): Promise; /** Opens the native print dialog for the current page. Requires * `webview:print`. */ print(): Promise; }; //# sourceMappingURL=index.d.ts.map