import type { Result } from "@cprussin/option-result"; import type { MenuAddress, MenuEntry, WatchedMenu } from "../dbusmenu"; import type { DomicileHost } from "../domicile-host"; import type { SystemError } from "../system"; import type { TrayAction, TrayItem } from "../tray"; import type { Dbus } from "./dbus"; import type { On } from "./subscribe"; export type TrayListeners = { change: () => void; }; export type Tray = { /** `undefined` until the compositor says. */ readonly items: readonly TrayItem[] | undefined; /** Click icon `id` with a button. What the click does is the application's. */ activate: (id: string, action: TrayAction) => void; /** Call `onMenu` with the menu at `address` now and after each change. */ menu: (address: MenuAddress, onMenu: (menu: Result) => void) => WatchedMenu; on: On; }; export type TrayHost = Pick; export declare const tray: (host: TrayHost, bus: Pick) => Tray;