import type { DocumentMetadata, PostextConfig, Resource } from '../types.js'; import type { VDTDocument } from '../vdt.js'; import type { BuildDocumentOptions } from '../pipeline/index.js'; import type { MeasurementCache } from '../measure/index.js'; import type { BundleChapter, BundleStart } from './types.js'; import type { BundleLayoutCache } from './layoutCache.js'; export interface BuildBundleOptions extends BuildDocumentOptions { /** Configuration to lay out with instead of the bundle's own. */ config?: PostextConfig; /** Measurement cache shared by every chapter; one is created when * omitted. */ cache?: MeasurementCache; /** Book metadata (`{title}`, `{author}`, the PDF title…) handed to every * chapter. The first chapter's front matter is the book's and wins over * these values; a front-matter block at the top of a later chapter is * ignored, as in the Sandbox. */ metadata?: DocumentMetadata; /** Called after each chapter is laid out (the last round's, when the * contents take several). */ onChapter?: (index: number, doc: VDTDocument) => void; /** The chapters an earlier build of the same book laid out (#782): a * chapter whose inputs are unchanged is taken from it instead of laid * out again, and the cache is left holding this build's. Its `stats` * then say which chapters were laid out. `onProgress` and `onPass` hear * only from the chapters laid out. */ layoutCache?: BundleLayoutCache; } /** A chapter with a composed page fence. */ /** Whether the Markdown holds a page fence (`::::page`, three colons or * more, then `page` as a whole word). A scan, not a regular expression: a * pattern that may start inside a long run of colons is quadratic on it. */ export declare const hasComposedPage: (markdown: string) => boolean; /** Lay out every chapter of `bundle`, in order; returns one `VDTDocument` * per chapter. Hand the array to `renderToPdf` for the whole book, or * paint `docs[i]` for one chapter. A bundle that holds part of a longer * book (`start`, #695) is laid out from there: its first chapter with * that continuation, as `buildDocument({ markdown, continuation: start }, * config)` would, and the chapters after it chained from it. */ export declare function buildBundle(bundle: { chapters: readonly Pick[]; config: PostextConfig; resources?: readonly Resource[]; start?: BundleStart; }, options?: BuildBundleOptions): VDTDocument[]; //# sourceMappingURL=book.d.ts.map