import { Node } from '@tiptap/core'; declare module '@tiptap/core' { interface Commands { tableOfContents: { /** Insert a Table of Contents node at the cursor. */ insertTableOfContents: (attrs?: TocAttrs) => ReturnType; /** Re-scan the document and refresh every TOC node. */ refreshTableOfContents: () => ReturnType; /** Update the level filter for the TOC at the current selection. */ setTocLevels: (minLevel: number, maxLevel: number) => ReturnType; }; } } interface TocAttrs { /** Minimum heading level to include (default 1). */ minLevel?: number; /** Maximum heading level to include (default 3). */ maxLevel?: number; /** Display title shown above the TOC ("Table of contents"). */ title?: string; /** Show the dotted leader between text and page number (default true). */ showLeader?: boolean; /** Show estimated page numbers (default true). */ showPageNumbers?: boolean; } /** * Table of Contents extension. * * - Backed by a real `tableOfContents` node so it survives copy/paste, undo/redo, * serialisation and round-trips through HTML/JSON. * - Renders as a static HTML block in the document; the engine refreshes it * whenever the user runs `refreshTableOfContents()` (and once on insert). * - Configurable via `minLevel`, `maxLevel`, `title`, `showLeader`, `showPageNumbers`. * - Page numbers are estimated from a rough characters-per-page heuristic until * the host application supplies a real pagination map. Works well in practice * because the dotted leaders absorb minor mis-alignment. */ export declare const TableOfContents: Node; /** Re-export the legacy storage extension name so existing code keeps working. */ export { TableOfContents as default };