From: Evan You Date: Thu, 6 Apr 2023 03:12:49 +0000 (+0800) Subject: fix(types): more public type argument order fix X-Git-Tag: v3.3.0-alpha.9~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af563bf428200367b6f5bb7944f690c85d810202;p=thirdparty%2Fvuejs%2Fcore.git fix(types): more public type argument order fix --- diff --git a/packages/runtime-core/src/apiDefineComponent.ts b/packages/runtime-core/src/apiDefineComponent.ts index 5e8e7a8573..722a3693e3 100644 --- a/packages/runtime-core/src/apiDefineComponent.ts +++ b/packages/runtime-core/src/apiDefineComponent.ts @@ -65,10 +65,11 @@ export type DefineComponent< Mixin, Extends, E, - S, PP & Props, Defaults, - true + true, + {}, + S > & Props > & @@ -82,8 +83,10 @@ export type DefineComponent< Extends, E, EE, - S, - Defaults + Defaults, + {}, + string, + S > & PP diff --git a/packages/runtime-core/src/componentOptions.ts b/packages/runtime-core/src/componentOptions.ts index cf459962c4..481c2adb67 100644 --- a/packages/runtime-core/src/componentOptions.ts +++ b/packages/runtime-core/src/componentOptions.ts @@ -106,10 +106,10 @@ export interface ComponentOptionsBase< Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, - S extends SlotsType = {}, Defaults = {}, I extends ComponentInjectOptions = {}, - II extends string = string + II extends string = string, + S extends SlotsType = {} > extends LegacyOptions, ComponentInternalOptions, ComponentCustomOptions { @@ -233,10 +233,10 @@ export type ComponentOptionsWithoutProps< Extends, E, EE, - S, {}, I, - II + II, + S > & { props?: undefined } & ThisType< @@ -249,11 +249,11 @@ export type ComponentOptionsWithoutProps< Mixin, Extends, E, - S, PE, {}, false, - I + I, + S > > @@ -281,10 +281,10 @@ export type ComponentOptionsWithArrayProps< Extends, E, EE, - S, {}, I, - II + II, + S > & { props: PropNames[] } & ThisType< @@ -297,11 +297,11 @@ export type ComponentOptionsWithArrayProps< Mixin, Extends, E, - S, Props, {}, false, - I + I, + S > > @@ -330,10 +330,10 @@ export type ComponentOptionsWithObjectProps< Extends, E, EE, - S, Defaults, I, - II + II, + S > & { props: PropsOptions & ThisType } & ThisType< @@ -346,11 +346,11 @@ export type ComponentOptionsWithObjectProps< Mixin, Extends, E, - S, Props, Defaults, false, - I + I, + S > > diff --git a/packages/runtime-core/src/componentPublicInstance.ts b/packages/runtime-core/src/componentPublicInstance.ts index 7ffa3ab2cf..7b0ccf77ac 100644 --- a/packages/runtime-core/src/componentPublicInstance.ts +++ b/packages/runtime-core/src/componentPublicInstance.ts @@ -89,8 +89,10 @@ type MixinToOptionTypes = T extends ComponentOptionsBase< infer Extends, any, any, + infer Defaults, any, - infer Defaults + any, + any > ? OptionTypesType

& IntersectionMixin & @@ -142,11 +144,11 @@ export type CreateComponentPublicInstance< Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, - S extends SlotsType = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, + S extends SlotsType = {}, PublicMixin = IntersectionMixin & IntersectionMixin, PublicP = UnwrapMixinsType & EnsureNonVoid

, PublicB = UnwrapMixinsType & EnsureNonVoid, @@ -167,7 +169,21 @@ export type CreateComponentPublicInstance< PublicProps, PublicDefaults, MakeDefaultsOptional, - ComponentOptionsBase, + ComponentOptionsBase< + P, + B, + D, + C, + M, + Mixin, + Extends, + E, + string, + Defaults, + {}, + string, + S + >, I, S >