Skip to content

Commit af563bf

Browse files
committed
fix(types): more public type argument order fix
1 parent bdf557f commit af563bf

File tree

3 files changed

+40
-21
lines changed

3 files changed

+40
-21
lines changed

packages/runtime-core/src/apiDefineComponent.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ export type DefineComponent<
6565
Mixin,
6666
Extends,
6767
E,
68-
S,
6968
PP & Props,
7069
Defaults,
71-
true
70+
true,
71+
{},
72+
S
7273
> &
7374
Props
7475
> &
@@ -82,8 +83,10 @@ export type DefineComponent<
8283
Extends,
8384
E,
8485
EE,
85-
S,
86-
Defaults
86+
Defaults,
87+
{},
88+
string,
89+
S
8790
> &
8891
PP
8992

packages/runtime-core/src/componentOptions.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ export interface ComponentOptionsBase<
106106
Extends extends ComponentOptionsMixin,
107107
E extends EmitsOptions,
108108
EE extends string = string,
109-
S extends SlotsType = {},
110109
Defaults = {},
111110
I extends ComponentInjectOptions = {},
112-
II extends string = string
111+
II extends string = string,
112+
S extends SlotsType = {}
113113
> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II>,
114114
ComponentInternalOptions,
115115
ComponentCustomOptions {
@@ -233,10 +233,10 @@ export type ComponentOptionsWithoutProps<
233233
Extends,
234234
E,
235235
EE,
236-
S,
237236
{},
238237
I,
239-
II
238+
II,
239+
S
240240
> & {
241241
props?: undefined
242242
} & ThisType<
@@ -249,11 +249,11 @@ export type ComponentOptionsWithoutProps<
249249
Mixin,
250250
Extends,
251251
E,
252-
S,
253252
PE,
254253
{},
255254
false,
256-
I
255+
I,
256+
S
257257
>
258258
>
259259

@@ -281,10 +281,10 @@ export type ComponentOptionsWithArrayProps<
281281
Extends,
282282
E,
283283
EE,
284-
S,
285284
{},
286285
I,
287-
II
286+
II,
287+
S
288288
> & {
289289
props: PropNames[]
290290
} & ThisType<
@@ -297,11 +297,11 @@ export type ComponentOptionsWithArrayProps<
297297
Mixin,
298298
Extends,
299299
E,
300-
S,
301300
Props,
302301
{},
303302
false,
304-
I
303+
I,
304+
S
305305
>
306306
>
307307

@@ -330,10 +330,10 @@ export type ComponentOptionsWithObjectProps<
330330
Extends,
331331
E,
332332
EE,
333-
S,
334333
Defaults,
335334
I,
336-
II
335+
II,
336+
S
337337
> & {
338338
props: PropsOptions & ThisType<void>
339339
} & ThisType<
@@ -346,11 +346,11 @@ export type ComponentOptionsWithObjectProps<
346346
Mixin,
347347
Extends,
348348
E,
349-
S,
350349
Props,
351350
Defaults,
352351
false,
353-
I
352+
I,
353+
S
354354
>
355355
>
356356

packages/runtime-core/src/componentPublicInstance.ts

+19-3
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ type MixinToOptionTypes<T> = T extends ComponentOptionsBase<
8989
infer Extends,
9090
any,
9191
any,
92+
infer Defaults,
9293
any,
93-
infer Defaults
94+
any,
95+
any
9496
>
9597
? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> &
9698
IntersectionMixin<Mixin> &
@@ -142,11 +144,11 @@ export type CreateComponentPublicInstance<
142144
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,
143145
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
144146
E extends EmitsOptions = {},
145-
S extends SlotsType = {},
146147
PublicProps = P,
147148
Defaults = {},
148149
MakeDefaultsOptional extends boolean = false,
149150
I extends ComponentInjectOptions = {},
151+
S extends SlotsType = {},
150152
PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>,
151153
PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>,
152154
PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>,
@@ -167,7 +169,21 @@ export type CreateComponentPublicInstance<
167169
PublicProps,
168170
PublicDefaults,
169171
MakeDefaultsOptional,
170-
ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, S, Defaults>,
172+
ComponentOptionsBase<
173+
P,
174+
B,
175+
D,
176+
C,
177+
M,
178+
Mixin,
179+
Extends,
180+
E,
181+
string,
182+
Defaults,
183+
{},
184+
string,
185+
S
186+
>,
171187
I,
172188
S
173189
>

0 commit comments

Comments
 (0)