I need to use pdfjs (current 4.1.392) for text extraction in a sveltekit 4 typescript project. This is how I try to import pdfjs into my src/routes/+page.svelte:
<script lang="ts">import * as pdfjs from 'pdfjs-dist/build/pdf';import pdfjsWorker from 'pdfjs-dist/build/pdf.worker';pdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorker;</script>
However, I get the error message "Invalid 'workerSrc' type".
How can I use pdfjs in sveltekit/typescript?