@@ -34,6 +34,13 @@ export type PublicProps = VNodeProps &
34
34
AllowedComponentProps &
35
35
ComponentCustomProps
36
36
37
+ type ResolveProps < PropsOrPropOptions , E extends EmitsOptions > = Readonly <
38
+ PropsOrPropOptions extends ComponentPropsOptions
39
+ ? ExtractPropTypes < PropsOrPropOptions >
40
+ : PropsOrPropOptions
41
+ > &
42
+ ( { } extends E ? { } : EmitsToProps < E > )
43
+
37
44
export type DefineComponent <
38
45
PropsOrPropOptions = { } ,
39
46
RawBindings = { } ,
@@ -44,15 +51,10 @@ export type DefineComponent<
44
51
Extends extends ComponentOptionsMixin = ComponentOptionsMixin ,
45
52
E extends EmitsOptions = { } ,
46
53
EE extends string = string ,
47
- S extends SlotsType = { } ,
48
54
PP = PublicProps ,
49
- Props = Readonly <
50
- PropsOrPropOptions extends ComponentPropsOptions
51
- ? ExtractPropTypes < PropsOrPropOptions >
52
- : PropsOrPropOptions
53
- > &
54
- ( { } extends E ? { } : EmitsToProps < E > ) ,
55
- Defaults = ExtractDefaultPropTypes < PropsOrPropOptions >
55
+ Props = ResolveProps < PropsOrPropOptions , E > ,
56
+ Defaults = ExtractDefaultPropTypes < PropsOrPropOptions > ,
57
+ S extends SlotsType = { }
56
58
> = ComponentPublicInstanceConstructor <
57
59
CreateComponentPublicInstance <
58
60
Props ,
@@ -152,11 +154,25 @@ export function defineComponent<
152
154
Extends ,
153
155
E ,
154
156
EE ,
155
- S ,
156
157
I ,
157
- II
158
+ II ,
159
+ S
158
160
>
159
- ) : DefineComponent < Props , RawBindings , D , C , M , Mixin , Extends , E , EE , S >
161
+ ) : DefineComponent <
162
+ Props ,
163
+ RawBindings ,
164
+ D ,
165
+ C ,
166
+ M ,
167
+ Mixin ,
168
+ Extends ,
169
+ E ,
170
+ EE ,
171
+ PublicProps ,
172
+ ResolveProps < Props , E > ,
173
+ ExtractDefaultPropTypes < Props > ,
174
+ S
175
+ >
160
176
161
177
// overload 3: object format with array props declaration
162
178
// props inferred as { [key in PropNames]?: any }
@@ -173,7 +189,8 @@ export function defineComponent<
173
189
EE extends string = string ,
174
190
S extends SlotsType = { } ,
175
191
I extends ComponentInjectOptions = { } ,
176
- II extends string = string
192
+ II extends string = string ,
193
+ Props = Readonly < { [ key in PropNames ] ?: any } >
177
194
> (
178
195
options : ComponentOptionsWithArrayProps <
179
196
PropNames ,
@@ -185,12 +202,12 @@ export function defineComponent<
185
202
Extends ,
186
203
E ,
187
204
EE ,
188
- S ,
189
205
I ,
190
- II
206
+ II ,
207
+ S
191
208
>
192
209
) : DefineComponent <
193
- Readonly < { [ key in PropNames ] ?: any } > ,
210
+ Props ,
194
211
RawBindings ,
195
212
D ,
196
213
C ,
@@ -199,6 +216,9 @@ export function defineComponent<
199
216
Extends ,
200
217
E ,
201
218
EE ,
219
+ PublicProps ,
220
+ ResolveProps < Props , E > ,
221
+ ExtractDefaultPropTypes < Props > ,
202
222
S
203
223
>
204
224
@@ -230,11 +250,25 @@ export function defineComponent<
230
250
Extends ,
231
251
E ,
232
252
EE ,
233
- S ,
234
253
I ,
235
- II
254
+ II ,
255
+ S
236
256
>
237
- ) : DefineComponent < PropsOptions , RawBindings , D , C , M , Mixin , Extends , E , EE , S >
257
+ ) : DefineComponent <
258
+ PropsOptions ,
259
+ RawBindings ,
260
+ D ,
261
+ C ,
262
+ M ,
263
+ Mixin ,
264
+ Extends ,
265
+ E ,
266
+ EE ,
267
+ PublicProps ,
268
+ ResolveProps < PropsOptions , E > ,
269
+ ExtractDefaultPropTypes < PropsOptions > ,
270
+ S
271
+ >
238
272
239
273
// implementation, close to no-op
240
274
export function defineComponent (
0 commit comments