import { Node as ProseMirrorNode } from 'prosemirror-model'; import { TocAddress, TocDomain, DiscoveryItem, TocInfo } from '@superdoc/document-api'; export interface ResolvedTocNode { node: ProseMirrorNode; pos: number; /** Stable public node id used by doc-api addresses and discovery handles. */ nodeId: string; /** Internal editor command id (sdBlockId) when available. */ commandNodeId?: string; } /** * Finds all tableOfContents nodes in document order. */ export declare function findAllTocNodes(doc: ProseMirrorNode): ResolvedTocNode[]; /** * Resolves a TocAddress to its ProseMirror node and position. * @throws DocumentApiAdapterError with code TARGET_NOT_FOUND if not found. */ export declare function resolveTocTarget(doc: ProseMirrorNode, target: TocAddress): ResolvedTocNode; /** * Re-resolves a TOC node by its sdBlockId in the post-mutation document and * returns the current public nodeId. * * Public IDs prefer sdBlockId (when present) and otherwise fall back to a * deterministic ID derived from node position + instruction. * * Falls back to the sdBlockId itself when the node is not discoverable in the * post-mutation doc (e.g. dispatch did not synchronously update state). The * sdBlockId is still resolvable within the same session via commandNodeId * matching in resolveTocTarget. */ export declare function resolvePostMutationTocId(doc: ProseMirrorNode, sdBlockId: string): string; export declare function extractTocInfo(node: ProseMirrorNode): TocInfo; export declare function buildTocDiscoveryItem(resolved: ResolvedTocNode, evaluatedRevision: string): DiscoveryItem; //# sourceMappingURL=toc-resolver.d.ts.map