Skip to content

Re-export Element type from domhandler #4256

@demurgos

Description

@demurgos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions