Skip to content

TSX component typing does not include PublicProps attributes #143

Open
@s-elo

Description

@s-elo

when using tsx, there is no intrinsic typing for class, style which are included in DefineComponent typing.

may be we can add these typing at TSX, instead of extends them at each component's Props interface?

import type { PublicProps } from 'vue';

export declare function TSX<Properties extends {} = {}, Events extends {} = {}>(): <C extends VueCons<{}>>(cons: C) => new () => Omit<ComponentPublicInstance<InstanceType<C>["$props"] & Properties & { [index in keyof Events as `on${Capitalize<index & string>}`]: Events[index] extends Function ? Events[index] : (param: Events[index]) => any; }>, keyof Properties | keyof { [index in keyof Events as `on${Capitalize<index & string>}`]: Events[index] extends Function ? Events[index] : (param: Events[index]) => any; }> & InstanceType<C> 
// add extra attributes
& { $props?: PublicProps };

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