vinodnimbalkar / svelte-pdf

svelte-pdf provides a component for rendering PDF documents using PDF.js
https://www.npmjs.com/package/svelte-pdf
MIT License
206 stars 48 forks source link

Typescript compiler expects data prop #86

Open lewisjr opened 6 months ago

lewisjr commented 6 months ago

When importing svelte-pdf as per the docs, typescript flags my <PdfViewer {url} /> and expects me to add the data prop. Please fix as the docs state that this is not required.

I'm using svelte-pdf v1.0.20

lewisjr commented 6 months ago

Found the solution, in PdfViewer.svelte, change line 8 from:

export let data;

to

export let data = undefined;

which should update the PdfViewer.svelte.d.ts lines 5 and 26 to data?: any;