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

TSX component typing does not include PublicProps attributes #143

Open
s-elo opened this issue Dec 16, 2024 · 0 comments
Open

TSX component typing does not include PublicProps attributes #143

s-elo opened this issue Dec 16, 2024 · 0 comments

Comments

@s-elo
Copy link

s-elo commented Dec 16, 2024

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 };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant