npm-pdfreader: It is not supporting the TS type declaration.
Describe the bug Could not find a declaration file for module ‘pdf reader’
To Reproduce
- I am using Next JS application with TS support, and getting an error as Could not find a declaration file for module ‘pdf reader’.
import { PdfReader } from "pdfreader";
- Also tried to look for the Type definition file on yarn packages but was not found.
Tq 🙃.
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 3
- Comments: 24 (15 by maintainers)
Hello Team (@adrienjoly and @niemal),
I have created the type declaration files for all the modules and here you can check them. https://github.com/adrienjoly/npm-pdfreader/compare/master...Basavarajrp:npm-pdfreader:master
“Please let me know if I’m heading in the right direction. While I still need to test and refine this further, I would appreciate your input on whether my current progress is on track.”
Version 3.0.1 includes the type definitions your proposed in your pull request. Thank you for your contribution!
You should continue to work on this, I am working on something else but I am happy to provide any input I can.
Hi @adrienjoly ,
Thank you for this guidance, I will work on it and get back to you if any help is needed.
Tq 😊.
Awesome!
Here’s the official procedure on how to add type declarations in a npm package: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package
Here is the steps to follow in order to contribute that change to
pdfreader
’s github repository:Let me know if your need assistance on any of these steps.
Hi, thanks for the heads up!
There are currently no TypeScript types defined for pdfreader. But that would be a nice addition indeed!
I’m guessing that writing a
index.d.td
file in this repo and linkingpackage.json
to it would do.@Basavarajrp, would you be interested in doing it and proposing this evolution as a Pull Request? I can help if needed.