import { type ReactNode } from 'react'; import type { ToolRailHandle, ToolRailTool } from '../tool-rail'; /** The rail's handle, and whether it currently holds a given tool. */ type RegisterRail = (handle: ToolRailHandle | null, hasTool?: (id: string) => boolean) => void; /** How long a queued `openTool` waits for its tool and the rail to register * before it is dropped, so a tool added much later never pops open. */ export declare const QUEUED_OPEN_TIMEOUT_MS = 1000; export interface ControlRoomProviderProps { /** * Tools valid in every context (Alia, Inbox). Set once at the app shell — * they pin to the rail's far end and persist across navigation. Memoise * this array so it doesn't re-register every render. */ globalTools?: ToolRailTool[]; children: ReactNode; } /** * Holds the Control Room's global tools and the registry of per-context * contextual tools. Mount once at the app shell, inside the frame that also * renders ``. */ export declare function ControlRoomProvider({ globalTools, children, }: ControlRoomProviderProps): import("react/jsx-runtime").JSX.Element; /** * Register this context's **contextual** tools (Notes, Appointments, the entity * summary). They sit below the favourites divider and unregister automatically * when the calling component unmounts (i.e. when you leave the context). * * Pass a **stable / memoised** array — like `useEffect` deps, a fresh array * every render re-registers every render. Wrap it in `useMemo`. * * No-op when rendered outside a ``. */ export declare function useControlRoomTools(tools: ToolRailTool[]): void; /** * The merged tool set the rail consumes: contextual tools (auto-tagged * `scope: 'contextual'`) then globals (`scope: 'global'`). Scope is assigned * here by which API registered the tool — `global` seeds the Control Room's * default favourites (pinned on top); `contextual` falls below the divider. * `ControlRoomRail` re-groups by favourite membership for the final order. * Returns `[]` outside a provider. */ export declare function useControlRoomMergedTools(): ToolRailTool[]; /** * Open a tool's panel from a page, or collapse it; stable, and a no-op outside * a ``. An `openTool` for a tool the rail does not hold * yet waits up to `QUEUED_OPEN_TIMEOUT_MS`, then is dropped. */ export declare function useControlRoomActions(): { openTool: (id: string) => void; closeTool: () => void; }; /** * Internal: the rail registers its imperative handle with the provider so * `useControlRoomActions().openTool` can drive it. Returns the stable * `registerRail` callback (or a no-op outside a provider). */ export declare function useControlRoomRailRegister(): RegisterRail; export {}; //# sourceMappingURL=control-room-context.d.ts.map