import { Editor } from '../../core/Editor.js'; import { TocGetInput, TocInfo, TocConfigureInput, TocUpdateInput, TocRemoveInput, TocMutationResult, TocListQuery, TocListResult, CreateTableOfContentsInput, CreateTableOfContentsResult, MutationOptions } from '../../../../../../document-api/src/index.js'; import { EntryParagraphJson, TocSource } from '../helpers/toc-entry-builder.js'; export declare function tocListWrapper(editor: Editor, query?: TocListQuery): TocListResult; export declare function tocGetWrapper(editor: Editor, input: TocGetInput): TocInfo; /** * Removes tocPageNumber marks when the active schema doesn't define that mark. * Some headless/test schemas omit TOC-specific marks, and nodeFromJSON fails if * unknown marks are present in generated TOC paragraph content. */ export declare function sanitizeTocContentForSchema(content: EntryParagraphJson[], editor: Editor): EntryParagraphJson[]; export declare function tocConfigureWrapper(editor: Editor, input: TocConfigureInput, options?: MutationOptions): TocMutationResult; export declare function tocUpdateWrapper(editor: Editor, input: TocUpdateInput, options?: MutationOptions): TocMutationResult; export declare function tocRemoveWrapper(editor: Editor, input: TocRemoveInput, options?: MutationOptions): TocMutationResult; /** Payload for inserting a TOC block (shared by document API and toolbar). */ export type PreparedTableOfContentsInsert = { pos: number; instruction: string; sdBlockId: string; content: unknown[]; sources: TocSource[]; rightAlignPageNumbers?: boolean; }; /** * Resolves insertion position and materializes TOC content/instruction. * Callers that run inside `editor.commands.*` must apply the insert on the * **same** command transaction (see `insertTableOfContents`) — * never call `editor.commands.insertTableOfContentsAt` from here, or nested * dispatches can throw "Applying a mismatched transaction". */ export declare function prepareTableOfContentsInsertion(editor: Editor, input: CreateTableOfContentsInput, options?: MutationOptions): PreparedTableOfContentsInsert; export declare function createTableOfContentsWrapper(editor: Editor, input: CreateTableOfContentsInput, options?: MutationOptions): CreateTableOfContentsResult; //# sourceMappingURL=toc-wrappers.d.ts.map