1
- import { ExtractPropTypes } from './componentProps'
1
+ import { ExtractDefaultPropTypes , ExtractPropTypes } from './componentProps'
2
2
import { ShallowUnwrapRef } from '..'
3
3
import { Data } from './common'
4
4
@@ -22,10 +22,16 @@ export type ComponentRenderProxy<
22
22
D = { } , // return from data()
23
23
C extends ComputedOptions = { } ,
24
24
M extends MethodOptions = { } ,
25
- PublicProps = P
25
+ PublicProps = P ,
26
+ Defaults = { } ,
27
+ MakeDefaultsOptional extends boolean = false
26
28
> = {
27
29
$data : D
28
- $props : Readonly < P & PublicProps >
30
+ $props : Readonly <
31
+ MakeDefaultsOptional extends true
32
+ ? Partial < Defaults > & Omit < P & PublicProps , keyof Defaults >
33
+ : P & PublicProps
34
+ >
29
35
$attrs : Data
30
36
} & Readonly < P > &
31
37
ShallowUnwrapRef < B > &
@@ -39,7 +45,12 @@ type VueConstructorProxy<PropsOptions, RawBindings> = VueConstructor & {
39
45
new ( ...args : any [ ] ) : ComponentRenderProxy <
40
46
ExtractPropTypes < PropsOptions > ,
41
47
ShallowUnwrapRef < RawBindings > ,
42
- ExtractPropTypes < PropsOptions >
48
+ ExtractPropTypes < PropsOptions > ,
49
+ { } ,
50
+ { } ,
51
+ ExtractPropTypes < PropsOptions > ,
52
+ ExtractDefaultPropTypes < PropsOptions > ,
53
+ true
43
54
>
44
55
}
45
56
0 commit comments