import { FlowBlock, SdtMetadata } from '../../../../../../../layout-engine/contracts/src/index.js';
import { PMNode, BlockIdGenerator, PositionMap, HyperlinkConfig, TrackedChangesConfig, NodeHandlerContext, NestedConverters, ConverterContext, ThemeColorPalette } from '../types.js';
/**
 * Apply TOC metadata to paragraph blocks.
 * Marks paragraphs as TOC entries and stores TOC-specific metadata.
 *
 * @param blocks - Array of flow blocks (only paragraphs are modified)
 * @param metadata - TOC metadata containing gallery, uniqueId, and instruction
 */
export declare function applyTocMetadata(blocks: FlowBlock[], metadata: {
    gallery?: string | null;
    uniqueId?: string | null;
    instruction?: string | null;
}): void;
/**
 * Process TOC children and add metadata to paragraph blocks.
 * Handles both flat paragraphs and nested tableOfContents structures.
 *
 * This function is typically called from node handlers when processing
 * documentPartObject nodes with gallery="Table of Contents".
 *
 * @param children - Child nodes to process (paragraphs or nested tableOfContents)
 * @param metadata - TOC metadata to apply to all unwrapped paragraphs
 * @param context - Conversion context (fonts, positions, etc.)
 * @param outputArrays - Mutable arrays to append blocks to
 * @param paragraphConverter - Function to convert PM paragraph nodes to FlowBlocks
 *
 * @example
 * ```typescript
 * processTocChildren(
 *   node.content,
 *   {
 *     docPartGallery: 'Table of Contents',
 *     docPartObjectId: 'toc-1',
 *     tocInstruction: 'TOC \\o "1-3" \\h \\z \\u',
 *     sdtMetadata: { type: 'docPartObject', gallery: 'Table of Contents' }
 *   },
 *   context,
 *   { blocks, recordBlockKind },
 *   paragraphToFlowBlocks
 * );
 * ```
 */
export declare function processTocChildren(children: readonly PMNode[], metadata: {
    docPartGallery?: string;
    docPartObjectId?: string;
    tocInstruction?: string;
    sdtMetadata?: SdtMetadata;
}, context: {
    nextBlockId: BlockIdGenerator;
    positions: PositionMap;
    bookmarks: Map<string, number>;
    trackedChangesConfig: TrackedChangesConfig;
    hyperlinkConfig: HyperlinkConfig;
    enableComments: boolean;
    converters: NestedConverters;
    converterContext: ConverterContext;
    themeColors?: ThemeColorPalette;
    sectionState?: NodeHandlerContext['sectionState'];
}, outputArrays: {
    blocks: FlowBlock[];
    recordBlockKind?: (kind: FlowBlock['kind']) => void;
}): void;
/**
 * Handle direct `tableOfContents` PM nodes (not wrapped in a `documentPartObject`
 * SDT). Delegates to `processTocChildren` — the single code path that also
 * services `handleDocumentPartObjectNode`. This keeps the section-range
 * counting contract intact: `findParagraphsWithSectPr` counts every
 * `tableOfContents` child, and `processTocChildren` advances
 * `sectionState.currentParagraphIndex` per child so deferred section breaks
 * fire at the right paragraph boundary (SD-2557).
 *
 * @param node - Table of contents node to process
 * @param context - Shared handler context
 */
export declare function handleTableOfContentsNode(node: PMNode, context: NodeHandlerContext): void;
//# sourceMappingURL=toc.d.ts.map