import { ContentStream } from '../graphics/content-stream'; import { ImageSource } from '../graphics/image-data'; import { ColorInput } from './color'; import { DocumentOptions, ImageOptions, LinkOptions, OutlineEntry, PageOptions, ShapeStyle, TextOptions } from './document-types'; import { EdgeInsets, LengthUnit } from './geometry'; export declare class PdfDocument { private readonly pages; private readonly fonts; private readonly images; private readonly alphaStates; private readonly outlines; private readonly pendingImages; private pageIndex; private imageCounter; private alphaCounter; readonly unit: LengthUnit; readonly scale: number; private readonly defaultSize; private readonly defaultOrientation; private readonly defaultMargin; private readonly metadata; private readonly compress; private readonly lineHeightFactor; private readonly language?; private readonly displayTitleInWindow; private currentFont; private currentFontSize; private currentFillColor; private currentStrokeColor; private currentLineWidth; constructor(options?: DocumentOptions); private get page(); private get stream(); private toPt; private toUserUnits; private deviceY; get pageCount(): number; get currentPageIndex(): number; get pageWidth(): number; get pageHeight(): number; get margin(): EdgeInsets; get contentWidth(): number; get contentHeight(): number; addPage(options?: PageOptions): this; goToPage(index: number): this; insertPage(index: number, options?: PageOptions): this; removePage(index: number): this; private applyBaselineState; setFont(family: string, options?: { bold?: boolean; italic?: boolean; size?: number; }): this; setFontSize(size: number): this; getFontSize(): number; setFillColor(color: ColorInput): this; setStrokeColor(color: ColorInput): this; setLineWidth(width: number): this; private resolveAlphaState; private applyShapeStyle; private paintModeFor; drawRectangle(x: number, y: number, width: number, height: number, style?: ShapeStyle & { radius?: number; }): this; drawLine(x1: number, y1: number, x2: number, y2: number, style?: ShapeStyle): this; drawCircle(centerX: number, centerY: number, radius: number, style?: ShapeStyle): this; drawEllipse(centerX: number, centerY: number, radiusX: number, radiusY: number, style?: ShapeStyle): this; drawPolygon(points: { x: number; y: number; }[], style?: ShapeStyle & { close?: boolean; }): this; drawPath(builder: (path: PathBuilder) => void, style?: ShapeStyle): this; private resolveFontFor; measureText(text: string, options?: TextOptions): number; splitText(text: string, maxWidth: number, options?: TextOptions): string[]; getLineHeight(fontSize?: number, factor?: number): number; drawText(text: string, x: number, y: number, options?: TextOptions): this; private baselineOffsetFor; private alignmentOffset; private drawTextDecorations; drawTextBlock(text: string, x: number, y: number, width: number, options?: TextOptions): { height: number; lineCount: number; }; private registerImage; drawImage(source: ImageSource, options: ImageOptions): this; getImageSize(source: ImageSource): { width: number; height: number; }; addLink(x: number, y: number, width: number, height: number, options: LinkOptions): this; addOutline(entry: OutlineEntry): this; getOutlines(): OutlineEntry[]; private buildPageContent; private buildOutlineTree; private formatPdfDate; build(): Uint8Array; } export declare class PathBuilder { private readonly stream; private readonly toPoint; private readonly toDeviceY; constructor(stream: ContentStream, toPoint: (value: number) => number, toDeviceY: (value: number) => number); moveTo(x: number, y: number): this; lineTo(x: number, y: number): this; curveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): this; close(): this; } export declare function sanitizeUrl(url: string): string | null;