]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(types): more public type argument order fix
authorEvan You <yyx990803@gmail.com>
Thu, 6 Apr 2023 03:12:49 +0000 (11:12 +0800)
committerEvan You <yyx990803@gmail.com>
Thu, 6 Apr 2023 03:12:49 +0000 (11:12 +0800)
packages/runtime-core/src/apiDefineComponent.ts
packages/runtime-core/src/componentOptions.ts
packages/runtime-core/src/componentPublicInstance.ts

index 5e8e7a8573541dc38bb8baa6763e4b1768312877..722a3693e3f4f616a5843c242c306668cfabca23 100644 (file)
@@ -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
 
index cf459962c446c4a148bf275024429efa2667b8ad..481c2adb67e227da0829cf0a09b6f9d7c53e2859 100644 (file)
@@ -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<Props, D, C, M, Mixin, Extends, I, II>,
     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<void>
 } & ThisType<
@@ -346,11 +346,11 @@ export type ComponentOptionsWithObjectProps<
       Mixin,
       Extends,
       E,
-      S,
       Props,
       Defaults,
       false,
-      I
+      I,
+      S
     >
   >
 
index 7ffa3ab2cf951ce3238785a33d5e77bab7824a39..7b0ccf77ac99640224f9372533b61389e81e509a 100644 (file)
@@ -89,8 +89,10 @@ type MixinToOptionTypes<T> = T extends ComponentOptionsBase<
   infer Extends,
   any,
   any,
+  infer Defaults,
   any,
-  infer Defaults
+  any,
+  any
 >
   ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> &
       IntersectionMixin<Mixin> &
@@ -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<Mixin> & IntersectionMixin<Extends>,
   PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>,
   PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>,
@@ -167,7 +169,21 @@ export type CreateComponentPublicInstance<
   PublicProps,
   PublicDefaults,
   MakeDefaultsOptional,
-  ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, S, Defaults>,
+  ComponentOptionsBase<
+    P,
+    B,
+    D,
+    C,
+    M,
+    Mixin,
+    Extends,
+    E,
+    string,
+    Defaults,
+    {},
+    string,
+    S
+  >,
   I,
   S
 >