import React, { type ReactNode } from 'react'; import type { DocNode } from '../../types/doc-source'; export interface DocNavigator { /** Base route this navigator owns (e.g., '/knowledge-base', '/data-room'). */ baseRoute: string; /** Look up a node in the tree by its storage path (e.g., 'openframe-cli/README.md'). */ findNodeByPath: (path: string) => DocNode | null; /** Navigate to a node using the same flow as a sidebar menu click. */ selectNode: (node: DocNode) => void; } interface DocNavigationContextValue { /** * Register a navigator for a `baseRoute`. Returns a cleanup function that * removes the navigator from the map IF the slot still owns it (StrictMode-safe). * Duplicate registration for the same baseRoute logs a console.warn and replaces. */ register: (nav: DocNavigator) => () => void; /** * Navigate to a path inside whichever registered navigator owns its baseRoute prefix. * Returns true if handled, false otherwise (caller falls back to opening in a new tab). */ navigate: (path: string) => boolean; /** Whether ANY navigator is currently mounted. */ isAvailable: () => boolean; } /** * Bridges `useDocumentTree` instances (deep in the page tree) to `GlobalAskAI` * (high up near the root) without global events or URL parsing. * * Multi-navigator design: a `Map` lets multiple * viewers coexist (nested viewers, dual-pane scenarios). Today only one * viewer mounts at a time, so behavior is unchanged. */ export declare function DocNavigationProvider({ children }: { children: ReactNode; }): React.JSX.Element; export declare function useDocNavigation(): DocNavigationContextValue; export {}; //# sourceMappingURL=doc-navigation-context.d.ts.map