Skip to content
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

Re-export Element type from domhandler #4256

Open
demurgos opened this issue Nov 27, 2024 · 0 comments
Open

Re-export Element type from domhandler #4256

demurgos opened this issue Nov 27, 2024 · 0 comments

Comments

@demurgos
Copy link

demurgos commented Nov 27, 2024

Hello,
I am migrating a project from [email protected] using types "@types/cheerio" @0.22.35 to [email protected].

An issue that I hit is that I am not able to name the type returned by the cheerio $ function: the return type is Cheerio<Element>, but the Element type comes from the domhandler which is not exported.

A workaround would be to add the domhandler lib as a direct dependency of my project, but this brittle as it relies on manually keeping both the direct dependency on domhandler and the one from cheerio in sync. As domhandler types are exposed in the public API of Cheerio, they should be re-exported to ensure reliable usage.

Element is the most prominent example, but all public types should be reachable from the cheerio package. Other examples are AnyNode, Document, or ParentNode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant