annil 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/api/DefineComponent/assignOptions/computedWatchHandle/computedUpdater.js +3 -2
  3. package/dist/api/DefineComponent/assignOptions/computedWatchHandle/computedUpdater.js.map +1 -1
  4. package/dist/api/DefineComponent/assignOptions/computedWatchHandle/data-tracer.d.ts +0 -1
  5. package/dist/api/DefineComponent/assignOptions/computedWatchHandle/data-tracer.js +2 -13
  6. package/dist/api/DefineComponent/assignOptions/computedWatchHandle/data-tracer.js.map +1 -1
  7. package/dist/api/DefineComponent/assignOptions/computedWatchHandle/initComputed.js +3 -2
  8. package/dist/api/DefineComponent/assignOptions/computedWatchHandle/initComputed.js.map +1 -1
  9. package/dist/api/DefineComponent/assignOptions/index.js +0 -8
  10. package/dist/api/DefineComponent/assignOptions/index.js.map +1 -1
  11. package/dist/api/InstanceInject/instanceConfig.d.ts +5 -2
  12. package/dist/api/InstanceInject/instanceConfig.js.map +1 -1
  13. package/dist/api/RootComponent/CustomEvents/GetCustomEventDoc.d.ts +1 -2
  14. package/dist/api/RootComponent/Instance/RootComponentInstance.d.ts +3 -6
  15. package/dist/api/RootComponent/Observers/ObserversOption.d.ts +2 -3
  16. package/dist/api/RootComponent/Watch/WatchOption.d.ts +2 -3
  17. package/dist/api/RootComponent/index.d.ts +2 -2
  18. package/package.json +1 -1
  19. package/src/api/DefineComponent/ReturnType/test/normalComponentDoc.test.ts +10 -0
  20. package/src/api/DefineComponent/assignOptions/computedWatchHandle/computedUpdater.ts +3 -3
  21. package/src/api/DefineComponent/assignOptions/computedWatchHandle/data-tracer.ts +3 -25
  22. package/src/api/DefineComponent/assignOptions/computedWatchHandle/initComputed.ts +3 -2
  23. package/src/api/DefineComponent/assignOptions/index.ts +12 -12
  24. package/src/api/InstanceInject/instanceConfig.ts +11 -2
  25. package/src/api/RootComponent/Computed/test/normal.test.ts +16 -16
  26. package/src/api/RootComponent/CustomEvents/GetCustomEventDoc.ts +1 -3
  27. package/src/api/RootComponent/CustomEvents/test/GetShortEventDoc.test.ts +1 -2
  28. package/src/api/RootComponent/CustomEvents/test/normal.test.ts +1 -21
  29. package/src/api/RootComponent/Data/test/normal.test.ts +5 -36
  30. package/src/api/RootComponent/Instance/RootComponentInstance.ts +4 -5
  31. package/src/api/RootComponent/Instance/test/properties/mormal.test.ts +9 -4
  32. package/src/api/RootComponent/Observers/ObserversOption.ts +8 -11
  33. package/src/api/RootComponent/Observers/test/normal.test.ts +2 -3
  34. package/src/api/RootComponent/Properties/test/normalEmpty.test.ts +5 -6
  35. package/src/api/RootComponent/Properties/test/normalOptional.test.ts +4 -4
  36. package/src/api/RootComponent/Properties/test/normalRequired.test.ts +4 -4
  37. package/src/api/RootComponent/Watch/WatchOption.ts +17 -23
  38. package/src/api/RootComponent/Watch/test/WatchComputed.test.ts +4 -4
  39. package/src/api/RootComponent/Watch/test/WatchData.test.ts +4 -5
  40. package/src/api/RootComponent/Watch/test/WatchProperties.test.ts +13 -23
  41. package/src/api/RootComponent/index.ts +2 -2
  42. package/src/api/SubComponent/SubComputed/test/normal.test.ts +6 -6
  43. package/src/api/SubComponent/SubData/test/normal.test.ts +5 -5
  44. package/src/api/SubComponent/SubInstance/test/normal.test.ts +4 -4
  45. package/src/api/SubComponent/SubWatch/test/WatchProperties.test.ts +13 -23
  46. package/src/api/SubComponent/SubWatch/test/WatchRootData.test.ts +10 -11
  47. package/src/api/RootComponent/Instance/test/cloneData/error.test.ts +0 -31
  48. package/src/api/RootComponent/Instance/test/cloneData/normal.test.ts +0 -53
  49. package/src/api/SubComponent/SubInstance/test/cloneData/error.test.ts +0 -22
  50. package/src/api/SubComponent/SubInstance/test/cloneData/normal.test.ts +0 -73
