-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Can't create plugins with typescript #1407
Comments
I've found a similar issue in another library: A workaround here is to use the require syntax My tsconfig file is as follow:
|
Typescript interfaces are open, so you should be able to add methods to them like this. |
Thanks for the link but this solution doesn't work. Here is the full code:
|
I've managed to get typescript happy, thanks to this post: microsoft/TypeScript#7148 (comment) I had to define my plugin globally with:
|
Awesome, thanks for updating @remborg! |
Using cheerio with typescript works fine until I try to create a plugin:
Typescript returns me error:
This is normal, since logHtml is not part of '@types/cheerio'. So I've tried to do some module augmentation by adding this after the import:
The previous error is still there and I get a new one:
I'm I doing something wrong or is this an issue with the way the module is created?
EDIT: I'm using node v12.16.3, tsc v3.9.3, @types/cheerio v0.22.18 and cheerio v1.0.0-rc.3
The text was updated successfully, but these errors were encountered: