import { formatPageNumber, formatPageNumberFieldValue, formatSectionPageNumberText, FlowBlock, Layout, Page, PageNumberChapterSeparator, PageNumberFormat, SectionMetadata } from '../../contracts/src/index.js';
export { formatPageNumber, formatPageNumberFieldValue, formatSectionPageNumberText };
export type { PageNumberFormat };
export interface ChapterPageInfo {
    chapterNumberText?: string;
    chapterStyle?: number;
}
/**
 * Display page information for a single page in the document.
 * Contains both the physical page number and the section-aware display number.
 */
export interface DisplayPageInfo {
    /** Physical page number (1-indexed, continuous across the document) */
    physicalPage: number;
    /** Section-aware display page number (respects restart and offset) */
    displayNumber: number;
    /** Formatted display text (e.g., "III", "C", "23") */
    displayText: string;
    /** Index of the section this page belongs to */
    sectionIndex: number;
    /** Physical page count in the current section */
    sectionPageCount: number;
    /** Section PAGE number format before any run-local PAGE switch is applied. */
    pageFormat?: PageNumberFormat;
    /** MVP chapter prefix text derived from the nearest numbered Heading N marker. */
    chapterNumberText?: string;
    /** Separator between chapter prefix and page number component. */
    chapterSeparator?: PageNumberChapterSeparator;
}
export declare function normalizeChapterMarkerText(markerText: unknown): string | undefined;
export declare function buildChapterContextByPage(layout: Layout, blocks: FlowBlock[] | ReadonlyMap<string, FlowBlock>, sections: SectionMetadata[]): Map<number, ChapterPageInfo>;
/**
 * Computes section-aware display page numbers for all pages in a document.
 *
 * This function implements MS Word's section numbering behavior:
 * - Each section can have its own page number format
 * - Sections can restart numbering at a specific value
 * - Continuous sections inherit the previous section's running count unless restart is set
 * - Display numbers are calculated as: pageIndexWithinSection + offset (or restart value)
 * - Display numbers are never less than 1
 *
 * Algorithm:
 * 1. Map each page to its owning section
 * 2. For each section:
 *    - If restart/start is set, begin counting from that value
 *    - Otherwise, continue from previous section's count
 * 3. For each page within a section:
 *    - Calculate displayIndex = pageIndexWithinSection + offset
 *    - Clamp displayNumber = max(1, displayIndex)
 *    - Format displayText using the section's number format
 *
 * @param pages - Array of pages from the layout (with page.number 1-indexed)
 * @param sections - Array of section metadata (aligned by sectionIndex)
 * @returns Array of display page information for each page
 *
 * @example
 * ```typescript
 * const pages = [
 *   { number: 1, ... },
 *   { number: 2, ... },
 *   { number: 3, ... },
 * ];
 * const sections = [
 *   { sectionIndex: 0, numbering: { format: 'lowerRoman', start: 1 } },
 *   { sectionIndex: 1, numbering: { format: 'decimal', start: 1 } },
 * ];
 * const displayInfo = computeDisplayPageNumber(pages, sections);
 * // displayInfo[0]: { physicalPage: 1, displayNumber: 1, displayText: "i", sectionIndex: 0 }
 * // displayInfo[1]: { physicalPage: 2, displayNumber: 2, displayText: "ii", sectionIndex: 0 }
 * // displayInfo[2]: { physicalPage: 3, displayNumber: 1, displayText: "1", sectionIndex: 1 }
 * ```
 */
export declare function computeDisplayPageNumber(pages: Page[], sections: SectionMetadata[], chapterInfoByPage?: ReadonlyMap<number, ChapterPageInfo>): DisplayPageInfo[];
//# sourceMappingURL=pageNumbering.d.ts.map