/** * `@printwithsynergy/lens-pdf/fallback-pdfjs` * * In-browser PDF fallback adapter built on pdf.js. Provides "minimum * data" (page count, dimensions, page rasters, OCG layers, RGB color * sampling) for the fallback-capable tools when a host hasn't wired * richer services. * * Distinct from the deprecated `createPdfJsFallback` re-export in * `/host`: this subpath imports `pdfjs-dist` statically, so bundlers * trace it correctly without the host having to side-effect-import * the dep themselves. Hosts that never use the fallback never import * this subpath and never pay the bundle cost. * * ```ts * import { createPdfJsFallback } from "@printwithsynergy/lens-pdf/fallback-pdfjs"; * const fallback = createPdfJsFallback({ pdfUrl: "/proofs/abc.pdf" }); * ``` * * Usually you don't import this directly — `` uses * it internally and is the one-liner most hosts want. * * **Security**: this adapter fetches whatever URL the host hands it. * Sign / scope / expire the URL the same way you would any other PDF * download — the viewer is a pure renderer and trusts the host to * enforce access control upstream. * * @public */ import type { PdfFallbackAdapter } from "../plugin/services"; declare module "pdfjs-dist/legacy/build/pdf.mjs"; /** * Default URL for the pdf.js worker, served via unpkg pinned to the * exact `pdfjs-dist` version this package was built against. Points at * the **legacy** build (`legacy/build/pdf.worker.min.mjs`) to match the * legacy main-thread import above — both must be the same build so the * worker carries the `getOrInsertComputed` polyfill and the API/Worker * versions agree. Hosts that don't want a runtime CDN dep can override * via the `workerSrc` option, set `pdfjs.GlobalWorkerOptions.workerSrc` * directly before constructing the adapter, or self-host the file. * * @public */ export declare const defaultPdfWorkerSrc: string; interface PdfJsFallbackOptions { /** Raw PDF URL. Must be reachable from the user's browser. */ pdfUrl: string; /** * Optional override for the pdf.js worker URL. Default: * {@link defaultPdfWorkerSrc}, an unpkg URL pinned to the bundled * pdfjs-dist version. */ workerSrc?: string; } /** * Build a {@link PdfFallbackAdapter} backed by pdf.js. The returned * adapter caches the parsed document and per-page rasters so * repeated calls don't re-parse or re-render. * * @public */ export declare function createPdfJsFallback(opts: PdfJsFallbackOptions): PdfFallbackAdapter; export {}; //# sourceMappingURL=index.d.ts.map