import type { ComparePdfOptions } from './types/ComparePdfOptions.js'; import type { ComparePdfDetailedResult } from './types/ComparePdfDetailedResult.js'; import type { PdfInput } from './types/PdfInput.js'; /** * Compares two PDF inputs and returns a boolean indicating whether they are visually equivalent. * * Supported PDF inputs are file paths, `Buffer`, `ArrayBuffer`, and `SharedArrayBuffer`. String * paths are trusted caller-controlled inputs by default. To constrain them to a specific * workspace, set `options.allowedInputRoot`. `SharedArrayBuffer` inputs are normalized to * `ArrayBuffer` before rendering. * * Diff PNGs are not written unless `options.writeDiffs` is explicitly set to `true`. When enabled, * `options.diffsOutputFolder` acts as a trusted write root on a trusted local filesystem. * * Rendered pages are paired by renderer-reported `pageNumber`, not by generated PNG filename * or `excludedAreas` array position. If either PDF is missing a rendered counterpart for a * page number present in the comparison plan, the overall comparison returns `false`. * * @param actualPdf - The file path or binary content of the actual PDF to compare. * @param expectedPdf - The file path or binary content of the expected PDF to compare against. * @param opts - Optional comparison options. * @returns A promise that resolves to `true` when every compared page stays within its * applicable threshold, otherwise `false`. * @throws {ComparePdfInputError} When a PDF input has an unsupported type or points to a missing file. * @throws {ComparePdfConfigurationError} When runtime comparison configuration is invalid. * @throws {ComparePdfRenderingError} When PDF rendering fails. * @throws {ComparePdfComparisonError} When PNG comparison fails. */ export declare function comparePdf(actualPdf: PdfInput, expectedPdf: PdfInput, opts?: ComparePdfOptions): Promise; /** * Compares two PDF inputs and returns structured page-level comparison details. * * Supported PDF inputs are file paths, `Buffer`, `ArrayBuffer`, and `SharedArrayBuffer`. String * paths are trusted caller-controlled inputs by default. To constrain them to a specific * workspace, set `options.allowedInputRoot`. `SharedArrayBuffer` inputs are normalized to * `ArrayBuffer` before rendering. * * Diff PNGs are not written unless `options.writeDiffs` is explicitly set to `true`. * * Rendered pages are paired by renderer-reported `pageNumber`, not by generated PNG filename * or `excludedAreas` array position. Missing rendered counterpart pages are surfaced in the * returned page results without requiring callers to inspect diff files on disk. * * @param actualPdf - The file path or binary content of the actual PDF to compare. * @param expectedPdf - The file path or binary content of the expected PDF to compare against. * @param opts - Optional comparison options. * @returns A promise that resolves to a structured comparison result. * @throws {ComparePdfInputError} When a PDF input has an unsupported type or points to a missing file. * @throws {ComparePdfConfigurationError} When runtime comparison configuration is invalid. * @throws {ComparePdfRenderingError} When PDF rendering fails. * @throws {ComparePdfComparisonError} When PNG comparison fails. */ export declare function comparePdfDetailed(actualPdf: PdfInput, expectedPdf: PdfInput, opts?: ComparePdfOptions): Promise;