import { Page } from '../../contracts/src/index.js'; import { FootnoteSlice } from './footnote-content.js'; import { FootnotePageLedgerDraft, FootnotePagePlanInput, PendingFootnote } from './footnote-page-planner.js'; export type CoupledFootnotePaginationOptions = Omit & { pageSize: { w: number; h: number; }; /** The bridge must validate exact boundary provenance before supplying a start, never a height-only seed. */ start?: { pageIndex: number; pendingByColumn: FootnotePagePlanInput['pendingByColumn']; isPreviouslyAnchored(id: string): boolean; }; }; export type CoupledFootnotePageCompletion = { page: Page; pageIndex: number; bodyBottom: number; physicalBottom: number; anchors: readonly { refId: string; }[]; }; export type CoupledFootnotePageFlow = { incomingDemand(pageIndex: number): { height: number; refs: number; }; completePage(completion: CoupledFootnotePageCompletion): void; hasPendingContinuation(): boolean; }; export type CoupledFootnotePagination = { flow: CoupledFootnotePageFlow; plan: { slicesByPage: Map; reserves: number[]; hasContinuationByColumn: Map; separatorSpacingBefore: number; ledgersByPage: Map; incomingByPage: Map>; outgoingByPage: Map>; }; }; export type CoupledFootnotePaginationFailure = 'unsupported-page' | 'page-sequence' | 'missing-anchor' | 'duplicate-claim' | 'ordered-minimum' | 'physical-overflow' | 'range-conservation' | 'reference-conservation' | 'no-progress'; export declare class CoupledFootnotePaginationError extends Error { readonly code: CoupledFootnotePaginationFailure; readonly pageIndex: number; readonly footnoteId?: string | undefined; readonly name = "CoupledFootnotePaginationError"; constructor(code: CoupledFootnotePaginationFailure, pageIndex: number, message: string, footnoteId?: string | undefined); } /** Call only at real document EOF; expected IDs exclude references anchored before this pass. */ export declare const validateCoupledFootnoteReferenceConservation: (plan: Pick, expectedAnchorIds: Iterable) => void; /** * Owns forward page admission from a fresh start or a bridge-validated boundary. * Prepared inventories and prior anchor ownership remain lookup-only. */ export declare const createCoupledFootnotePagination: (options: CoupledFootnotePaginationOptions) => CoupledFootnotePagination;