import { EditorView } from '@codemirror/view'; import { DiffType } from 'api-smart-diff'; import { ChangeSummary, ChildKeyInfo, DiffData, FindPathsOptions, MergedDocument, NavigationAPI, NavigationOptions, PathSearchResult } from '../types'; import { BlockTreeIndex } from '../utils/block-index'; import { DiffPath } from '../utils/path'; /** Implementation of the path-based Navigation API */ export declare class NavigationAPIImpl implements NavigationAPI { private beforeView; private afterView; private diffData; private merged; private currentBlockIndex; private currentPath; private navigateListeners; private treeIndex; constructor(beforeView: EditorView | null, afterView: EditorView | null, diffData: DiffData, merged?: MergedDocument | null); /** Update views, data, and merged document */ update(beforeView: EditorView | null, afterView: EditorView | null, diffData: DiffData, merged?: MergedDocument | null, treeIndex?: BlockTreeIndex | null): void; /** Navigate to the next change matching the given types */ goToNextChange(...types: DiffType[]): string | null; /** Navigate to the previous change matching the given types */ goToPrevChange(...types: DiffType[]): string | null; /** Navigate to a specific path in the document */ goToPath(path: DiffPath, options?: NavigationOptions): void; /** Find paths whose key or value contains the search text */ findPaths(text: string, options?: FindPathsOptions): PathSearchResult[]; /** Get the immediate child keys of a path */ getChildKeys(path?: DiffPath): ChildKeyInfo[]; /** Get summary of changes */ getChangeSummary(): ChangeSummary; /** Get the current path */ getCurrentPath(): string | null; /** Subscribe to navigation changes */ onNavigate(callback: (path: string | null) => void): () => void; /** Get blocks with changes (have diff metadata) */ private getChangedBlocks; /** Get blocks by diff type */ private getBlocksByType; /** Navigate to a block, expanding ancestors, scrolling, and highlighting */ private navigateToBlock; /** Expand a block by dispatching toggleBlockExpandedEffect if it is collapsed */ private expandBlock; private scrollToLine; private selectBlock; /** * Resolve a block to its path string. * For container blocks this is the block id. For leaf blocks (id = ""), * walk up the block tree to find the nearest parent with an id. * Uses the tree index for O(1) parent lookup when available. */ private resolveBlockPath; private notifyNavigate; } /** Create navigation API instance */ export declare function createNavigationAPI(beforeView: EditorView | null, afterView: EditorView | null, diffData: DiffData, merged?: MergedDocument | null): NavigationAPI;