import { Ref, ComputedRef } from 'vue'; /** * Build the parameters passed to pdf.js getDocument (via usePDF). * * Since pdf.js 5.x, JPEG2000 (and JBIG2 / ICC color) images are decoded by * WASM modules (openjpeg.wasm, qcms_bg.wasm) that pdf.js fetches at runtime * from `wasmUrl`. When wasmUrl is left undefined it defaults to null, so the * worker tries to fetch "nullopenjpeg.wasm", fails, and JPEG2000 images are * not rendered (the rest of the page still renders). We therefore point * wasmUrl at "pdfjs/wasm/", where vite-plugin-static-copy serves the * pdfjs-dist/wasm/* files in the consuming app. * * BASE_URL is the consuming app's Vite base (e.g. "/media/"). It is read from * the ConfigStore at runtime because this library is consumed as a pre-built * bundle, so import.meta.env.BASE_URL would be frozen to the library's own * base instead of the app's. * * @param {string|object} src - A PDF URL or a DocumentInitParameters object. * @returns {object} DocumentInitParameters including wasmUrl. */ export function buildPdfSource(src: string | object): object; /** * Reactive variant of buildPdfSource for callsites that pass a ref to usePDF * (so pdf.js reloads when the URL changes). Returns a computed that yields the * enriched parameters when the source has a value, or null otherwise so that * usePDF skips loading. * * @param {import('vue').Ref} srcRef - Reactive PDF source. * @returns {import('vue').ComputedRef} */ export function buildPdfSourceRef(srcRef: Ref): ComputedRef; //# sourceMappingURL=PdfConfigService.d.ts.map