We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b8a4a2 commit 221c641Copy full SHA for 221c641
packages/component-type-helpers/index.ts
@@ -13,6 +13,11 @@ export type ComponentSlots<T> =
13
T extends (props: any, ctx: { slots: infer S; attrs: any; emit: any; }, ...args: any) => any ? NonNullable<S> :
14
{};
15
16
+export type ComponentAttrs<T> =
17
+ T extends new (...args: any) => { $attrs: infer A; } ? NonNullable<A> :
18
+ T extends (props: any, ctx: { slots: any; attrs: infer A; emit: any; }, ...args: any) => any ? NonNullable<A> :
19
+ {};
20
+
21
export type ComponentEmit<T> =
22
T extends new (...args: any) => { $emit: infer E; } ? NonNullable<E> :
23
T extends (props: any, ctx: { slots: any; attrs: any; emit: infer E; }, ...args: any) => any ? NonNullable<E> :
0 commit comments