|
1 | 1 | export type ComponentType<T> =
|
2 |
| - T extends new (...angs: any) => {} ? 1 : |
| 2 | + T extends new (...args: any) => {} ? 1 : |
3 | 3 | T extends (...args: any) => any ? 2 :
|
4 | 4 | 0;
|
5 | 5 |
|
6 | 6 | export type ComponentProps<T> =
|
7 |
| - T extends new (...angs: any) => { $props: infer P; } ? NonNullable<P> : |
| 7 | + T extends new (...args: any) => { $props: infer P; } ? NonNullable<P> : |
8 | 8 | T extends (props: infer P, ...args: any) => any ? P :
|
9 | 9 | {};
|
10 | 10 |
|
11 | 11 | export type ComponentSlots<T> =
|
12 |
| - T extends new (...angs: any) => { $slots: infer S; } ? NonNullable<S> : |
| 12 | + T extends new (...args: any) => { $slots: infer S; } ? NonNullable<S> : |
13 | 13 | T extends (props: any, ctx: { slots: infer S; attrs: any; emit: any; }, ...args: any) => any ? NonNullable<S> :
|
14 | 14 | {};
|
15 | 15 |
|
16 | 16 | export type ComponentEmit<T> =
|
17 |
| - T extends new (...angs: any) => { $emit: infer E; } ? NonNullable<E> : |
| 17 | + T extends new (...args: any) => { $emit: infer E; } ? NonNullable<E> : |
18 | 18 | {};
|
19 | 19 |
|
20 | 20 | export type ComponentExposed<T> =
|
21 |
| - T extends new (...angs: any) => infer E ? E : |
| 21 | + T extends new (...args: any) => infer E ? E : |
22 | 22 | T extends (props: any, ctx: any, expose: (exposed: infer E) => any, ...args: any) => any ? NonNullable<E> :
|
23 | 23 | {};
|
24 | 24 |
|
25 | 25 | export const code = `
|
26 | 26 | export type ComponentType<T> =
|
27 |
| - T extends new (...angs: any) => {} ? 1 : |
| 27 | + T extends new (...args: any) => {} ? 1 : |
28 | 28 | T extends (...args: any) => any ? 2 :
|
29 | 29 | 0;
|
30 | 30 |
|
31 | 31 | export type ComponentProps<T> =
|
32 |
| - T extends new (...angs: any) => { $props: infer P; } ? NonNullable<P> : |
| 32 | + T extends new (...args: any) => { $props: infer P; } ? NonNullable<P> : |
33 | 33 | T extends (props: infer P, ...args: any) => any ? P :
|
34 | 34 | {};
|
35 | 35 |
|
36 | 36 | export type ComponentSlots<T> =
|
37 |
| - T extends new (...angs: any) => { $slots: infer S; } ? NonNullable<S> : |
| 37 | + T extends new (...args: any) => { $slots: infer S; } ? NonNullable<S> : |
38 | 38 | T extends (props: any, ctx: { slots: infer S; attrs: any; emit: any; }, ...args: any) => any ? NonNullable<S> :
|
39 | 39 | {};
|
40 | 40 |
|
41 | 41 | export type ComponentEmit<T> =
|
42 |
| - T extends new (...angs: any) => { $emit: infer E; } ? NonNullable<E> : |
| 42 | + T extends new (...args: any) => { $emit: infer E; } ? NonNullable<E> : |
43 | 43 | T extends (props: any, ctx: { slots: any; attrs: any; emit: infer E; }, ...args: any) => any ? NonNullable<E> :
|
44 | 44 | {};
|
45 | 45 |
|
46 | 46 | export type ComponentExposed<T> =
|
47 |
| - T extends new (...angs: any) => infer E ? E : |
| 47 | + T extends new (...args: any) => infer E ? E : |
48 | 48 | T extends (props: any, ctx: { expose(exposed: infer E): any; }, ...args: any) => any ? NonNullable<E> :
|
49 | 49 | {};
|
50 | 50 | `.trim();
|
|
0 commit comments