-
Notifications
You must be signed in to change notification settings - Fork 373
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
Unable to use this library in TypeScript #273
Comments
try es6class branch, it has ESM support. |
@modesty using the es6class branch I am still running into the same issue package.json
|
pdf2json has no Typescript types. |
Is it fixed now?. Because I am also not able to use this lib with Typescript. |
Something I came across when trying to do pdfParser.getRawTextContent(): I was getting a blank string. In order to fix this, you have two options:
I found the above type definition by right clicking on PDFParser and clicking 'Go to Type Definition' in vscode. Since these types were not created by the actual maintainer, and from a PR from another dev, it is not expected that they would be fully correct.
Then, I got getRawTextContent() to work like so:
|
Ran into similar issue as @tuffstuff9. Here's another workaround: #327 |
See this comment for an improved workaround: #327 (comment) |
try v3.1.2 please, it has type defs |
On trying to import this library in TypeScript error "Could not find a declaration file for module 'pdf2json'. '/home/shahab/InboxHealth/pdfparser/node_modules/pdf2json/pdfparser.js' implicitly has an 'any' type.
Try
npm i --save-dev @types/pdf2json
if it exists or add a new declaration (.d.ts) file containingdeclare module 'pdf2json';
ts(7016)" is thrown.import * as pdf2json from 'pdf2json'
I tried installing the @types for pdf2json but getting error that types for pdf2json are not present in the registry.
Is this module officially for TypeScript like other modules?
The text was updated successfully, but these errors were encountered: