import { FlowBlock, Run, TextRun } from '../../../../../../../layout-engine/contracts/src/index.js';
import { PMNode, NodeHandlerContext, ParagraphToFlowBlocksParams, ParagraphFont } from '../types.js';
/**
 * Helper to check if a run is a text run.
 */
export declare const isTextRun: (run: Run) => run is TextRun;
/**
 * Checks if two text runs have compatible data attributes for merging.
 * Runs are compatible if they have identical data-* attributes or both have none.
 *
 * @param a - First text run
 * @param b - Second text run
 * @returns true if data attributes are compatible for merging, false otherwise
 */
export declare const dataAttrsCompatible: (a: TextRun, b: TextRun) => boolean;
export declare const commentsCompatible: (a: TextRun, b: TextRun) => boolean;
/**
 * Merges adjacent text runs with continuous PM positions and compatible styling.
 * Optimization to reduce run fragmentation after PM operations.
 *
 * @param runs - Array of runs to merge
 * @returns Merged array of runs
 */
export declare function mergeAdjacentRuns(runs: Run[]): Run[];
/**
 * Converts a paragraph PM node to an array of FlowBlocks.
 *
 * This is the main entry point for paragraph conversion. It handles:
 * - Page breaks (pageBreakBefore)
 * - Inline content (text, runs, SDTs, tokens)
 * - Block-level content (images, drawings, tables, hard breaks)
 * - Tracked changes filtering
 * - Run merging optimization
 *
 * @param para - Paragraph PM node to convert
 * @param nextBlockId - Block ID generator
 * @param positions - Position map for PM node tracking
 * @param trackedChanges - Optional tracked changes configuration
 * @param bookmarks - Optional bookmark position map
 * @param hyperlinkConfig - Hyperlink configuration
 * @param themeColors - Optional theme color palette for color resolution
 * @param converters - Optional converter dependencies injected to avoid circular imports
 * @param converterContext - Optional converter context with document styles
 * @param enableComments - Whether to include comment marks in the output (defaults to true). Set to false for viewing modes where comments should be hidden.
 * @returns Array of FlowBlocks (paragraphs, images, drawings, page breaks, etc.)
 */
export declare function paragraphToFlowBlocks({ para, nextBlockId, positions, storyKey, trackedChangesConfig, bookmarks, hyperlinkConfig, themeColors, converters, converterContext, enableComments, stableBlockId, previousParagraphFont, }: ParagraphToFlowBlocksParams): FlowBlock[];
/**
 * Returns the font of the last paragraph block's first run in the given blocks array.
 * Used to pass previous paragraph font into paragraphToFlowBlocks for new list items without explicit run properties.
 *
 * Only returns when the run has both valid fontFamily (non-empty string) and fontSize (positive finite number).
 * If the latest paragraph's first run has partial or empty font info, the loop continues to the previous
 * paragraph so callers never receive a partial object and can fall back to defaults consistently.
 */
export declare function getLastParagraphFont(blocks: FlowBlock[]): ParagraphFont | undefined;
/**
 * Handle paragraph nodes.
 * Special handling: Emits section breaks BEFORE processing the paragraph
 * if this paragraph starts a new section.
 *
 * Supports incremental conversion via FlowBlockCache:
 * - If cache is available and paragraph has stable ID (sdBlockId/paraId)
 * - Check cache for matching node content
 * - On cache hit: reuse blocks with position adjustment
 * - On cache miss: convert normally and store in cache
 *
 * @param node - Paragraph node to process
 * @param context - Shared handler context
 */
export declare function handleParagraphNode(node: PMNode, context: NodeHandlerContext): void;
//# sourceMappingURL=paragraph.d.ts.map