import { SectionBreakBlock, FlowBlock } from '../../../../../../../layout-engine/contracts/src/index.js';
import { PMNode } from '../types.js';
import { SectionRange, SectionSignature, SectPrElement } from './types.js';
type BlockIdGenerator = (kind: string) => string;
/**
 * Type guard: checks if a value is a SectPrElement
 */
export declare function isSectPrElement(value: unknown): value is SectPrElement;
/**
 * Type guard: checks if a paragraph node has sectPr in its properties
 */
export declare function hasSectPr(node: PMNode): boolean;
/**
 * Safely get sectPr from paragraph node attributes
 */
export declare function getSectPrFromNode(node: PMNode): SectPrElement | null;
/**
 * Type guard: checks if a block is a section break
 */
export declare function isSectionBreakBlock(block: unknown): block is SectionBreakBlock;
/**
 * Shallow equality check for Record<string, unknown> objects.
 */
export declare function shallowObjectEquals(x?: Record<string, unknown>, y?: Record<string, unknown>): boolean;
/**
 * Deep equality check for SectionSignature objects to determine if
 * two section configurations are identical.
 */
export declare function signaturesEqual(a: SectionSignature, b: SectionSignature): boolean;
/**
 * Helper: Create a section break block from a section range.
 * Centralizes the section break creation logic to avoid duplication.
 */
export declare function createSectionBreakBlock(section: SectionRange, blockIdGen: BlockIdGenerator, extraAttrs?: Record<string, unknown>): SectionBreakBlock;
/**
 * Determine if a section break requires a page boundary based on property changes.
 *
 * While Word allows continuous sections to change headers/footers/margins mid-page,
 * certain property changes ALWAYS force a page break regardless of section type:
 * - Orientation changes (portrait ↔ landscape)
 * - Page size changes (letter → legal, etc.)
 *
 * This matches Word's actual behavior where physical page constraints override
 * the section type's intent to be continuous.
 *
 * @param current - Current section range
 * @param next - Next section range
 * @returns true if property changes require a forced page boundary
 */
export declare function shouldRequirePageBoundary(current: SectionRange, next: SectionRange | undefined): boolean;
/**
 * Check if a section has intrinsic properties that require a page boundary.
 *
 * **Currently disabled** - always returns false.
 *
 * Rationale: Properties like titlePg, headers, footers, page size, and margins were previously
 * considered "intrinsic signals" that forced page breaks. However, this broke mid-page section
 * changes and violated Word's continuous section behavior.
 *
 * @param section - Section range to check (unused)
 * @returns false - no intrinsic signals force page boundaries
 */
export declare function hasIntrinsicBoundarySignals(_: SectionRange): boolean;
/**
 * Minimal mutable sectionState shape used by section-break emission helpers.
 * Kept local so callers can pass `NodeHandlerContext['sectionState']` directly.
 */
interface SectionStateMutable {
    ranges: SectionRange[];
    currentSectionIndex: number;
    currentParagraphIndex: number;
}
/**
 * Emit the next section's sectionBreak block if the dispatch loop has reached
 * that section's starting top-level node index.
 *
 * ECMA-376 §17.6.17: a section is defined by its end-tagged `<w:sectPr>`. All
 * body children preceding that tag — paragraphs, tables, top-level drawings —
 * belong to the section that ENDS at the tag. This helper fires BEFORE any
 * such node so the appropriate section config is active by the time the node
 * is laid out.
 *
 * Calling it from the main dispatch loop covers every top-level node type —
 * present and future — with no per-handler opt-in. Paragraph-index emission
 * still handles transitions inside SDT child content.
 */
export declare function maybeEmitNextSectionBreakForNode(args: {
    sectionState: {
        ranges: SectionRange[];
        currentSectionIndex: number;
        currentNodeIndex: number;
    };
    nextBlockId: BlockIdGenerator;
    pushBlock: (block: SectionBreakBlock) => void;
}): void;
/**
 * Emit a pending section break before a paragraph if the current paragraph
 * index matches the start of the next section.
 *
 * Centralizes the "check, emit, advance" pattern for handlers that process
 * paragraph children directly, including SDT handlers. This keeps nested
 * paragraph traversal in sync with `findParagraphsWithSectPr`.
 *
 * No-op when:
 *   - sectionState is undefined or has no ranges
 *   - currentParagraphIndex doesn't match the next section's startParagraphIndex
 *
 * Side effects (when emitted):
 *   - Pushes a sectionBreak block onto `blocks`
 *   - Invokes `recordBlockKind`
 *   - Increments `sectionState.currentSectionIndex`
 */
export declare function emitPendingSectionBreakForParagraph(args: {
    sectionState: SectionStateMutable | undefined;
    nextBlockId: BlockIdGenerator;
    blocks: FlowBlock[];
    recordBlockKind?: (kind: FlowBlock['kind']) => void;
}): void;
export {};
//# sourceMappingURL=breaks.d.ts.map