import { ChildProcess } from 'child_process';
export declare class MessageBoxHandle {
    readonly result: Promise<MessageBoxResult>;
    readonly pid: number | undefined;
    private child;
    private _closed;
    constructor(child: ChildProcess, resultPromise: Promise<MessageBoxResult>);
    close(): boolean;
    get closed(): boolean;
}
export declare function closeMessageBox(pid: number): boolean;
export interface MessageBoxOptions {
    title?: string; /** The title text displayed in the window title bar */
    message?: string; /** The plain text message to display (optional if url or html is provided) */
    html?: string; /** HTML content to display in the message box */
    url?: string; /** URL to load external content (web URL or file path) */
    hash?: string; /** Hash fragment to append to URL (requires url to be set). Leading # is optional. */
    rawHtml?: boolean; /** When true with html, load HTML as-is (no msger template wrapper, no buttons). Used by mdview. */
    size?: {
        width: number; /** Window width */
        height: number; /** Window height */
    };
    pos?: {
        x: number; /** Window X position in pixels */
        y: number; /** Window Y position in pixels */
        screen?: number; /** Optional screen index (0-based, Windows only) - NOT used by Rust binary */
    };
    zoom?: number; /** Initial zoom level as percentage (100=100%, 150=150%, 50=50%, etc.) */
    autoSize?: boolean; /** Automatically resize window to fit content (default: false) */
    alwaysOnTop?: boolean; /** Keep window on top of other windows (default: false) */
    buttons?: string[]; /** Array of button labels to display (default: ['OK']) */
    defaultValue?: string; /** Default value for input field when allowInput is true */
    inputPlaceholder?: string; /** Placeholder text (gray hint) shown in input field */
    allowInput?: boolean; /** Enable an input field in the message box (default: false) */
    timeout?: number; /** Auto-close the message box after specified seconds */
    detach?: boolean; /** Launch the message box detached from parent process */
    fullscreen?: boolean; /** Start window in fullscreen mode (F11 to toggle, Escape to exit) */
    escapeCloses?: boolean; /** Allow Escape key to close window (default: true). Always exits fullscreen first. */
    reset?: boolean; /** Clear localStorage on startup (default: false) */
    icon?: string; /** Path to window icon. Decoded for the runtime title-bar / taskbar icon. PNG decodes most reliably; the `image` crate's ICO+PNG path is fragile. */
    relaunchIcon?: string; /** Optional path forwarded to `PKEY_AppUserModel_RelaunchIconResource` so pinned taskbar shortcuts get the app's own icon. Must be a `.ico`. Path is consumed verbatim (no decode). */
    relaunchCommand?: string; /** Command Windows runs when the user clicks the pinned shortcut (`PKEY_AppUserModel_RelaunchCommand`). Critical for msger-hosted apps: without it, the pin captures the bare `mailx.exe` (a webview host that expects JSON stdin) and clicking it does nothing. */
    relaunchDisplayName?: string; /** Display name for the pinned shortcut (`PKEY_AppUserModel_RelaunchDisplayNameResource`). */
    dev?: boolean; /** Open DevTools automatically on startup (default: false) */
    debug?: boolean; /** Return debug information (HTML, size) in result (default: false) */
    showVersion?: boolean; /** Show version in window title (default: false) */
    appUserModelId?: string; /** Windows AppUserModelID for taskbar pinning (internal use) */
    aumid?: string; /** Same as appUserModelId — short name for callers (forwarded to Rust) */
    initScript?: string; /** Custom JS injected into WebView alongside msger-api.js (inline) */
    initScriptPath?: string; /** Path to JS file injected into WebView (avoids large JSON) */
    service?: boolean; /** Service mode: bidirectional IPC with parent. Stdin/stdout stay open. */
    contentDir?: string; /** Base directory for custom protocol file serving (avoids file:// URLs) */
    hidden?: boolean; /** Create the window invisible. The WebView still renders so JS / CSS / layout queries (e.g. `getComputedStyle`, `contrast-color()`) resolve; the window just isn't mapped on screen. Set by the CLI's `-noshow` flag. */
}
export interface MessageBoxResult {
    button: string;
    value?: string;
    form?: Record<string, any>;
    closed?: boolean;
    dismissed?: boolean;
    timeout?: boolean;
    debug?: {
        html: string;
        width: number;
        height: number;
        autoSize: boolean;
    };
}
/** Set the app name used for the per-user bin dir AND the per-app exe filename.
 *  Call before showService/showMessageBox — e.g. `setAppName("mailx")` makes
 *  the running process appear as `mailx.exe` in Task Manager and the taskbar. */
export declare function setAppName(name: string): void;
/** Set a per-app icon (PNG or ICO). Copied next to the per-app exe at first
 *  provision so Rust's window icon search picks it up. Per-call `icon` in
 *  `MessageBoxOptions` still takes precedence. */
export declare function setAppIcon(iconPath: string): void;
/**
 * Show a message box dialog using native Rust implementation (extended version)
 * @param options Message box configuration
 * @returns MessageBoxHandle with result promise and control methods
 */
export declare function showMessageBoxEx(options: MessageBoxOptions): MessageBoxHandle;
/**
 * Show a message box dialog using native Rust implementation
 * @param options Message box configuration
 * @returns Promise that resolves with user's response
 */
export declare function showMessageBox(options: MessageBoxOptions): Promise<MessageBoxResult>;
export type ServiceRequestHandler = (request: any) => void;
/** Handle for a service-mode msger instance. Bidirectional IPC with the WebView. */
export declare class ServiceHandle {
    private child;
    private _closed;
    private _onRequest;
    readonly closed: Promise<void>;
    constructor(child: ChildProcess);
    /** Register handler for requests from the WebView (_action messages) */
    onRequest(handler: ServiceRequestHandler): void;
    /** Send a response or event to the WebView (written to child's stdin) */
    send(msg: any): void;
    /** Close the window */
    close(): void;
}
/**
 * Open msger in service mode — bidirectional IPC, no HTTP.
 * Parent process handles requests via onRequest, sends responses via send().
 */
export declare function showService(options: Omit<MessageBoxOptions, "service" | "detach">): ServiceHandle;
