import { PdfMergeError, PdfFetchError, InvalidPdfFormatError, mergeBase64PDFs, mergeBase64PDFsWithInfo, mergePdfBuffers, mergePdfBuffersWithInfo } from './core'; import type { MergeResult, MergeOptions, MergeUrlInput, MergePdfUrlsOptions, PageSelector, AcceptedInputFormat } from './core'; export { PdfMergeError, PdfFetchError, InvalidPdfFormatError, mergeBase64PDFs, mergeBase64PDFsWithInfo, mergePdfBuffers, mergePdfBuffersWithInfo, }; export type { PageSelector, PdfMetadata, MergeOptions, Watermark, TextWatermark, ImageWatermark, WatermarkPosition, PageNumbers, MergeResult, MergeBase64Input, MergeBufferInput, MergeUrlInput, MergePdfUrlsOptions, TableOfContents, InputFormat, AcceptedInputFormat, TextOptions, ImageOptions, } from './core'; /** * Fetches PDFs from the given ordered URLs and merges them into a single * Base64 PDF string. Downloads happen in parallel; the merge step assembles * them in the original index order. * * Security defaults: * - Only `http:` and `https:` URLs are accepted (blocks `file:`, `data:`, etc.). * - Each response is capped at ~100 MiB (configurable via `maxBytesPerUrl`). * - URLs are sanitized in error messages (credentials and query strings stripped). * - Opt into `blockPrivateHosts` / `allowedHosts` for SSRF protection, which * resolves DNS and validates each redirect hop before it is contacted. * * @throws {PdfMergeError} when the input array is empty or a URL fails validation. * @throws {PdfFetchError} when a URL cannot be retrieved or does not return a PDF. * @throws {InvalidPdfFormatError} when a fetched payload is not a parseable PDF. */ export declare function mergePdfUrls(urls: MergeUrlInput[], options?: MergePdfUrlsOptions): Promise; /** * Like {@link mergePdfUrls}, but also returns the merged document's * `pageCount` and `byteLength` (see {@link MergeResult}). `byteLength` is the * size of the decoded PDF bytes, not the Base64 string length. */ export declare function mergePdfUrlsWithInfo(urls: MergeUrlInput[], options?: MergePdfUrlsOptions): Promise>; /** Entry accepted by `mergePdfFiles`: a path string, or an object specifying * which `pages` to keep and/or a `title` for the table of contents. When a * `title` is omitted, a generated TOC labels the entry with the file's * basename. */ export type MergeFileInput = string | { path: string; pages?: PageSelector; title?: string; /** * Input format. Auto-detected from the file extension (then magic bytes) * for `.pdf` / `.png` / `.jpg` / `.jpeg` / `.txt`; set it to override * detection. `'jpeg'` is accepted as an alias for `'jpg'`. */ format?: AcceptedInputFormat; }; /** * Like {@link mergePdfFiles}, but also returns the merged document's * `pageCount` and `byteLength` (see {@link MergeResult}). **Node.js only.** */ export declare function mergePdfFilesWithInfo(inputs: MergeFileInput[], options?: MergeOptions): Promise>; export declare function mergePdfFiles(inputs: MergeFileInput[], options?: MergeOptions): Promise;