New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pdfjs to @types/react-pdf #417
Comments
Maybe @CodeDaraW who created the types could be of any help? |
You can import pdfjs from |
I added basic support for this by exporting import { Document, Page, pdfjs } from 'react-pdf';
pdfjs.GlobalWorkerOptions.workerSrc =
`//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`; Example above now works in TypeScript. |
This has been merged as is now available in Thanks @CodeDaraW for review. |
Maybe @wojtekmaj can close the issue now. |
Wow! Thanks so much to everyone involved. |
Before you start - checklist
Is your feature request related to a problem? Please describe.
When importing pdfjs from the package (to define the remote worker) typescript can't compile because the definition doesn't exist on DefinitelyTyped
Describe the solution you'd like
Add the definition to the package
The text was updated successfully, but these errors were encountered: