-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How do you add methods when using typescript? #1778
How do you add methods when using typescript? #1778
Comments
#1407 should be helpful here! |
Hi, this issue should be re-opened. I don't know how #1407 got it working. Perhaps he was using |
How can I get this to work? Types are installed (@types/cheerio). Typescript 3.8.3 |
It compiled for me when uninstalling the |
Hello, this is what I'm using with 1.0.0-rc.9
Defining the method inside the interface was giving me problems when calling functions that accept |
As proposed by @n1xx1 in #1778 (comment) Co-Authored-By: n1xx1 <680445+n1xx1@users.noreply.github.com>
As proposed by @n1xx1 in #1778 (comment) Co-authored-by: n1xx1 <680445+n1xx1@users.noreply.github.com>
Just want to add, you need to include |
I believe I might have found an issue with how cheerio exports types, but I'm new to typescript, so I'm not sure I'm not just missing how to get it done.
I'm running v1.0.0-rc.5, and I'd like to be able to add some methods to the
Cheerio
interface, so that when I run a selector query, I get back the full api (both mine and the core methods). I had better luck using@types/cheerio
, as it seemed to expose more of the API, but I wasn't able to get it fully working there either. For that reason, I'm not sure #1682 is going to fully solve the problem.I'd like to be able to include a code sample, but working against v1, nothing I came up with is close. If it is possible with the current release, I'd just like to know how to do it. Thanks!
The text was updated successfully, but these errors were encountered: