import type { Diagnostic } from './Diagnostic.js'; import { type ExportFormat } from './ExportFormat.js'; import type { PageRange } from './PageRange.js'; /** * Size of a single document page, in typographic points (pt). */ export interface PageSize { /** Page width in points. */ width: number; /** Page height in points. */ height: number; } /** * A compiled document. Its pages can be exported on * demand without re-compiling. * * Obtain one via {@link Template.compile}. Call {@link dispose} (or * use the `using` keyword) to release the underlying document. */ export declare class CompiledDocument implements Disposable { private documentId; /** Sizes (in points) of every page, in document order. */ readonly pages: ReadonlyArray; /** Warnings produced by the compilation of this document. */ readonly warnings: ReadonlyArray; /** * @internal Construct via {@link Template.compile}. */ constructor(documentId: string); /** Number of pages in the document. */ get pageCount(): number; /** * Export the document in the given format (defaults to PDF), optionally * restricted to a range of pages. * @param format - export format specification * @param pages - 0-based, inclusive page range (defaults to the whole document) */ export(format?: ExportFormat, pages?: PageRange): Uint8Array; /** * Export the document to PDF, optionally restricted to a range of pages. * Tagging will be automatically turned off when exporting a subset of pages. * @param pages - 0-based, inclusive page range (defaults to the whole document) */ exportPdf(pages?: PageRange): Uint8Array; /** * Export the document to PNG, optionally restricted to a range of pages. * Multiple pages are merged into a single, vertically stacked image. * @param pixelsPerPt - resolution in pixels per point (defaults to 1.0) * @param pages - 0-based, inclusive page range (defaults to the whole document) */ exportPng(pixelsPerPt?: number, pages?: PageRange): Uint8Array; /** * Export the document to SVG, optionally restricted to a range of pages. * @param pages - 0-based, inclusive page range (defaults to the whole document) */ exportSvg(pages?: PageRange): Uint8Array; /** * Release the cached document. After calling dispose() this instance must not * be used anymore. */ dispose(): void; /** * Enables use with the `using` keyword for automatic resource cleanup. */ [Symbol.dispose](): void; }