@@ -1,5 +1,4 @@
1
1
  import { Checking, type Test } from "hry-types";
2
- import type { ReadonlyDeep } from "hry-types/src/Any/ReadonlyDeep";
3
2
  import { type DetailedType, RootComponent } from "../../../..";
4
3
  import type { Mock_User } from "../../Properties/test/normalRequired.test";
5
4
  import type { CustomEventConstraint, FullCustomEvents, ShortCustomeEvents } from "../CustomEventConstraint";
@@ -71,7 +70,7 @@ type RootDoc = {
71
70
  nothing: undefined;
72
71
  unionStr: "male" | "female";
73
72
  union: string | 0 | 1 | 2 | null;
74
- obj: ReadonlyDeep<Mock_User>;
73
+ obj: Mock_User;
75
74
  // 带options字段 通过联合类型加入。
76
75
  bubbles: string | Bubbles;
77
76
  capturePhase: null | Capture;
@@ -96,22 +95,3 @@ const rootDocNoFields = RootComponent()({});
96
95
 
97
96
  // 3. 无customEvents字段时,Doc中无customEvents字段
98
97
  Checking<typeof rootDocNoFields, {}, Test.Pass>;
99
-
100
- // 4 实例中的对象数组都是readOnlyDeep类型,可以传递给自定义做参数
101
- RootComponent()({
102
- properties: {
103
- obj: Object as DetailedType<Mock_User>,
104
- },
105
- data: {
106
- obj1: {} as Mock_User,
107
- _ddd: {} as Mock_User,
108
- },
109
- customEvents: mock_customEvents,
110
- events: {
111
- ddd() {
112
- this.obj(this.data.obj!);
113
-
114
- this.obj(this.data.obj1);
115
- },
116
- },
117
- });
@@ -1,45 +1,14 @@
1
1
  import { Checking, type Test } from "hry-types";
2
-
3
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
4
- import type { IInjectData } from "../../../InstanceInject/instanceConfig";
2
+ import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
5
3
  import { RootComponent } from "../..";
6
4
 
7
- type Gender = "male" | "female";
8
-
9
- const RootDoc = RootComponent()({
10
- data: {
11
- gender: "male" as Gender, // 联合字面量
12
- num: 123,
13
- _innernalFields: 123, // 内部字段无法在wxml中使用
14
- },
15
- methods: {
16
- foo() {
17
- this.cloneData.num = 123;
18
-
19
- Checking<
20
- typeof this.data,
21
- ReadonlyDeep<{ gender: Gender; num: number; _innernalFields: number } & IInjectData>,
22
- Test.Pass
23
- >;
24
- },
25
- },
26
- });
27
-
28
- type RootDocExpected = {
29
- gender: Gender;
30
- num: number;
31
- _innernalFields: number;
32
- };
33
-
34
- Checking<typeof RootDoc["data"], RootDocExpected, Test.Pass>;
35
-
36
5
  // data为空对象时
37
6
  const EmptyDataRootDoc = RootComponent()({
38
7
  data: {},
39
8
  methods: {
40
9
  M1() {
41
- // 3.1 data为空对象时 this.data为{}类型
42
- Checking<typeof this.data, ReadonlyDeep<IInjectData>, Test.Pass>;
10
+ // 3.1 data为空对象时 this.data为注入数据类型
11
+ Checking<typeof this.data, IInjectAllData, Test.Pass>;
43
12
  },
44
13
  },
45
14
  });
@@ -53,8 +22,8 @@ Checking<typeof EmptyDataRootDoc, { methods: { M1: () => void } }, Test.Pass>;
53
22
  const noDataRootDoc = RootComponent()({
54
23
  methods: {
55
24
  M1() {
56
- // 4.1 data为空对象时 this.data为{}类型
57
- Checking<typeof this.data, ReadonlyDeep<IInjectData>, Test.Pass>;
25
+ // 4.1 data为空对象时 this.data为注入数据类型
26
+ Checking<typeof this.data, IInjectAllData, Test.Pass>;
58
27
  },
59
28
  },
60
29
  });
@@ -1,4 +1,3 @@
1
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
2
1
  import type { IfExtends } from "hry-types/src/Any/IfExtends";
3
2
  import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
4
3
  import type { IReactionDisposer } from "mobx";
@@ -6,7 +5,7 @@ import type { IReactionDisposer } from "mobx";
6
5
  import type { Assign } from "../../../types/Assign";
7
6
  import type { ComputeObject } from "../../../types/ComputeObj";
8
7
  import type { WMComponentInstance, WMInstanceMethods, WMPageInstance } from "../../../types/OfficialTypeAlias";
9
- import type { IInjectData, IInjectMethods } from "../../InstanceInject/instanceConfig";
8
+ import type { IInjectAllData, IInjectMethods } from "../../InstanceInject/instanceConfig";
10
9
  import type { CustomEventMethods } from "./CustomEventMethods";
11
10
  import type { CustomSetData } from "./CustomSetData";
12
11
  export type RootComponentInstance<
@@ -16,7 +15,7 @@ export type RootComponentInstance<
16
15
  AllData extends object,
17
16
  CustomEventsDoc extends object,
18
17
  StoreDoc extends object,
19
- instanceData = ComputeObject<Assign<IInjectData, ComputeIntersection<AllData>>>,
18
+ instanceData = ComputeObject<Assign<IInjectAllData, ComputeIntersection<AllData>>>,
20
19
  > =
21
20
  // 官方实例属性is options dataset等
22
21
  & IfExtends<false, TIsPage, WMComponentInstance, WMPageInstance>
@@ -28,8 +27,8 @@ export type RootComponentInstance<
28
27
  disposer: { [k in keyof StoreDoc]: IReactionDisposer };
29
28
  }>
