/**
 * Generic tray handle returned by `createTray()`. Same shape regardless
 * of which backend is in use, so callers don't branch on backend type.
 */
export interface TrayHandle {
    /**
     * Update the menu items in place.
     *
     * Native backend: real implementation — atomically swaps the menu
     * the user sees on next click.
     *
     * systray2 backend: best-effort no-op. The legacy backend's
     * stdin-protocol menu update is fragile across the systray2 Go
     * binary's restart/redraw paths, and in practice the standalone
     * settings daemon (the only systray2 user today) never mutates its
     * menu after construction. Don't rely on `setMenu()` taking effect
     * when `backend === "systray2"`; check the field if it matters.
     */
    setMenu(items: TrayItem[]): void;
    /** Replace the tray icon (PNG bytes for native; ICO on Windows for systray2). */
    setIcon(pngBytes: Buffer): void;
    /** Update the hover tooltip. */
    setTooltip(tooltip: string): void;
    /** Tear down the tray. Idempotent. */
    destroy(): void;
    /** Diagnostic label — "native" or "systray2". */
    readonly backend: "native" | "systray2";
}
export interface TrayItem {
    id: string;
    label: string;
    enabled?: boolean;
    separator?: boolean;
}
export interface CreateTrayOptions {
    /**
     * Raw PNG bytes for the icon. The native backend takes this as-is
     * and re-rasters internally for hi-DPI. The systray2 backend on
     * Windows would historically prefer a multi-resolution ICO for
     * crisp DPI scaling — supply that via `iconLegacyOverride` if you
     * need it; otherwise the same PNG is used for both backends and
     * Windows downsamples per the platform's default rules.
     */
    iconPng: Buffer;
    /**
     * Optional override sent to the systray2 backend instead of
     * `iconPng`. Use to ship a Windows multi-resolution ICO (via
     * `makeTrayIconBytes("win32")`) when you care about hi-DPI tray
     * sharpness on the legacy backend. Ignored for the native
     * backend, which only accepts PNG.
     */
    iconLegacyOverride?: Buffer;
    tooltip: string;
    items: TrayItem[];
    /** Called with the activated item's `id` whenever the user clicks. */
    onClick: (id: string) => void;
}
/**
 * Resolve + chmod 0755 the systray2 native binary in both possible
 * locations (package source, runtime cache). Idempotent; no-op on
 * Windows. Returns the source path inside node_modules, or null when
 * systray2 isn't installed / isn't resolvable.
 */
export declare function preflightTrayBinary(platform?: NodeJS.Platform): string | null;
/**
 * MCPs are commonly spawned by GUI clients (Claude Desktop, VS Code)
 * that strip `DISPLAY` / `WAYLAND_DISPLAY` from the child env, even
 * when the user running the client is on a graphical session. Without
 * those variables GTK can't connect to the display server and the
 * tray precondition check bails.
 *
 * This reads the parent's `/proc/<ppid>/environ` on Linux and copies
 * any missing display-related vars into `process.env` so downstream
 * tray initialization can see them. No-op on non-Linux platforms and
 * when the current process already has them.
 *
 * Mutates `process.env` on purpose — GTK reads the vars via getenv()
 * at window-creation time, not via a copy we control. Returns true
 * if anything was inherited.
 */
export declare function inheritDisplayFromParent(platform?: NodeJS.Platform): boolean;
/**
 * Generic, backend-agnostic skip check — returns a one-line DEBUG
 * reason when the host can't show a system tray at all (headless
 * Linux with no X11/Wayland), or null when a tray is feasible.
 *
 * Use this BEFORE calling `createTray()` since it applies regardless
 * of which backend wins. The `systray2`-specific arm64 / x86_64-only
 * concerns live in `systray2PreconditionSkip` below.
 */
export declare function trayPreconditionSkip(platform?: NodeJS.Platform, _arch?: string, env?: NodeJS.ProcessEnv): string | null;
/**
 * systray2-specific skip check. Used by the createTray fallback path
 * to decide whether the systray2 backend is even worth attempting on
 * this host — the native backend may have already covered an arm64
 * platform that systray2 can't.
 */
export declare function systray2PreconditionSkip(platform?: NodeJS.Platform, arch?: string): string | null;
/**
 * Create a system-tray icon. Picks the best available backend:
 *   1. Native (tauri-apps/tray-icon via napi-rs) when the prebuilt is
 *      installed for this platform — proper rendering on modern GNOME,
 *      retina-aware on macOS, hi-DPI on Windows.
 *   2. systray2 fallback when the native prebuilt isn't available
 *      (happens during development before CI publishes prebuilts, or
 *      on niche platforms we haven't built for).
 *
 * Throws when neither backend can be used (headless host with no
 * display, ARM Mac without Rosetta, etc.). Callers should treat the
 * tray as a nice-to-have and catch the error to log + continue
 * without it.
 */
export declare function createTray(opts: CreateTrayOptions): TrayHandle;
//# sourceMappingURL=tray.d.ts.map