annil 1.5.15 → 1.6.1
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.
- package/CHANGELOG.md +15 -0
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/computedUpdater.js +3 -2
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/computedUpdater.js.map +1 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/data-tracer.d.ts +0 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/data-tracer.js +2 -13
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/data-tracer.js.map +1 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/initComputed.js +3 -2
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/initComputed.js.map +1 -1
- package/dist/api/DefineComponent/assignOptions/index.d.ts +1 -0
- package/dist/api/DefineComponent/assignOptions/index.js +8 -0
- package/dist/api/DefineComponent/assignOptions/index.js.map +1 -1
- package/dist/api/RootComponent/Computed/ComputedOption.d.ts +2 -2
- package/dist/api/RootComponent/CustomEvents/CustomEventsOption.d.ts +2 -2
- package/dist/api/RootComponent/CustomEvents/GetCustomEventDoc.d.ts +1 -2
- package/dist/api/RootComponent/Data/DataOption.d.ts +2 -2
- package/dist/api/RootComponent/Instance/RootComponentInstance.d.ts +5 -2
- package/dist/api/RootComponent/Methods/MethodsOption.d.ts +2 -2
- package/dist/api/RootComponent/Properties/PropertiesOption.d.ts +2 -2
- package/dist/api/RootComponent/Store/StoreOption.d.ts +2 -2
- package/dist/api/RootComponent/index.d.ts +4 -2
- package/dist/api/RootComponent/index.js.map +1 -1
- package/dist/api/SubComponent/SubComputed/SubComputedOption.d.ts +2 -2
- package/dist/api/SubComponent/SubData/SubDataOption.d.ts +3 -4
- package/dist/api/SubComponent/SubEvents/SubEventsOptions.d.ts +2 -2
- package/dist/api/SubComponent/SubInherit/SubInheritOption.d.ts +2 -2
- package/dist/api/SubComponent/SubMethods/SubMethodsOption.d.ts +2 -2
- package/dist/api/SubComponent/SubStore/SubStoreOption.d.ts +3 -4
- package/dist/api/SubComponent/index.d.ts +3 -4
- package/package.json +4 -6
- package/src/api/DefineComponent/ReturnType/test/normalComponentDoc.test.ts +10 -0
- package/src/api/DefineComponent/assignOptions/computedWatchHandle/computedUpdater.ts +3 -3
- package/src/api/DefineComponent/assignOptions/computedWatchHandle/data-tracer.ts +3 -25
- package/src/api/DefineComponent/assignOptions/computedWatchHandle/initComputed.ts +3 -2
- package/src/api/DefineComponent/assignOptions/index.ts +14 -1
- package/src/api/RootComponent/Computed/ComputedOption.ts +6 -1
- package/src/api/RootComponent/Computed/GetComputedDoc.ts +3 -1
- package/src/api/RootComponent/Computed/test/error.test.ts +2 -2
- package/src/api/RootComponent/Computed/test/normal.test.ts +13 -11
- package/src/api/RootComponent/CustomEvents/CustomEventsOption.ts +3 -3
- package/src/api/RootComponent/CustomEvents/GetCustomEventDoc.ts +1 -3
- package/src/api/RootComponent/CustomEvents/test/GetShortEventDoc.test.ts +1 -2
- package/src/api/RootComponent/CustomEvents/test/normal.test.ts +1 -2
- package/src/api/RootComponent/Data/DataOption.ts +2 -2
- package/src/api/RootComponent/Data/test/normal.test.ts +2 -0
- package/src/api/RootComponent/Instance/RootComponentInstance.ts +4 -1
- package/src/api/RootComponent/Instance/test/cloneData/error.test.ts +31 -0
- package/src/api/RootComponent/Instance/test/cloneData/normal.test.ts +53 -0
- package/src/api/RootComponent/Methods/MethodsOption.ts +2 -2
- package/src/api/RootComponent/Properties/PropertiesOption.ts +2 -2
- package/src/api/RootComponent/Properties/test/normalRequired.test.ts +3 -3
- package/src/api/RootComponent/Store/StoreOption.ts +2 -2
- package/src/api/RootComponent/index.ts +6 -2
- package/src/api/SubComponent/SubComputed/SubComputedOption.ts +2 -2
- package/src/api/SubComponent/SubComputed/test/error.test.ts +3 -15
- package/src/api/SubComponent/SubComputed/test/normal.test.ts +0 -13
- package/src/api/SubComponent/SubData/SubDataOption.ts +4 -5
- package/src/api/SubComponent/SubData/test/normal.test.ts +0 -11
- package/src/api/SubComponent/SubEvents/SubEventsOptions.ts +2 -2
- package/src/api/SubComponent/SubInherit/SubInheritOption.ts +2 -2
- package/src/api/SubComponent/SubInstance/test/cloneData/error.test.ts +22 -0
- package/src/api/SubComponent/SubInstance/test/cloneData/normal.test.ts +73 -0
- package/src/api/SubComponent/SubMethods/SubMethodsOption.ts +2 -2
- package/src/api/SubComponent/SubStore/SubStoreOption.ts +4 -5
- package/src/api/SubComponent/SubStore/test/error.test.ts +0 -5
- package/src/api/SubComponent/SubStore/test/normal.test.ts +1 -8
- package/src/api/SubComponent/index.ts +12 -12
- package/src/types/Extra.ts +1 -1
- package/dist/types/Extra.d.ts +0 -1
- package/dist/types/Extra.js +0 -2
- package/dist/types/Extra.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { InnerFields } from "../../../types/InnerData";
|
|
1
|
+
import type { G } from "hry-types";
|
|
3
2
|
|
|
4
|
-
export type SubStoreOption<TSubStore extends object, legalKeys extends PropertyKey
|
|
3
|
+
export type SubStoreOption<TSubStore extends object, legalKeys extends PropertyKey> = {
|
|
5
4
|
/**
|
|
6
5
|
* 全局响应式数据字段,全局store对应数据变化实例对应数据自动setData。
|
|
7
6
|
* 约束为组件properties字段去除inherit和data的剩余字段和内部字段
|
|
@@ -18,10 +17,10 @@ export type SubStoreOption<TSubStore extends object, legalKeys extends PropertyK
|
|
|
18
17
|
*/
|
|
19
18
|
store?:
|
|
20
19
|
& TSubStore
|
|
21
|
-
&
|
|
20
|
+
& G.IllegalFieldValidator<
|
|
22
21
|
TSubStore,
|
|
23
22
|
// legalKeys,
|
|
24
|
-
legalKeys
|
|
23
|
+
legalKeys,
|
|
25
24
|
0,
|
|
26
25
|
"",
|
|
27
26
|
"与inherit和data字段重复或前缀错误"
|
|
@@ -25,7 +25,6 @@ SubComponent<{
|
|
|
25
25
|
},
|
|
26
26
|
data: {
|
|
27
27
|
aaa_num: 20,
|
|
28
|
-
aaa_isReady: false,
|
|
29
28
|
},
|
|
30
29
|
store: {
|
|
31
30
|
// @ts-expect-error 1 与 inherit 字段重复
|
|
@@ -34,9 +33,5 @@ SubComponent<{
|
|
|
34
33
|
aaa_num: () => user.age,
|
|
35
34
|
// @ts-expect-error 3 超出约束字段
|
|
36
35
|
num: () => user.age,
|
|
37
|
-
// @ts-expect-error 4 于data字段重复
|
|
38
|
-
aaa_isReady() {
|
|
39
|
-
return false;
|
|
40
|
-
},
|
|
41
36
|
},
|
|
42
37
|
});
|
|
@@ -25,13 +25,6 @@ SubComponent<{}, DocA>()({
|
|
|
25
25
|
SubComponent<{}, DocA, "a">()({
|
|
26
26
|
store: {
|
|
27
27
|
// 2 可写内部字段
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
SubComponent<{}, DocA, "a">()({
|
|
33
|
-
store: {
|
|
34
|
-
// 3 可写特许字段
|
|
35
|
-
aaaA_isReady: () => false,
|
|
28
|
+
_aaaA_xxx: () => user.age,
|
|
36
29
|
},
|
|
37
30
|
});
|
|
@@ -6,7 +6,7 @@ import type { ReplacePrefix } from "../../types/ReplacePrefix";
|
|
|
6
6
|
import type { ComponentDoc } from "../DefineComponent/ReturnType/ComponentDoc";
|
|
7
7
|
|
|
8
8
|
import type { Func } from "hry-types/src/Misc/Func";
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
import type { InnerFields } from "../../types/InnerData";
|
|
11
11
|
import type { WMCompOtherOption } from "../../types/OfficialTypeAlias";
|
|
12
12
|
import type { Replace } from "../../types/Replace";
|
|
@@ -62,18 +62,18 @@ type Options<
|
|
|
62
62
|
& SubInheritOption<TInherit, CompDocKeys>
|
|
63
63
|
& SubDataOption<
|
|
64
64
|
TSubData,
|
|
65
|
-
|
|
66
|
-
Prefix
|
|
65
|
+
// 合法的配置
|
|
66
|
+
Exclude<CompDocKeys, (keyof InheritDoc)> | InnerFields<Prefix>
|
|
67
67
|
>
|
|
68
68
|
& SubStoreOption<
|
|
69
69
|
TSubStore,
|
|
70
|
-
|
|
71
|
-
Prefix
|
|
70
|
+
// 合法的配置
|
|
71
|
+
Exclude<CompDocKeys, (keyof (InheritDoc & SubDataDoc))> | InnerFields<Prefix>
|
|
72
72
|
>
|
|
73
73
|
& SubComputedOption<
|
|
74
74
|
TSubComputed,
|
|
75
75
|
// 合法的配置
|
|
76
|
-
Exclude<CompDocKeys
|
|
76
|
+
Exclude<CompDocKeys, (keyof (InheritDoc & SubDataDoc & SubStoreDoc))> | InnerFields<Prefix>
|
|
77
77
|
>
|
|
78
78
|
// 无需与根组件的events字段重复检测,因为根组件多了bubbles字段,一定不会重复
|
|
79
79
|
& SubEventsOption<TEvents, SubEventsDoc, keyof SubEventsConstraint<CurrentCompDoc>>
|
|
@@ -130,18 +130,18 @@ type SubComponentConstructor<
|
|
|
130
130
|
<
|
|
131
131
|
TInherit extends InheritConstraint<AllRootDataDoc, CurrentCompDoc>,
|
|
132
132
|
TSubData extends SubDataConstraint<
|
|
133
|
-
& Omit<Required<CurrentCompDoc["properties"]
|
|
133
|
+
& Omit<Required<CurrentCompDoc["properties"]>, keyof InheritDoc>
|
|
134
134
|
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
135
135
|
>,
|
|
136
136
|
TSubStore extends SubStoreConstraint<
|
|
137
|
-
& Omit<Required<CurrentCompDoc["properties"]
|
|
137
|
+
& Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc)>
|
|
138
138
|
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
139
139
|
>,
|
|
140
140
|
TEvents extends SubEventsConstraint<CurrentCompDoc>,
|
|
141
141
|
// 加默认值计算字段无提示且需要手写返回类型,不加watch无法对computed监控
|
|
142
142
|
TSubComputed extends SubComputedConstraint<
|
|
143
143
|
& Omit<
|
|
144
|
-
Required<CurrentCompDoc["properties"]
|
|
144
|
+
Required<CurrentCompDoc["properties"]>,
|
|
145
145
|
keyof (InheritDoc & SubDataDoc & SubStoreDoc)
|
|
146
146
|
>
|
|
147
147
|
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
@@ -150,7 +150,7 @@ type SubComponentConstructor<
|
|
|
150
150
|
InheritDoc extends object = IfExtends<InheritConstraint<AllRootDataDoc, CurrentCompDoc>, TInherit, {}, TInherit>,
|
|
151
151
|
SubDataDoc extends object = IfExtends<
|
|
152
152
|
SubDataConstraint<
|
|
153
|
-
& Omit<Required<CurrentCompDoc["properties"]
|
|
153
|
+
& Omit<Required<CurrentCompDoc["properties"]>, keyof InheritDoc>
|
|
154
154
|
& Record<InnerFields<CurrentPrefix>, unknown>
|
|
155
155
|
>,
|
|
156
156
|
TSubData,
|
|
@@ -159,7 +159,7 @@ type SubComponentConstructor<
|
|
|
159
159
|
>,
|
|
160
160
|
SubStoreDoc extends object = IfExtends<
|
|
161
161
|
SubStoreConstraint<
|
|
162
|
-
& Omit<Required<CurrentCompDoc["properties"]
|
|
162
|
+
& Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc)>
|
|
163
163
|
& Record<InnerFields<CurrentPrefix>, unknown>
|
|
164
164
|
>,
|
|
165
165
|
TSubStore,
|
|
@@ -170,7 +170,7 @@ type SubComponentConstructor<
|
|
|
170
170
|
SubComputedDoc extends object = IfExtends<
|
|
171
171
|
SubComputedConstraint<
|
|
172
172
|
& Omit<
|
|
173
|
-
Required<CurrentCompDoc["properties"]
|
|
173
|
+
Required<CurrentCompDoc["properties"]>,
|
|
174
174
|
keyof (InheritDoc & SubDataDoc & SubStoreDoc)
|
|
175
175
|
>
|
|
176
176
|
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
package/src/types/Extra.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type Extra<Prefix extends string> = Record<`${Prefix}_isReady`, boolean>;
|
|
1
|
+
// export type Extra<Prefix extends string> = Record<`${Prefix}_isReady`, boolean>;
|
package/dist/types/Extra.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Extra<Prefix extends string> = Record<`${Prefix}_isReady`, boolean>;
|
package/dist/types/Extra.js
DELETED
package/dist/types/Extra.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Extra.js","sourceRoot":"","sources":["../../src/types/Extra.ts"],"names":[],"mappings":""}
|