import { TrayItem } from '../context/TrayContext'; import { FileNode } from '../types'; /** * useApp(windowId) - the single entry point for App components to interact with the system. * * After Window.jsx injects windowId via cloneElement, the App component only needs to call this hook, * without directly importing any Context. * * Usage: * function MyApp({ windowId, ...props }) { * const api = useApp(windowId); * await api.dialog.alert({ title: 'Tip', message: 'Hello' }); * } */ export declare function useApp(windowId?: string): { window: { id: string; setTitle: (title: string) => void; setFrameless: (frameless: boolean) => void; close: () => void; minimize: () => void; maximize: () => void; resize: (width: number, height: number) => void; move: (left: number, top: number) => void; setBadge: (value: string | number | null) => void; setProgress: (pct: number | null) => void; flash: () => void; hide: () => void; setCloseGuard: (guard: ((forceClose: () => void) => void) | null) => void; setMinimizeGuard: (guard: ((defaultMinimize: () => void) => void) | null) => void; }; openWindow: (appId: string, title: string, component: import('react').ReactNode, icon?: string | undefined, props?: import('../types').WindowProps | undefined) => string; dialog: { alert: (opts: { title: string; message: string; type?: "info" | "warning" | "error"; }) => Promise; confirm: (opts: { title: string; message: string; type?: "question" | "info" | "warning" | "error"; confirmLabel?: string; cancelLabel?: string; }) => Promise; choice: (opts: { title: string; message: string; type?: "question" | "info" | "warning" | "error"; confirmLabel: string; alternateLabel: string; cancelLabel: string; }) => Promise<"confirm" | "alternate" | "cancel">; prompt: (opts: { title: string; message: string; defaultValue?: string; }) => Promise; password: (opts: { title: string; message: string; hint?: string; correctPassword: string; onFail?: () => void; }) => Promise; }; sound: { play: (name: string) => void | undefined; }; fs: { readFile: (path: string[]) => FileNode | null; readDir: (path: string[]) => Record | null; checkAccess: (node: FileNode, passwordInput: string) => boolean; writeFile: (path: string[], content: string) => void; createFile: (path: string[], node?: Partial) => void; deleteFile: (path: string[]) => void; }; session: { user: string; logout: () => void; }; tray: { register: (config: Omit) => void; unregister: () => void; update: (updates: Partial>) => void; }; };