import { default as React } from 'react'; import { MenuItem } from '../types'; export interface TrayItem { id: string; icon: string; tooltip: string; order: number; onClick?: () => void; /** * Right-click context-menu items for this tray icon (#refine-qq). When present, * right-clicking the icon raises the shared XP {@link ContextMenu}. Structured * data only — the tray owner supplies `MenuItem`s, never hand-rolled menu DOM. */ contextMenuItems?: MenuItem[]; } /** Options for {@link TrayContextType.notify} (#118). */ export interface NotifyOptions { /** XPIcon key shown in the balloon (e.g. '360safe', 'network'). */ icon?: string; /** Bold heading line. */ title: string; /** Body text under the title. */ body?: string; /** Milliseconds the balloon stays before auto-fading. `0` keeps it sticky. Default 9000. */ timeout?: number; /** Called when the user clicks the balloon body. */ onClick?: () => void; /** * Tray item id to anchor the balloon's tail to (a registered icon's id, or * the built-in 'volume' / 'network'). The balloon points its tail at that * icon, XP-style. When omitted, the tail auto-anchors to a tray icon whose id * matches `icon` (so a `network` balloon emanates from the network icon), and * failing that, to the notification area (right side). */ anchorId?: string; } export interface TrayContextType { items: TrayItem[]; register: (id: string, config: Omit) => void; unregister: (id: string) => void; update: (id: string, updates: Partial>) => void; /** * Pop an XP tray balloon. One shows at a time; further calls queue behind it, * XP-style. Plays the notify sound and emits `notification:show` on display * and `notification:click` on click. Returns the notification id. */ notify: (options: NotifyOptions) => string; /** Dismiss a queued or visible notification by id. */ dismissNotification: (id: string) => void; } export declare const useTray: () => TrayContextType; /** * TrayProvider — System tray icon registry + notification balloons (#118). * * Tray icons: any component calls useTray() to register icons: * const { register, unregister, update } = useTray(); * useEffect(() => { * register('my-app', { icon: 'folder', tooltip: 'My App', order: 30 }); * return () => unregister('my-app'); * }, [register, unregister]); * * Notifications: `notify({ icon, title, body, timeout, onClick })` pops an XP * balloon above the taskbar (one at a time, queued). */ export declare const TrayProvider: React.FC<{ children: React.ReactNode; }>;