File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,23 @@ export type ResolvePropConstructor<T> = T extends string
19
19
? ObjectConstructor
20
20
: any
21
21
22
+ export type ResolvePropType < T > =
23
+ | ResolvePropConstructor < T >
24
+ | ResolvePropConstructor < T > [ ]
25
+ | true
26
+ | null
27
+
22
28
export type ResolvePropOptions < T > = {
23
- [ K in keyof T ] -?: {
24
- type : ResolvePropConstructor < NonNullable < T [ K ] > >
25
- required : Partial < Pick < T , K > > extends Pick < T , K > ? true : false
26
- }
29
+ [ K in keyof T ] -?:
30
+ | {
31
+ type : ResolvePropConstructor < NonNullable < T [ K ] > >
32
+ required : Partial < Pick < T , K > > extends Pick < T , K > ? true : false
33
+ }
34
+ | ResolvePropType < NonNullable < T [ K ] > >
27
35
}
28
36
29
37
export const definePropType = < T > (
30
- type ?: ResolvePropConstructor < T > | ResolvePropConstructor < T > [ ] | true | null
38
+ type ?: ResolvePropType < T > | { type : ResolvePropType < T > }
31
39
) : PropType < T > => type as PropType < T >
32
40
33
41
export type ComponentObjectPropsOptions = ComponentPropsOptions & Record < string , any >
You can’t perform that action at this time.
0 commit comments