/** * In-browser PDF fallback adapter built on pdf.js. * * Provides "minimum data" for the fallback-capable tools (PageCanvas, * PageNavigator, MeasureTool, LayerPanel, ColorPickerTool) when a host * hasn't wired richer services. Hosts pass the returned adapter as * ``pdfFallback`` on the host context. * * pdf.js is loaded lazily via dynamic ``import("pdfjs-dist")`` so it * stays out of the bundle for hosts that don't use this fallback. Add * ``pdfjs-dist`` to your app's dependencies (it's an optional peer dep * of ``@printwithsynergy/lens-pdf``). * * **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"; interface PdfJsFallbackOptions { /** Raw PDF URL. Must be reachable from the user's browser. */ pdfUrl: string; /** * Optional override for the pdf.js worker URL. When omitted, the * adapter assumes the bundler / host has already configured * ``GlobalWorkerOptions.workerSrc``. */ 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. * * @deprecated Use ``createPdfJsFallback`` from * ``@printwithsynergy/lens-pdf/fallback-pdfjs`` instead. The * subpath imports pdfjs-dist statically so bundlers trace it * correctly without consumers having to side-effect-import the * dep. This `/host` export uses a dynamic ``await import("...")`` * that bundlers don't trace; works at runtime only when * pdfjs-dist is also installed and resolvable from the consuming * app's module graph. New code should not use this entry point. * * @public */ export declare function createPdfJsFallback(opts: PdfJsFallbackOptions): PdfFallbackAdapter; export {}; //# sourceMappingURL=pdfFallback.d.ts.map