30
29
  & Assign<IInjectMethods, TMethods & CustomEventMethods<CustomEventsDoc>>
31
- & { data: ReadonlyDeep<instanceData> }
32
- & { cloneData: ComputeObject<Assign<IInjectData, ComputeIntersection<AllData>>> };
30
+ & { data: instanceData };
31
+ // & { cloneData: ComputeObject<Assign<IInjectData, ComputeIntersection<AllData>>> };
33
32
 
34
33
  export type ComponentInstance = RootComponentInstance<false, {}, {}, {}, {}, {}>;
35
34
 
@@ -1,7 +1,7 @@
1
1
  import { Checking, type Test } from "hry-types";
2
- import type { ReadonlyDeep } from "hry-types/src/Any/ReadonlyDeep";
2
+ import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
3
3
  import { type DetailedType, RootComponent } from "../../../../..";
4
- import type { IInjectData } from "../../../../InstanceInject/instanceConfig";
4
+ import type { IInjectAllData } from "../../../../InstanceInject/instanceConfig";
5
5
 
6
6
  // 组件时
7
7
  RootComponent()({
@@ -17,7 +17,12 @@ RootComponent()({
17
17
  // 组件实例对象格外添加null类型
18
18
  Checking<
19
19
  typeof this.data,
20
- ReadonlyDeep<{ optionalObj: { name: string } | null; obj: object | null } & IInjectData>,
20
+ ComputeIntersection<
21
+ {
22
+ optionalObj: { name: string } | null;
23
+ obj: object | null;
24
+ } & IInjectAllData
25
+ >,
21
26
  Test.Pass
22
27
  >;
23
28
  },
@@ -44,7 +49,7 @@ RootComponent()({
44
49
  }, Test.Pass>;
45
50
 
46
51
  // 页面实例对象不额外添加null
47
- Checking<typeof this.data.optionalObj, ReadonlyDeep<{ name: string }>, Test.Pass>;
52
+ Checking<typeof this.data.optionalObj, { name: string }, Test.Pass>;
48
53
 
49
54
  // 页面实例对象不额外添加null
50
55
  Checking<typeof this.data.obj, object, Test.Pass>;
@@ -1,4 +1,3 @@
1
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
2
1
  import type { IfExtends } from "hry-types/src/Any/IfExtends";
3
2
  import type { IsPureObject } from "hry-types/src/Any/IsPureObject";
4
3
  import type { NoInfer } from "hry-types/src/Generic/NoInfer";
@@ -20,15 +19,13 @@ type AddFieldsOfObject<
20
19
  > = {
21
20
  [k in secondKeys]?: (
22
21
  // @ts-ignore
23
- newValue: ReadonlyDeep<
24
- IfExtends<
25
- getLastKeys<k>,
26
- "**",
27
- // @ts-ignore
28
- TWatchData[getFirstKeys<k>],
29
- // @ts-ignore
30
- NonNullable<(Exclude<TWatchData[getFirstKeys<k>], null>)[getLastKeys<k>]>
31
- >
22
+ newValue: IfExtends<
23
+ getLastKeys<k>,
24
+ "**",
25
+ // @ts-ignore
26
+ TWatchData[getFirstKeys<k>],
27
+ // @ts-ignore
28
+ NonNullable<(Exclude<TWatchData[getFirstKeys<k>], null>)[getLastKeys<k>]>
32
29
  >,
33
30
  ) => void;
34
31
  };
@@ -46,7 +43,7 @@ export type ObserversOption<TWatchData extends object, _WatchKeys extends keyof
46
43
  NoInfer<
47
44
  & {
48
45
  [k in _WatchKeys | "**"]?: (
49
- newValue: k extends keyof TWatchData ? ReadonlyDeep<TWatchData[k]> : unknown,
46
+ newValue: k extends keyof TWatchData ? TWatchData[k] : unknown,
50
47
  ) => void;
51
48
  }
52
49
  // 解决单独书写计算书写字段的报错(或许是:ts字面量约束检测提前计算属性key引起的错误提示)
@@ -1,5 +1,4 @@
1
1
  import { Checking, type Test } from "hry-types";
2
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
3
2
 
4
3
  import type { User } from "../../../../../jest/common";
5
4
  import { RootComponent } from "../..";
@@ -10,10 +9,10 @@ RootComponent()({
10
9
  },
11
10
  observers: {
12
11
  obj(a) {
13
- Checking<typeof a, ReadonlyDeep<User> | null, Test.Pass>;
12
+ Checking<typeof a, User | null, Test.Pass>;
14
13
  },
15
14
  "obj.**"(a) {
16
- Checking<typeof a, ReadonlyDeep<User> | null, Test.Pass>;
15
+ Checking<typeof a, User | null, Test.Pass>;
17
16
  },
18
17
  "obj.age"(a) {
19
18
  Checking<typeof a, number, Test.Pass>;
@@ -1,6 +1,5 @@
1
1
  import { Checking, type Test } from "hry-types";
2
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
3
- import type { IInjectData } from "../../../InstanceInject/instanceConfig";
2
+ import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
4
3
  import { RootComponent } from "../..";
5
4
 
6
5
  /**
@@ -10,8 +9,8 @@ const emptyObj = RootComponent()({
10
9
  properties: {},
11
10
  methods: {
12
11
  foo() {
13
- // 1 this.data 为空对象类型
14
- Checking<typeof this.data, ReadonlyDeep<IInjectData>, Test.Pass>;
12
+ // 1 this.data 为注入数据类型
13
+ Checking<typeof this.data, IInjectAllData, Test.Pass>;
15
14
  },
16
15
  },
17
16
  });
@@ -29,8 +28,8 @@ Checking<typeof emptyObj, {
29
28
  const noProperties = RootComponent()({
30
29
  methods: {
31
30
  foo() {
32
- // 3 this.data 为空对象类型
33
- Checking<typeof this.data, ReadonlyDeep<IInjectData>, Test.Pass>;
31
+ // 3 this.data 为注入数据类型
32
+ Checking<typeof this.data, IInjectAllData, Test.Pass>;
34
33
  },
35
34
  },
36
35
  });
@@ -1,7 +1,7 @@
1
1
  import { Checking, type Test } from "hry-types";
2
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
2
+ import type { ComputeIntersection } from "hry-types/src/Object/_api";
3
3
  import type { DetailedType } from "../../../../types/DetailedType";
4
- import type { IInjectData } from "../../../InstanceInject/instanceConfig";
4
+ import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
5
5
  import { RootComponent } from "../..";
6
6
  import { type Mock_User } from "./normalRequired.test";
7
7
 
@@ -48,7 +48,7 @@ const OptionalDoc = RootComponent()({
48
48
  // 1. 内部this.data中的类型(去除可选)
49
49
  Checking<
50
50
  typeof this.data,
51
- ReadonlyDeep<
51
+ ComputeIntersection<
52
52
  {
53
53
  optional_num: number;
54
54
  optional_gender: "male" | "female";
@@ -57,7 +57,7 @@ const OptionalDoc = RootComponent()({
57
57
  optional_objOrNull: Mock_User | null;
58
58
  optional_union: string | number;
59
59
  optional_arr: string[];
60
- } & IInjectData
60
+ } & IInjectAllData
61
61
  >,
62
62
  Test.Pass
63
63
  >;
@@ -1,8 +1,7 @@
1
1
  import { Checking, type Test } from "hry-types";
2
+ import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
2
3
  import type { DetailedType } from "../../../../types/DetailedType";
3
-
4
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
5
- import type { IInjectData } from "../../../InstanceInject/instanceConfig";
4
+ import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
6
5
  import { RootComponent } from "../..";
7
6
  import type { RequiredSingle, RequiredType, RequiredUnion } from "../PropertiesConstraint";
8
7
 
@@ -92,10 +91,11 @@ const RequiredDoc = RootComponent()({
92
91
  methods: {
93
92
  foo() {
94
93
  // 1 this.data中的类型(对象类型加null)
95
- Checking<typeof this.data, ReadonlyDeep<RequiredTypeExpected & IInjectData>, Test.Pass>;
94
+ Checking<typeof this.data, ComputeIntersection<RequiredTypeExpected & IInjectAllData>, Test.Pass>;
96
95
  },
97
96
  },
98
97
  });
98
+
99
99
  /**
100
100
  * 2 properties配置为必传类型时预期文档类型(与this.data一致)
101
101
  */
@@ -1,4 +1,3 @@
1
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
2
1
  import type { IfExtends } from "hry-types/src/Any/IfExtends";
3
2
  import type { IsPureObject } from "hry-types/src/Any/IsPureObject";
4
3
  import type { NoInfer } from "hry-types/src/Generic/NoInfer";
@@ -20,27 +19,22 @@ type AddFieldsOfObject<
20
19
  > = {
21
20
  [k in secondKeys]?: (
22
21
  // @ts-ignore
23
- newValue: ReadonlyDeep<
24
- IfExtends<
25
- getLastKeys<k>,
26
- "**",
27
- // @ts-ignore
28
- Exclude<TWatchData[getFirstKeys<k>], null>,
29
- // @ts-ignore
30
- NonNullable<(Exclude<TWatchData[getFirstKeys<k>], null>)[getLastKeys<k>]>
31
- >
22
+ newValue: IfExtends<
23
+ getLastKeys<k>,
24
+ "**",
25
+ // @ts-ignore
26
+ Exclude<TWatchData[getFirstKeys<k>], null>,
27
+ // @ts-ignore
28
+ NonNullable<(Exclude<TWatchData[getFirstKeys<k>], null>)[getLastKeys<k>]>
32
29
  >,
33
- oldValue: ReadonlyDeep<
34
- IfExtends<
35
- getLastKeys<k>,
36
- "**",
37
- // @ts-ignore
38
- TWatchData[getFirstKeys<k>],
39
- // @ts-ignore
40
- (Exclude<TWatchData[getFirstKeys<k>], null>)[getLastKeys<k>]
41
- >
30
+ oldValue: IfExtends<
31
+ getLastKeys<k>,
32
+ "**",
33
+ // @ts-ignore
34
+ TWatchData[getFirstKeys<k>],
35
+ // @ts-ignore
36
+ (Exclude<TWatchData[getFirstKeys<k>], null>)[getLastKeys<k>]
42
37
  >,
43
- // ReadonlyDeep<(Exclude<TWatchData[getFirstKeys<k>], null>)[getLastKeys<k>]>,
44
38
  ) => void;
45
39
  };
46
40
 
@@ -57,9 +51,9 @@ export type WatchOption<TWatchData extends object, _WatchKeys extends keyof TWat
57
51
  NoInfer<
58
52
  & {
59
53
  [k in _WatchKeys]?: (
60
- // newValue 去除null 深度只读
61
- newValue: ReadonlyDeep<Exclude<TWatchData[k], null>>,
62
- oldValue: ReadonlyDeep<TWatchData[k]>,
54
+ // newValue 去除null
55
+ newValue: Exclude<TWatchData[k], null>,
56
+ oldValue: TWatchData[k],
63
57
  ) => void;
64
58
  }
65
59
  // 解决单独书写计算书写字段的报错(猜测是:ts字面量约束检测提前计算属性key引起的错误提示)
@@ -1,5 +1,5 @@
1
1
  import { Checking, type Test } from "hry-types";
2
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
2
+
3
3
  import type { DetailedType } from "../../../../types/DetailedType";
4
4
  import { RootComponent } from "../..";
5
5
  import type { Mock_User } from "../../Properties/test/normalRequired.test";
@@ -29,10 +29,10 @@ RootComponent()({
29
29
 
30
30
  Checking<number, typeof oldValue, Test.Pass>;
31
31
  },
32
- Cobj(newValue: ReadonlyDeep<Mock_User>, oldValue: ReadonlyDeep<Mock_User> | null) {
33
- Checking<ReadonlyDeep<Mock_User>, typeof newValue, Test.Pass>;
32
+ Cobj(newValue: Mock_User, oldValue: Mock_User | null) {
33
+ Checking<Mock_User, typeof newValue, Test.Pass>;
34
34
 
35
- Checking<ReadonlyDeep<Mock_User> | null, typeof oldValue, Test.Pass>;
35
+ Checking<Mock_User | null, typeof oldValue, Test.Pass>;
36
36
  },
37
37
  },
38
38
  });
@@ -1,6 +1,5 @@
1
1
  import { Checking, type Test } from "hry-types";
2
2
 
3
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
4
3
  import { observable } from "mobx";
5
4
  import { RootComponent } from "../..";
6
5
  import type { Mock_User } from "../../Properties/test/normalRequired.test";
@@ -29,9 +28,9 @@ RootComponent()({
29
28
  Checking<number, typeof oldValue, Test.Pass>;
30
29
  },
31
30
  obj(newValue, oldValue) {
32
- Checking<ReadonlyDeep<Mock_User>, typeof newValue, Test.Pass>;
31
+ Checking<Mock_User, typeof newValue, Test.Pass>;
33
32
 
34
- Checking<ReadonlyDeep<Mock_User>, typeof oldValue, Test.Pass>;
33
+ Checking<Mock_User, typeof oldValue, Test.Pass>;
35
34
  },
36
35
  reactiveNumber(newValue: number, oldValue) {
37
36
  Checking<number, typeof newValue, Test.Pass>;
@@ -44,9 +43,9 @@ RootComponent()({
44
43
  Checking<"male" | "female", typeof oldValue, Test.Pass>;
45
44
  },
46
45
  reactiveUser(newValue, oldValue) {
47
- Checking<ReadonlyDeep<Mock_User>, typeof newValue, Test.Pass>;
46
+ Checking<Mock_User, typeof newValue, Test.Pass>;
48
47
 
49
- Checking<ReadonlyDeep<Mock_User>, typeof oldValue, Test.Pass>;
48
+ Checking<Mock_User, typeof oldValue, Test.Pass>;
50
49
  },
51
50
  },
52
51
  });
@@ -1,5 +1,5 @@
1
1
  import { Checking, type Test } from "hry-types";
2
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
2
+
3
3
  import type { DetailedType } from "../../../..";
4
4
  import { RootComponent } from "../..";
5
5
  import type { OptionalType } from "../../Properties/PropertiesConstraint";
@@ -58,26 +58,16 @@ RootComponent()({
58
58
 
59
59
  Checking<boolean, typeof oldValue, Test.Pass>;
60
60
  },
61
- arr(newValue, oldValue) {
62
- newValue; // readonly ReadonlyDeep<unknown>[]
63
-
64
- oldValue; // readonly ReadonlyDeep<unknown>[]
65
61
 
66
- // ts中很多不是错误的错误,写 typeof newValue 结果是错误
67
- Checking<unknown[], typeof newValue, Test.Fail>;
68
-
69
- // ts中很多不是错误的错误,写 readonly ReadonlyDeep<unknown>[] 结果是正确的
70
- Checking<readonly unknown[], readonly ReadonlyDeep<unknown>[], Test.Pass>;
71
- },
72
62
  obj(newValue, oldValue) {
73
63
  Checking<object, typeof newValue, Test.Pass>;
74
64
 
75
65
  Checking<object | null, typeof oldValue, Test.Pass>;
76
66
  },
77
67
  tuple(newValue, oldValue) {
78
- Checking<readonly [string, number, boolean], typeof newValue, Test.Pass>;
68
+ Checking<[string, number, boolean], typeof newValue, Test.Pass>;
79
69
 
80
- Checking<readonly [string, number, boolean], typeof oldValue, Test.Pass>;
70
+ Checking<[string, number, boolean], typeof oldValue, Test.Pass>;
81
71
  },
82
72
  union_str(newValue, oldValue) {
83
73
  Checking<"male" | "female", typeof newValue, Test.Pass>;
@@ -95,14 +85,14 @@ RootComponent()({
95
85
  Checking<false | true, typeof oldValue, Test.Pass>;
96
86
  },
97
87
  union_arr(newValue, oldValue) {
98
- Checking<readonly number[] | readonly string[], typeof newValue, Test.Pass>;
88
+ Checking<number[] | string[], typeof newValue, Test.Pass>;
99
89
 
100
- Checking<readonly number[] | readonly string[], typeof oldValue, Test.Pass>;
90
+ Checking<number[] | string[], typeof oldValue, Test.Pass>;
101
91
  },
102
92
  union_obj(newValue, oldValue) {
103
- Checking<ReadonlyDeep<Mock_User | Mock_Cart>, typeof newValue, Test.Pass>;
93
+ Checking<Mock_User | Mock_Cart, typeof newValue, Test.Pass>;
104
94
 
105
- Checking<ReadonlyDeep<Mock_User | Mock_Cart | null>, typeof oldValue, Test.Pass>;
95
+ Checking<Mock_User | Mock_Cart | null, typeof oldValue, Test.Pass>;
106
96
  },
107
97
  // 必传多类型联合
108
98
  union_str_num_bool(newValue, oldValue) {
@@ -116,9 +106,9 @@ RootComponent()({
116
106
  Checking<0 | 1 | 2 | "male" | "female", typeof oldValue, Test.Pass>;
117
107
  },
118
108
  union_mockUser_num(newValue, oldValue) {
119
- Checking<ReadonlyDeep<number | Mock_User>, typeof newValue, Test.Pass>;
109
+ Checking<number | Mock_User, typeof newValue, Test.Pass>;
120
110
 
121
- Checking<ReadonlyDeep<number | Mock_User | null>, typeof oldValue, Test.Pass>;
111
+ Checking<number | Mock_User | null, typeof oldValue, Test.Pass>;
122
112
  },
123
113
  // 可选字段
124
114
  optional_gender(newValue, oldValue) {
@@ -132,9 +122,9 @@ RootComponent()({
132
122
  Checking<number, typeof oldValue, Test.Pass>;
133
123
  },
134
124
  optional_obj(newValue, oldValue) {
135
- Checking<ReadonlyDeep<Mock_User>, typeof newValue, Test.Pass>;
125
+ Checking<Mock_User, typeof newValue, Test.Pass>;
136
126
 
137
- Checking<ReadonlyDeep<Mock_User | null>, typeof oldValue, Test.Pass>;
127
+ Checking<Mock_User | null, typeof oldValue, Test.Pass>;
138
128
  },
139
129
  // 对象的二段key
140
130
  "optional_obj.age"(newValue, oldValue) {
@@ -143,9 +133,9 @@ RootComponent()({
143
133
  Checking<number | undefined, typeof oldValue, Test.Pass>;
144
134
  },
145
135
  "optional_obj.**"(newValue, oldValue) {
146
- Checking<ReadonlyDeep<Mock_User>, typeof newValue, Test.Pass>;
136
+ Checking<Mock_User, typeof newValue, Test.Pass>;
147
137
 
148
- Checking<ReadonlyDeep<Mock_User | null>, typeof oldValue, Test.Pass>;
138
+ Checking<Mock_User | null, typeof oldValue, Test.Pass>;
149
139
  },
150
140
  "optional_obj.id"(newValue, oldValue) {
151
141
  Checking<string, typeof newValue, Test.Pass>;
@@ -5,7 +5,7 @@ import type { ComputeIntersection } from "hry-types/src/Object/_api";
5
5
  import type { ComputeObject } from "../../types/ComputeObj";
6
6
  import type { WMCompOtherOption } from "../../types/OfficialTypeAlias";
7
7
  import type { ComponentDoc } from "../DefineComponent/ReturnType/ComponentDoc";
8
- import type { IInjectData, IInjectStore } from "../InstanceInject/instanceConfig";
8
+ import type { IInjectAllData, IInjectStore } from "../InstanceInject/instanceConfig";
9
9
  import type { ComputedConstraint } from "./Computed/ComputedConstraint";
10
10
  import type { ComputedOption } from "./Computed/ComputedOption";
11
11
  import type { GetComputedDoc } from "./Computed/GetComputedDoc";
@@ -58,7 +58,7 @@ type RootComponentOptions<
58
58
  & ComputedOption<
59
59
  TComputed,
60
60
  keyof (PropertiesDoc & DataDoc & StoreDoc),
61
- { data: ComputeObject<DataDoc & Required<PropertiesDoc> & StoreDoc & ComputedDoc & IInjectData> }
61
+ { data: ComputeObject<DataDoc & Required<PropertiesDoc> & StoreDoc & ComputedDoc & IInjectAllData> }
62
62
  >
63
63
  & PageLifetimesOption<TIsPage, PropertiesDoc>
64
64
  & LifetimesOption
@@ -1,8 +1,8 @@
1
1
  import { Checking, type Test } from "hry-types";
2
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
3
2
  import type { ComponentDoc } from "../../../DefineComponent/ReturnType/ComponentDoc";
4
3
 
5
- import type { IInjectData } from "../../../InstanceInject/instanceConfig";
4
+ import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
5
+ import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
6
6
  import type { Mock_User } from "../../../RootComponent/Properties/test/normalRequired.test";
7
7
  import { SubComponent } from "../..";
8
8
 
@@ -81,7 +81,7 @@ SubComponent<Root, OnlyPropsCompDoc>()({
81
81
  // 5 this.data
82
82
  Checking<
83
83
  typeof this.data,
84
- ReadonlyDeep<
84
+ ComputeIntersection<
85
85
  {
86
86
  num: number;
87
87
  user: User | null;
@@ -92,7 +92,7 @@ SubComponent<Root, OnlyPropsCompDoc>()({
92
92
  aaa_num123: 123;
93
93
  aaa_str: "a" | "b";
94
94
  aaa_obj: Mock_User | null;
95
- } & IInjectData
95
+ } & IInjectAllData
96
96
  >,
97
97
  Test.Pass
98
98
  >;
@@ -105,7 +105,7 @@ SubComponent<Root, OnlyPropsCompDoc>()({
105
105
  // 5 this.data 深度只读
106
106
  Checking<
107
107
  typeof this.data,
108
- ReadonlyDeep<
108
+ ComputeIntersection<
109
109
  {
110
110
  num: number;
111
111
  user: User | null;
@@ -116,7 +116,7 @@ SubComponent<Root, OnlyPropsCompDoc>()({
116
116
  aaa_num123: 123;
117
117
  aaa_str: "a" | "b";
118
118
  aaa_obj: Mock_User | null;
119
- } & IInjectData
119
+ } & IInjectAllData
120
120
  >,
121
121
  Test.Pass
122
122
  >;
@@ -1,8 +1,8 @@
1
1
  import { Checking, type Test } from "hry-types";
2
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
3
2
  import type { ComponentDoc } from "../../../DefineComponent/ReturnType/ComponentDoc";
4
3
 
5
- import type { IInjectData } from "../../../InstanceInject/instanceConfig";
4
+ import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
5
+ import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
6
6
  import type { Mock_User } from "../../../RootComponent/Properties/test/normalRequired.test";
7
7
  import { SubComponent } from "../..";
8
8
 
@@ -51,13 +51,13 @@ SubComponent<{}, CompDoc>()({
51
51
  // 4 this.data中的data配置数据
52
52
  Checking<
53
53
  typeof this.data,
54
- ReadonlyDeep<
54
+ ComputeIntersection<
55
55
  {
56
56
  _aaa_str: string;
57
57
  aaa_str: "a" | "b";
58
58
  aaa_num: number;
59
59
  aaa_obj: Mock_User | null;
60
- } & IInjectData
60
+ } & IInjectAllData
61
61
  >,
62
62
  Test.Pass
63
63
  >;
@@ -72,7 +72,7 @@ SubComponent<{ data: { _num: number } }, CompDoc>()({
72
72
  },
73
73
  lifetimes: {
74
74
  attached() {
75
- Checking<typeof this.data.aaa_obj, ReadonlyDeep<Mock_User | null>, Test.Pass>;
75
+ Checking<typeof this.data.aaa_obj, Mock_User | null, Test.Pass>;
76
76
 
77
77
  this.setData({
78
78
  aaa_obj: {} as Mock_User, // aaa_obj 类型为 Mock_User | null 而非 null
@@ -1,8 +1,8 @@
1
1
  import { Checking, type Test } from "hry-types";
2
- import type { ReadonlyDeep } from "hry-types/src/Any/_api";
3
2
  import type { ComponentDoc } from "../../../DefineComponent/ReturnType/ComponentDoc";
4
3
 
5
- import type { IInjectData } from "../../../InstanceInject/instanceConfig";
4
+ import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
5
+ import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
6
6
  import type { Mock_User } from "../../../RootComponent/Properties/test/normalRequired.test";
7
7
  import type { RootComponentDoc } from "../../../RootComponent/RootComponentDoc";
8
8
  import { SubComponent } from "../..";
@@ -55,7 +55,7 @@ SubComponent<RootDoc, CompDoc>()({
55
55
  // this.data
56
56
  Checking<
57
57
  typeof this.data,
58
- ReadonlyDeep<
58
+ ComputeIntersection<
59
59
  {
60
60
  // RootData
61
61
  Pstr: string;
@@ -65,7 +65,7 @@ SubComponent<RootDoc, CompDoc>()({
65
65
  Cnum: number;
66
66
  // 自身Data类型与CompDoc类型相同
67
67
  aaa_str: string;
68
- } & IInjectData
68
+ } & IInjectAllData
69
69
  >,
70
70
  Test.Pass
71
71
  >;