Skip to content

Types for Custom Elements declared on the HTMLElementTagNameMap #2562

@steveworkman

Description

@steveworkman

I'm working with a large custom element library based on Lit and built with TypeScript. The team have created types for all elements and have exposed the types like this:

declare global {
    interface HTMLElementTagNameMap {
        'mc-button': McButton;
    }
}

However, the elements still appear as any types when using them within SFCs with Volar.

image

Can Volar pick up these tags, and if so, what config is required to make it happen?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions