/** * vue-component-type-helpers * Copy from https://github.com/vuejs/language-tools/tree/master/packages/component-type-helpers */ export type ComponentProps = T extends new () => { $props: infer P; } ? NonNullable

: T extends (props: infer P, ...args: any) => any ? P : {}; export type ComponentSlots = T extends new () => { $slots: infer S; } ? NonNullable : T extends (props: any, ctx: { slots: infer S; attrs: any; emit: any; }, ...args: any) => any ? NonNullable : {}; export type ComponentEmit = T extends new () => { $emit: infer E; } ? NonNullable : T extends (props: any, ctx: { slots: any; attrs: any; emit: infer E; }, ...args: any) => any ? NonNullable : {};