import type { FragmentorEvents, FragmentorOptions } from "./fragments.js"; import { Fragment, Fragmentor } from "./fragments.js"; import type { Flow, ForcedBreakType } from "./flow.js"; import { FlowIterator } from "./flow.js"; import type { Process } from "./process.js"; export declare const printableFormat: string[]; export type PrintSize = [ width: number, height: number, trimOffset?: number, bleedOffset?: number ]; /** * Sequence of pages * * A sequence is a set of page without a forced page break. */ export declare class Sequence { pageName: string; pageGroupStart: boolean; breakType: ForcedBreakType; startPageIndex: number; endPageIndex: number; batches: HTMLElement[]; /** * Sequence constructor * * @param continuousFlow The range returned by ContinuousFlowIterator. */ constructor(continuousFlow: Flow); } export type StandaloneKind = "blank" | "custom"; export declare class Page extends Fragment { marginBoxes: { [marginName: string]: HTMLElement; }; side: string; standalone: StandaloneKind; printSize: PrintSize; box: HTMLElement; } export interface PaginatorOptions extends FragmentorOptions { source?: HTMLElement; bookmarks: boolean; rawPageCounters: boolean; } export interface PaginatorEvents extends FragmentorEvents { 'preparation-start': Record; 'prepare': { node: Node; }; 'preparation-end': Record; 'pagination-start': Record; 'pagination-end': Record; 'sequence-start': { sequence: Sequence; }; 'sequence-end': { sequence: Sequence; }; 'page-start': { page: Page; body: HTMLElement; }; 'page-standalone': { page: Page; }; 'page-end': { page: Page; }; 'print-start': Record; 'print-end': Record; } export declare class Paginator extends Fragmentor { static defaultOptions: PaginatorOptions; sequences: Sequence[]; currentSequence: Sequence; firstPageSide: "left" | "right"; flowIterator: FlowIterator; avoidBreakTypes: string[]; forcedBreakTypes: ForcedBreakType[]; printSize: PrintSize; processedPages: DocumentFragment; constructor(options?: Partial); get pages(): Page[]; get currentPage(): Page; set currentPage(page: Page); /** * The main generator function of the pagination process. */ protected paginationProcess(): Process; /** * The generator function of the processing of a sequence. * * @param {Range} flow - A range returned by ContinuousFlowIterator * @param {module:layout~Sequence} nextSequence - The following sequence * @memberof module:postscriptum~Processor */ sequenceProcess(sequence: Sequence): Process; /** * The generator function of the processing of a page. * * @param {boolean} blank - Signals if the page to process is blank */ pageProcess(body: HTMLElement, abortIfUnderflow?: boolean): Process; continuePageProcess(body: HTMLElement): Process; addStandalonePage(body: HTMLElement, pageName: string, blank?: boolean, refPage?: Page): void; addImagesToLoad(page: Page): void; onPageEnd(page: Page): void; setBleedAndMarks(page: Page): void; /** * Create a page * * @param doc {Document} * @param name {string} * @param number {integer} * @param pseudos {string[]} */ createPage(name: string, firstOfGroup: boolean, side: string, standalone?: StandaloneKind): Page; updatePagesCounter(): void; }