annil 1.15.1 → 1.16.0
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 +7 -0
- package/README.md +0 -2
- package/dist/api/DefineComponent/SubComponents/SubComponentsOption.d.ts +3 -3
- package/dist/api/DefineComponent/index.d.ts +4 -4
- package/dist/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.d.ts +2 -3
- package/dist/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/handleSubComponents.d.ts +2 -2
- package/dist/api/DefineComponent/normalizeOptions/handleSubComponents.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/initComputed/index.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.d.ts +2 -2
- package/dist/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/watchHandler/index.js +3 -3
- package/dist/api/DefineComponent/normalizeOptions/watchHandler/index.js.map +1 -1
- package/dist/api/DefineComponent/returnType/GenerateComponentDoc.d.ts +2 -2
- package/dist/api/DefineComponent/returnType/GetCustomEventDocOfSubDoc.d.ts +3 -3
- package/dist/api/RootComponent/PageLifetimes/PageLifetimesOption.d.ts +1 -3
- package/dist/api/SubComponent/SubComputed/GetSubComputedDoc.d.ts +3 -0
- package/dist/api/SubComponent/SubComputed/GetSubComputedDoc.js +2 -0
- package/dist/api/SubComponent/SubComputed/GetSubComputedDoc.js.map +1 -0
- package/dist/api/SubComponent/SubComputed/SubComputedConstraint.d.ts +3 -0
- package/dist/api/SubComponent/SubComputed/SubComputedConstraint.js +2 -0
- package/dist/api/SubComponent/SubComputed/SubComputedConstraint.js.map +1 -0
- package/dist/api/{CustomComponent/CustomComputed/CustomComputedOption.d.ts → SubComponent/SubComputed/SubComputedOption.d.ts} +1 -1
- package/dist/api/SubComponent/SubComputed/SubComputedOption.js +2 -0
- package/dist/api/SubComponent/SubComputed/SubComputedOption.js.map +1 -0
- package/dist/api/SubComponent/SubData/SubDataConstraint.d.ts +3 -0
- package/dist/api/SubComponent/SubData/SubDataConstraint.js +2 -0
- package/dist/api/SubComponent/SubData/SubDataConstraint.js.map +1 -0
- package/dist/api/{CustomComponent/CustomData/CustomDataOption.d.ts → SubComponent/SubData/SubDataOption.d.ts} +1 -1
- package/dist/api/SubComponent/SubData/SubDataOption.js +2 -0
- package/dist/api/SubComponent/SubData/SubDataOption.js.map +1 -0
- package/dist/api/{CustomComponent/CustomEvents/CustomEventsConstraint.d.ts → SubComponent/SubEvents/SubEventsConstraint.d.ts} +1 -1
- package/dist/api/SubComponent/SubEvents/SubEventsConstraint.js +2 -0
- package/dist/api/SubComponent/SubEvents/SubEventsConstraint.js.map +1 -0
- package/dist/api/{CustomComponent/CustomEvents/CustomEventsOption.d.ts → SubComponent/SubEvents/SubEventsOption.d.ts} +1 -1
- package/dist/api/SubComponent/SubEvents/SubEventsOption.js +2 -0
- package/dist/api/SubComponent/SubEvents/SubEventsOption.js.map +1 -0
- package/dist/api/{CustomComponent/CustomInherit/CustomInheritConstraint.d.ts → SubComponent/SubInherit/SubInheritConstraint.d.ts} +1 -1
- package/dist/api/SubComponent/SubInherit/SubInheritConstraint.js +2 -0
- package/dist/api/SubComponent/SubInherit/SubInheritConstraint.js.map +1 -0
- package/dist/api/{CustomComponent/CustomInherit/CustomInheritOption.d.ts → SubComponent/SubInherit/SubInheritOption.d.ts} +1 -1
- package/dist/api/SubComponent/SubInherit/SubInheritOption.js +2 -0
- package/dist/api/SubComponent/SubInherit/SubInheritOption.js.map +1 -0
- package/dist/api/SubComponent/SubInstance/SubInstance.d.ts +2 -0
- package/dist/api/SubComponent/SubInstance/SubInstance.js.map +1 -0
- package/dist/api/{CustomComponent/CustomLifetimes → SubComponent/SubLifetimes}/SubLifetimesOption.d.ts +1 -1
- package/dist/api/SubComponent/SubLifetimes/SubLifetimesOption.js.map +1 -0
- package/dist/api/SubComponent/SubMethods/SubMethodsConstraint.d.ts +2 -0
- package/dist/api/SubComponent/SubMethods/SubMethodsConstraint.js +2 -0
- package/dist/api/SubComponent/SubMethods/SubMethodsConstraint.js.map +1 -0
- package/dist/api/SubComponent/SubMethods/SubMethodsOption.d.ts +5 -0
- package/dist/api/SubComponent/SubMethods/SubMethodsOption.js +2 -0
- package/dist/api/SubComponent/SubMethods/SubMethodsOption.js.map +1 -0
- package/dist/api/SubComponent/SubObservers/SubObserversOption.d.ts +2 -0
- package/dist/api/SubComponent/SubObservers/SubObserversOption.js +2 -0
- package/dist/api/SubComponent/SubObservers/SubObserversOption.js.map +1 -0
- package/dist/api/SubComponent/SubPageLifetimes/SubPageLifetimesOption.d.ts +2 -0
- package/dist/api/SubComponent/SubPageLifetimes/SubPageLifetimesOption.js +2 -0
- package/dist/api/SubComponent/SubPageLifetimes/SubPageLifetimesOption.js.map +1 -0
- package/dist/api/{CustomComponent/CustomReturnType/CreateCustomComponentDoc.d.ts → SubComponent/SubReturnType/CreateSubComponentDoc.d.ts} +1 -1
- package/dist/api/SubComponent/SubReturnType/CreateSubComponentDoc.js +2 -0
- package/dist/api/SubComponent/SubReturnType/CreateSubComponentDoc.js.map +1 -0
- package/dist/api/{CustomComponent/CustomStore/CustomStoreConstraint.d.ts → SubComponent/SubStore/SubStoreConstraint.d.ts} +1 -1
- package/dist/api/SubComponent/SubStore/SubStoreConstraint.js +2 -0
- package/dist/api/SubComponent/SubStore/SubStoreConstraint.js.map +1 -0
- package/dist/api/{CustomComponent/CustomStore/CustomStoreOption.d.ts → SubComponent/SubStore/SubStoreOption.d.ts} +1 -1
- package/dist/api/SubComponent/SubStore/SubStoreOption.js +2 -0
- package/dist/api/SubComponent/SubStore/SubStoreOption.js.map +1 -0
- package/dist/api/SubComponent/SubWatch/SubWatchOption.d.ts +2 -0
- package/dist/api/SubComponent/SubWatch/SubWatchOption.js +2 -0
- package/dist/api/SubComponent/SubWatch/SubWatchOption.js.map +1 -0
- package/dist/api/SubComponent/index.d.ts +49 -0
- package/dist/api/SubComponent/index.js +4 -0
- package/dist/api/SubComponent/index.js.map +1 -0
- package/dist/api/{CustomComponent → SubComponent}/returnType.d.ts +3 -3
- package/dist/api/SubComponent/returnType.js.map +1 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/DefineComponent/SubComponents/SubComponentsOption.ts +3 -4
- package/src/api/DefineComponent/SubComponents/test/normal.test.ts +3 -3
- package/src/api/DefineComponent/index.ts +8 -8
- package/src/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.ts +2 -3
- package/src/api/DefineComponent/normalizeOptions/handleSubComponents.ts +2 -2
- package/src/api/DefineComponent/normalizeOptions/initComputed/index.ts +0 -9
- package/src/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.ts +2 -2
- package/src/api/DefineComponent/normalizeOptions/watchHandler/index.ts +6 -3
- package/src/api/DefineComponent/returnType/GenerateComponentDoc.ts +2 -2
- package/src/api/DefineComponent/returnType/GetCustomEventDocOfSubDoc.ts +4 -4
- package/src/api/DefineComponent/returnType/test/normalComponentDoc.test.ts +6 -6
- package/src/api/RootComponent/Instance/test/properties/mormal.test.ts +1 -1
- package/src/api/RootComponent/PageLifetimes/PageLifetimesOption.ts +1 -4
- package/src/api/RootComponent/PageLifetimes/test/normal.test.ts +3 -31
- package/src/api/{CustomComponent/CustomComputed/GetCustomComputedDoc.ts → SubComponent/SubComputed/GetSubComputedDoc.ts} +1 -1
- package/src/api/SubComponent/SubComputed/SubComputedConstraint.ts +1 -0
- package/src/api/{CustomComponent/CustomComputed/CustomComputedOption.ts → SubComponent/SubComputed/SubComputedOption.ts} +1 -1
- package/src/api/{CustomComponent/CustomComputed → SubComponent/SubComputed}/test/error.test.ts +7 -7
- package/src/api/{CustomComponent/CustomComputed → SubComponent/SubComputed}/test/normal.test.ts +9 -9
- package/src/api/{CustomComponent/CustomData/CustomDataConstraint.ts → SubComponent/SubData/SubDataConstraint.ts} +1 -1
- package/src/api/{CustomComponent/CustomData/CustomDataOption.ts → SubComponent/SubData/SubDataOption.ts} +1 -1
- package/src/api/{CustomComponent/CustomData → SubComponent/SubData}/test/error.test.ts +5 -5
- package/src/api/{CustomComponent/CustomData → SubComponent/SubData}/test/normal.test.ts +6 -6
- package/src/api/{CustomComponent/CustomEvents/CustomEventsConstraint.ts → SubComponent/SubEvents/SubEventsConstraint.ts} +1 -1
- package/src/api/{CustomComponent/CustomEvents/CustomEventsOption.ts → SubComponent/SubEvents/SubEventsOption.ts} +1 -1
- package/src/api/{CustomComponent/CustomEvents → SubComponent/SubEvents}/test/error.test.ts +3 -3
- package/src/api/{CustomComponent/CustomEvents → SubComponent/SubEvents}/test/normal.test.ts +10 -10
- package/src/api/{CustomComponent/CustomInherit/CustomInheritConstraint.ts → SubComponent/SubInherit/SubInheritConstraint.ts} +1 -1
- package/src/api/{CustomComponent/CustomInherit/CustomInheritOption.ts → SubComponent/SubInherit/SubInheritOption.ts} +1 -1
- package/src/api/{CustomComponent/CustomInherit → SubComponent/SubInherit}/test/error.test.ts +7 -7
- package/src/api/{CustomComponent/CustomInherit → SubComponent/SubInherit}/test/normal.test.ts +5 -5
- package/src/api/{CustomComponent/CustomInstance → SubComponent/SubInstance}/SubInstance.ts +1 -1
- package/src/api/{CustomComponent/CustomInstance → SubComponent/SubInstance}/test/error.test.ts +2 -2
- package/src/api/{CustomComponent/CustomInstance → SubComponent/SubInstance}/test/normal.test.ts +2 -2
- package/src/api/{CustomComponent/CustomLifetimes → SubComponent/SubLifetimes}/SubLifetimesOption.ts +1 -1
- package/src/api/SubComponent/SubMethods/SubMethodsConstraint.ts +3 -0
- package/src/api/{CustomComponent/CustomMethods/CustomMethodsOption.ts → SubComponent/SubMethods/SubMethodsOption.ts} +3 -3
- package/src/api/{CustomComponent/CustomMethods → SubComponent/SubMethods}/test/error.test.ts +3 -3
- package/src/api/{CustomComponent/CustomMethods → SubComponent/SubMethods}/test/normarl.test.ts +3 -3
- package/src/api/SubComponent/SubObservers/SubObserversOption.ts +3 -0
- package/src/api/{CustomComponent/CustomPageLifetimes/CustomPageLifetimesOption.ts → SubComponent/SubPageLifetimes/SubPageLifetimesOption.ts} +1 -1
- package/src/api/{CustomComponent/CustomReturnType/CreateCustomComponentDoc.ts → SubComponent/SubReturnType/CreateSubComponentDoc.ts} +1 -1
- package/src/api/{CustomComponent/CustomReturnType → SubComponent/SubReturnType}/test/error.test.ts +2 -2
- package/src/api/{CustomComponent/CustomReturnType → SubComponent/SubReturnType}/test/normal.test.ts +4 -4
- package/src/api/{CustomComponent/CustomStore/CustomStoreConstraint.ts → SubComponent/SubStore/SubStoreConstraint.ts} +1 -1
- package/src/api/{CustomComponent/CustomStore/CustomStoreOption.ts → SubComponent/SubStore/SubStoreOption.ts} +1 -1
- package/src/api/{CustomComponent/CustomStore → SubComponent/SubStore}/test/error.test.ts +4 -4
- package/src/api/{CustomComponent/CustomStore → SubComponent/SubStore}/test/normal.test.ts +5 -5
- package/src/api/SubComponent/SubWatch/SubWatchOption.ts +3 -0
- package/src/api/{CustomComponent/CustomWatch → SubComponent/SubWatch}/test/WatchComputed.test.ts +2 -2
- package/src/api/{CustomComponent/CustomWatch → SubComponent/SubWatch}/test/WatchProperties.test.ts +2 -2
- package/src/api/{CustomComponent/CustomWatch → SubComponent/SubWatch}/test/WatchRootData.test.ts +2 -2
- package/src/api/{CustomComponent/CustomWatch → SubComponent/SubWatch}/test/WatchSubData.test.ts +3 -3
- package/src/api/{CustomComponent/CustomWatch → SubComponent/SubWatch}/test/WtachInject.test.ts +2 -2
- package/src/api/{CustomComponent/CustomWatch → SubComponent/SubWatch}/test/error.test.ts +5 -5
- package/src/api/{CustomComponent → SubComponent}/index.ts +49 -49
- package/src/api/{CustomComponent → SubComponent}/returnType.ts +6 -6
- package/src/index.ts +2 -4
- package/src/thirdLib/wm/swiper.test.ts +2 -2
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedConstraint.d.ts +0 -1
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedConstraint.js +0 -2
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedConstraint.js.map +0 -1
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedOption.d.ts +0 -10
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedOption.js +0 -2
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedOption.js.map +0 -1
- package/dist/api/ChunkComponent/ChunkData/chunkDataOption.d.ts +0 -9
- package/dist/api/ChunkComponent/ChunkData/chunkDataOption.js +0 -2
- package/dist/api/ChunkComponent/ChunkData/chunkDataOption.js.map +0 -1
- package/dist/api/ChunkComponent/ChunkData/validatePrefix.d.ts +0 -2
- package/dist/api/ChunkComponent/ChunkData/validatePrefix.js +0 -2
- package/dist/api/ChunkComponent/ChunkData/validatePrefix.js.map +0 -1
- package/dist/api/ChunkComponent/ChunkMethods/ChunkMethodsOption.d.ts +0 -10
- package/dist/api/ChunkComponent/ChunkMethods/ChunkMethodsOption.js +0 -2
- package/dist/api/ChunkComponent/ChunkMethods/ChunkMethodsOption.js.map +0 -1
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreConstraint.d.ts +0 -2
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreConstraint.js +0 -2
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreConstraint.js.map +0 -1
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreOption.d.ts +0 -12
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreOption.js +0 -2
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreOption.js.map +0 -1
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsConstraint.d.ts +0 -2
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsConstraint.js +0 -2
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsConstraint.js.map +0 -1
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsOption.d.ts +0 -10
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsOption.js +0 -2
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsOption.js.map +0 -1
- package/dist/api/ChunkComponent/SlotComponentReturnType.d.ts +0 -20
- package/dist/api/ChunkComponent/SlotComponentReturnType.js +0 -2
- package/dist/api/ChunkComponent/SlotComponentReturnType.js.map +0 -1
- package/dist/api/ChunkComponent/index.d.ts +0 -24
- package/dist/api/ChunkComponent/index.js +0 -4
- package/dist/api/ChunkComponent/index.js.map +0 -1
- package/dist/api/CustomComponent/CustomComputed/CustomComputedConstraint.d.ts +0 -3
- package/dist/api/CustomComponent/CustomComputed/CustomComputedConstraint.js +0 -2
- package/dist/api/CustomComponent/CustomComputed/CustomComputedConstraint.js.map +0 -1
- package/dist/api/CustomComponent/CustomComputed/CustomComputedOption.js +0 -2
- package/dist/api/CustomComponent/CustomComputed/CustomComputedOption.js.map +0 -1
- package/dist/api/CustomComponent/CustomComputed/GetCustomComputedDoc.d.ts +0 -3
- package/dist/api/CustomComponent/CustomComputed/GetCustomComputedDoc.js +0 -2
- package/dist/api/CustomComponent/CustomComputed/GetCustomComputedDoc.js.map +0 -1
- package/dist/api/CustomComponent/CustomData/CustomDataConstraint.d.ts +0 -3
- package/dist/api/CustomComponent/CustomData/CustomDataConstraint.js +0 -2
- package/dist/api/CustomComponent/CustomData/CustomDataConstraint.js.map +0 -1
- package/dist/api/CustomComponent/CustomData/CustomDataOption.js +0 -2
- package/dist/api/CustomComponent/CustomData/CustomDataOption.js.map +0 -1
- package/dist/api/CustomComponent/CustomEvents/CustomEventsConstraint.js +0 -2
- package/dist/api/CustomComponent/CustomEvents/CustomEventsConstraint.js.map +0 -1
- package/dist/api/CustomComponent/CustomEvents/CustomEventsOption.js +0 -2
- package/dist/api/CustomComponent/CustomEvents/CustomEventsOption.js.map +0 -1
- package/dist/api/CustomComponent/CustomInherit/CustomInheritConstraint.js +0 -2
- package/dist/api/CustomComponent/CustomInherit/CustomInheritConstraint.js.map +0 -1
- package/dist/api/CustomComponent/CustomInherit/CustomInheritOption.js +0 -2
- package/dist/api/CustomComponent/CustomInherit/CustomInheritOption.js.map +0 -1
- package/dist/api/CustomComponent/CustomInstance/SubInstance.d.ts +0 -2
- package/dist/api/CustomComponent/CustomInstance/SubInstance.js.map +0 -1
- package/dist/api/CustomComponent/CustomLifetimes/SubLifetimesOption.js.map +0 -1
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsConstraint.d.ts +0 -2
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsConstraint.js +0 -2
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsConstraint.js.map +0 -1
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsOption.d.ts +0 -5
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsOption.js +0 -2
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsOption.js.map +0 -1
- package/dist/api/CustomComponent/CustomObservers/CustomObserversOption.d.ts +0 -2
- package/dist/api/CustomComponent/CustomObservers/CustomObserversOption.js +0 -2
- package/dist/api/CustomComponent/CustomObservers/CustomObserversOption.js.map +0 -1
- package/dist/api/CustomComponent/CustomPageLifetimes/CustomPageLifetimesOption.d.ts +0 -2
- package/dist/api/CustomComponent/CustomPageLifetimes/CustomPageLifetimesOption.js +0 -2
- package/dist/api/CustomComponent/CustomPageLifetimes/CustomPageLifetimesOption.js.map +0 -1
- package/dist/api/CustomComponent/CustomReturnType/CreateCustomComponentDoc.js +0 -2
- package/dist/api/CustomComponent/CustomReturnType/CreateCustomComponentDoc.js.map +0 -1
- package/dist/api/CustomComponent/CustomStore/CustomStoreConstraint.js +0 -2
- package/dist/api/CustomComponent/CustomStore/CustomStoreConstraint.js.map +0 -1
- package/dist/api/CustomComponent/CustomStore/CustomStoreOption.js +0 -2
- package/dist/api/CustomComponent/CustomStore/CustomStoreOption.js.map +0 -1
- package/dist/api/CustomComponent/CustomWatch/CustomWatchOption.d.ts +0 -2
- package/dist/api/CustomComponent/CustomWatch/CustomWatchOption.js +0 -2
- package/dist/api/CustomComponent/CustomWatch/CustomWatchOption.js.map +0 -1
- package/dist/api/CustomComponent/index.d.ts +0 -49
- package/dist/api/CustomComponent/index.js +0 -4
- package/dist/api/CustomComponent/index.js.map +0 -1
- package/dist/api/CustomComponent/returnType.js.map +0 -1
- package/src/api/ChunkComponent/ChunkComputed/ChunkComputedConstraint.ts +0 -1
- package/src/api/ChunkComponent/ChunkComputed/ChunkComputedOption.ts +0 -46
- package/src/api/ChunkComponent/ChunkComputed/GetChunkComputedDoc.ts +0 -9
- package/src/api/ChunkComponent/ChunkComputed/test/SlotGetComputedDoc.test.ts +0 -25
- package/src/api/ChunkComponent/ChunkComputed/test/error.test.ts +0 -33
- package/src/api/ChunkComponent/ChunkComputed/test/mock.ts +0 -37
- package/src/api/ChunkComponent/ChunkComputed/test/normal.test.ts +0 -86
- package/src/api/ChunkComponent/ChunkData/chunkDataConstraint.ts +0 -9
- package/src/api/ChunkComponent/ChunkData/chunkDataOption.ts +0 -17
- package/src/api/ChunkComponent/ChunkData/test/error.test.ts +0 -28
- package/src/api/ChunkComponent/ChunkData/test/mock.ts +0 -44
- package/src/api/ChunkComponent/ChunkData/test/normal.test.ts +0 -18
- package/src/api/ChunkComponent/ChunkData/validatePrefix.ts +0 -4
- package/src/api/ChunkComponent/ChunkLifetimes/ChunkLifetimes.test.ts +0 -24
- package/src/api/ChunkComponent/ChunkLifetimes/ChunkPageLifetimes.test.ts +0 -26
- package/src/api/ChunkComponent/ChunkMethods/ChunkMethodsOption.ts +0 -27
- package/src/api/ChunkComponent/ChunkMethods/test/error.test.ts +0 -31
- package/src/api/ChunkComponent/ChunkMethods/test/normal.test.ts +0 -21
- package/src/api/ChunkComponent/ChunkStore/ChunkStoreConstraint.ts +0 -3
- package/src/api/ChunkComponent/ChunkStore/ChunkStoreOption.ts +0 -33
- package/src/api/ChunkComponent/ChunkStore/test/error.test.ts +0 -36
- package/src/api/ChunkComponent/ChunkStore/test/mock.ts +0 -32
- package/src/api/ChunkComponent/ChunkStore/test/normal.test.ts +0 -52
- package/src/api/ChunkComponent/ChunkWatch/test/error.test.ts +0 -28
- package/src/api/ChunkComponent/ChunkWatch/test/normal.test.ts +0 -58
- package/src/api/ChunkComponent/ChunklEvents/ChunkEventsConstraint.ts +0 -3
- package/src/api/ChunkComponent/ChunklEvents/ChunkEventsOption.ts +0 -27
- package/src/api/ChunkComponent/ChunklEvents/test/error.test.ts +0 -24
- package/src/api/ChunkComponent/ChunklEvents/test/normal.test.ts +0 -26
- package/src/api/ChunkComponent/SlotComponentReturnType.ts +0 -32
- package/src/api/ChunkComponent/index.ts +0 -165
- package/src/api/CustomComponent/CustomComputed/CustomComputedConstraint.ts +0 -1
- package/src/api/CustomComponent/CustomMethods/CustomMethodsConstraint.ts +0 -3
- package/src/api/CustomComponent/CustomObservers/CustomObserversOption.ts +0 -3
- package/src/api/CustomComponent/CustomWatch/CustomWatchOption.ts +0 -3
- /package/dist/api/{CustomComponent/CustomInstance → SubComponent/SubInstance}/SubInstance.js +0 -0
- /package/dist/api/{CustomComponent/CustomLifetimes → SubComponent/SubLifetimes}/SubLifetimesOption.js +0 -0
- /package/dist/api/{CustomComponent → SubComponent}/returnType.js +0 -0
- /package/src/api/{CustomComponent/CustomPageLifetimes → SubComponent/SubPageLifetimes}/test/error.test.ts +0 -0
- /package/src/api/{CustomComponent/CustomPageLifetimes → SubComponent/SubPageLifetimes}/test/normal.test.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomComputedConstraint.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomComputed/CustomComputedConstraint.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomComputedOption.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomComputed/CustomComputedOption.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetCustomComputedDoc.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomComputed/GetCustomComputedDoc.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDataConstraint.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomData/CustomDataConstraint.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDataOption.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomData/CustomDataOption.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomEventsConstraint.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomEvents/CustomEventsConstraint.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomEventsOption.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomEvents/CustomEventsOption.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomInheritConstraint.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomInherit/CustomInheritConstraint.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomInheritOption.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomInherit/CustomInheritOption.ts"],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { RootComponentInstance } from "../../RootComponent/Instance/RootComponentInstance";
|
|
2
|
-
export type CustomInstance<TAllMethods extends object, TDataForSetData extends object, AllData extends object, AllCustomEventsDoc extends object, SubStoreDoc extends object> = RootComponentInstance<false, TAllMethods, TDataForSetData, AllData, AllCustomEventsDoc, SubStoreDoc>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SubInstance.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomInstance/SubInstance.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SubLifetimesOption.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomLifetimes/SubLifetimesOption.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomMethodsConstraint.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomMethods/CustomMethodsConstraint.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { G } from "hry-types";
|
|
2
|
-
import type { CustomMethodsConstraint } from "./CustomMethodsConstraint";
|
|
3
|
-
export type CustomMethodsOption<TMethods extends CustomMethodsConstraint, TPrefix extends string, ExcludedKeys extends PropertyKey> = {
|
|
4
|
-
methods?: TMethods & G.KeyValidator<TMethods, `${TPrefix}_${string}`> & G.DuplicateFieldValidator<TMethods, ExcludedKeys>;
|
|
5
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomMethodsOption.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomMethods/CustomMethodsOption.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomObserversOption.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomObservers/CustomObserversOption.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPageLifetimesOption.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomPageLifetimes/CustomPageLifetimesOption.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreateCustomComponentDoc.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomReturnType/CreateCustomComponentDoc.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomStoreConstraint.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomStore/CustomStoreConstraint.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomStoreOption.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomStore/CustomStoreOption.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomWatchOption.js","sourceRoot":"","sources":["../../../../src/api/CustomComponent/CustomWatch/CustomWatchOption.ts"],"names":[],"mappings":""}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
import type { EmptyObject } from "hry-types/src/Misc/EmptyObject";
|
|
3
|
-
import type { RequiredKeys } from "hry-types/src/Object/RequiredKeys";
|
|
4
|
-
import type { Extra } from "../../types/Extra";
|
|
5
|
-
import type { GetComponentPrefix } from "../../types/GetComponentPrefix";
|
|
6
|
-
import type { InnerFields } from "../../types/InnerData";
|
|
7
|
-
import type { WMCompOtherOption } from "../../types/OfficialTypeAlias";
|
|
8
|
-
import type { Replace } from "../../types/Replace";
|
|
9
|
-
import type { ReplacePrefix } from "../../types/ReplacePrefix";
|
|
10
|
-
import type { UnionToComma } from "../../types/UnionToComma.test";
|
|
11
|
-
import type { ComponentDoc } from "../DefineComponent/returnType/ComponentDoc";
|
|
12
|
-
import type { IInjectStore } from "../InstanceInject/instanceConfig";
|
|
13
|
-
import type { RootComponentDefinition } from "../RootComponent/returnType";
|
|
14
|
-
import type { GetStoreDef } from "../RootComponent/Store/GetStoreDef";
|
|
15
|
-
import type { CustomComputedConstraint } from "./CustomComputed/CustomComputedConstraint";
|
|
16
|
-
import type { CustomComputedOption } from "./CustomComputed/CustomComputedOption";
|
|
17
|
-
import type { GetCustomComputedDoc } from "./CustomComputed/GetCustomComputedDoc";
|
|
18
|
-
import type { CustomDataConstraint } from "./CustomData/CustomDataConstraint";
|
|
19
|
-
import type { CustomDataOption } from "./CustomData/CustomDataOption";
|
|
20
|
-
import type { CustomEventsConstraint } from "./CustomEvents/CustomEventsConstraint";
|
|
21
|
-
import type { CustomEventsOption } from "./CustomEvents/CustomEventsOption";
|
|
22
|
-
import type { CustomInheritConstraint } from "./CustomInherit/CustomInheritConstraint";
|
|
23
|
-
import type { CustomInheritOption } from "./CustomInherit/CustomInheritOption";
|
|
24
|
-
import type { CustomInstance } from "./CustomInstance/SubInstance";
|
|
25
|
-
import type { CustomLifetimesOption } from "./CustomLifetimes/SubLifetimesOption";
|
|
26
|
-
import type { CustomMethodsConstraint } from "./CustomMethods/CustomMethodsConstraint";
|
|
27
|
-
import type { CustomMethodsOption } from "./CustomMethods/CustomMethodsOption";
|
|
28
|
-
import type { CustomObserversOption } from "./CustomObservers/CustomObserversOption";
|
|
29
|
-
import type { CustomPageLifetimesOption } from "./CustomPageLifetimes/CustomPageLifetimesOption";
|
|
30
|
-
import type { CreatCustomComponentDoc } from "./CustomReturnType/CreateCustomComponentDoc";
|
|
31
|
-
import type { CustomStoreConstraint } from "./CustomStore/CustomStoreConstraint";
|
|
32
|
-
import type { CustomStoreOption } from "./CustomStore/CustomStoreOption";
|
|
33
|
-
import type { CustomWatchOption } from "./CustomWatch/CustomWatchOption";
|
|
34
|
-
type Options<RootDoc extends RootComponentDefinition, IsPage extends boolean, CurrentCompDoc extends ComponentDoc, Prefix extends string, AllRootDataDoc extends object, TInherit extends object, TSubData extends object, TSubStore extends object, TSubComputed extends object, TEvents extends object, TSubMethods extends CustomMethodsConstraint, InheritDoc extends object, SubDataDoc extends object, SubStoreDoc extends object, SubComputedDoc extends object, SubEventsDoc extends object, SubMethodsDoc extends object, CompDocKeys extends PropertyKey = keyof CurrentCompDoc["properties"]> = CustomInheritOption<TInherit, {
|
|
35
|
-
[k in keyof NoInfer<TInherit>]: k extends keyof (AllRootDataDoc) ? never : k extends CompDocKeys ? k : never;
|
|
36
|
-
}[keyof NoInfer<TInherit>]> & CustomDataOption<TSubData, {
|
|
37
|
-
[k in keyof NoInfer<TSubData>]: k extends keyof (AllRootDataDoc) ? never : k extends Exclude<CompDocKeys, (keyof (InheritDoc))> ? k : k extends InnerFields<Prefix> ? k : never;
|
|
38
|
-
}[keyof NoInfer<TSubData>], "子组件无需此字段或与Inherit字段重复"> & CustomStoreOption<TSubStore, {
|
|
39
|
-
[k in keyof NoInfer<TSubStore>]: k extends keyof (AllRootDataDoc & SubDataDoc) ? never : k extends Exclude<CompDocKeys, (keyof (InheritDoc & SubDataDoc))> ? k : k extends InnerFields<Prefix> ? k : never;
|
|
40
|
-
}[keyof NoInfer<TSubStore>]> & CustomComputedOption<TSubComputed, {
|
|
41
|
-
[k in keyof NoInfer<TSubComputed>]: k extends keyof (AllRootDataDoc & SubDataDoc & SubStoreDoc) ? never : k extends Exclude<CompDocKeys, (keyof (InheritDoc & SubDataDoc & SubStoreDoc))> ? k : k extends InnerFields<Prefix> ? k : never;
|
|
42
|
-
}[keyof NoInfer<TSubComputed>]> & CustomEventsOption<TEvents, SubEventsDoc, keyof CustomEventsConstraint<CurrentCompDoc>> & CustomMethodsOption<TSubMethods, Prefix, keyof (CurrentCompDoc["events"] & SubEventsDoc)> & CustomPageLifetimesOption<IsPage, NonNullable<RootDoc["properties"]>> & CustomLifetimesOption & CustomWatchOption<SubComputedDoc & SubDataDoc & AllRootDataDoc & SubStoreDoc & IInjectStore> & Partial<Omit<WMCompOtherOption, "pageLifetimes" | "definitionFilter" | "export" | "observers" | "relations">> & CustomObserversOption<SubComputedDoc & SubDataDoc & AllRootDataDoc & SubStoreDoc & IInjectStore> & ThisType<CustomInstance<SubMethodsDoc & RootDoc["methods"], Replace<SubDataDoc, Required<CurrentCompDoc["properties"]>>, AllRootDataDoc & Replace<SubDataDoc & SubComputedDoc & SubStoreDoc, Required<CurrentCompDoc["properties"]>>, NonNullable<RootDoc["customEvents"]>, SubStoreDoc>>;
|
|
43
|
-
type CustomComponentConstructor<TRootDoc extends RootComponentDefinition, TOriginalCompDoc extends ComponentDoc, TSupplementalPrefix extends string = "", IsPage extends boolean = TRootDoc["isPage"] extends true ? true : false, CurrentPrefix extends string = `${GetComponentPrefix<TOriginalCompDoc>}${Capitalize<TSupplementalPrefix>}`, CurrentCompDoc extends ComponentDoc = IfExtends<TSupplementalPrefix, "", TOriginalCompDoc & {
|
|
44
|
-
properties: Extra<CurrentPrefix>;
|
|
45
|
-
}, ReplacePrefix<TOriginalCompDoc & {
|
|
46
|
-
properties: Extra<CurrentPrefix>;
|
|
47
|
-
}, CurrentPrefix>>, AllRootDataDoc extends object = Required<TRootDoc["properties"]> & TRootDoc["data"] & TRootDoc["computed"] & TRootDoc["store"]> = <TInherit extends CustomInheritConstraint<AllRootDataDoc, CurrentCompDoc>, TData extends CustomDataConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof InheritDoc> & Record<InnerFields<CurrentPrefix>, unknown>>, TStore extends CustomStoreConstraint<Required<TRootDoc["properties"]>, Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & DataDoc)> & Record<InnerFields<CurrentPrefix>, unknown>>, TEvents extends CustomEventsConstraint<CurrentCompDoc>, TComputed extends CustomComputedConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & DataDoc & StoreDoc)> & Record<InnerFields<CurrentPrefix>, unknown>>, TMethods extends CustomMethodsConstraint = {}, InheritDoc extends object = IfExtends<CustomInheritConstraint<AllRootDataDoc, CurrentCompDoc>, TInherit, {}, TInherit>, DataDoc extends object = IfExtends<CustomDataConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof InheritDoc> & Record<InnerFields<CurrentPrefix>, unknown>>, TData, {}, TData>, StoreDoc extends object = IfExtends<CustomStoreConstraint<Required<TRootDoc["properties"]>, Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & DataDoc)> & Record<InnerFields<CurrentPrefix>, unknown>>, TStore, {}, GetStoreDef<TStore>>, ComputedDoc extends object = IfExtends<CustomComputedConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & DataDoc & StoreDoc)> & Record<InnerFields<CurrentPrefix>, unknown>>, TComputed, {}, GetCustomComputedDoc<TComputed>>, EventsDoc extends object = IfExtends<CustomEventsConstraint<CurrentCompDoc>, TEvents, {}, TEvents>, MethodsDoc extends object = TMethods, MissingRequiredField extends PropertyKey = Exclude<RequiredKeys<NonNullable<CurrentCompDoc["properties"]>>, keyof (InheritDoc & DataDoc & StoreDoc & IfExtends<CustomComputedConstraint<Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & DataDoc & StoreDoc)>>, TComputed, {}, GetCustomComputedDoc<TComputed>>)>>(options: Options<TRootDoc, IsPage, CurrentCompDoc, CurrentPrefix, AllRootDataDoc, TInherit, TData, TStore, TComputed, TEvents, TMethods, InheritDoc, DataDoc, StoreDoc, ComputedDoc, EventsDoc, MethodsDoc>) => IfExtends<MissingRequiredField, never, CreatCustomComponentDoc<NonNullable<CurrentCompDoc["events"]>, EventsDoc>, `缺少必传的字段${UnionToComma<MissingRequiredField & string>}`>;
|
|
48
|
-
export declare function CustomComponent<TRootComponentDefinition extends RootComponentDefinition, TCompDoc extends ComponentDoc, Prefix extends string = "">(): IfExtends<EmptyObject, TCompDoc, (opt: EmptyObject) => never, CustomComponentConstructor<TRootComponentDefinition, TCompDoc, Prefix>>;
|
|
49
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/CustomComponent/index.ts"],"names":[],"mappings":"AAgSA,MAAM,UAAU,eAAe;IAW7B,OAAO,CAAC,CAAC,OAAY,EAAE,EAAE,CAAC,OAAO,CAAQ,CAAC;AAC5C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"returnType.js","sourceRoot":"","sources":["../../../src/api/CustomComponent/returnType.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ChunkComputedConstraint = Record<string, () => void>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { G } from "hry-types";
|
|
2
|
-
import type { Validators } from "../../../types/Validators";
|
|
3
|
-
import type { ValidatorPrefix } from "../ChunkData/validatePrefix";
|
|
4
|
-
import type { ChunkComputedConstraint } from "./ChunkComputedConstraint";
|
|
5
|
-
export type ChunkComputedOption<
|
|
6
|
-
TComputed extends ChunkComputedConstraint,
|
|
7
|
-
CompareKeys extends PropertyKey,
|
|
8
|
-
// Instance extends object,
|
|
9
|
-
TPrefix extends string,
|
|
10
|
-
> = {
|
|
11
|
-
/**
|
|
12
|
-
* computed字段, [类型约束ComputedConstraint](ComputedConstraint.ts)
|
|
13
|
-
* @remarks
|
|
14
|
-
*
|
|
15
|
-
* 函数体内,可通过this.data获取实例其他数据(依赖),setData发生时,若数据(依赖)发生变化则重新运行函数体并setData。
|
|
16
|
-
*
|
|
17
|
-
* 带重复字段检测(与properties、data、store字段比较)
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* ```ts
|
|
22
|
-
* {
|
|
23
|
-
* data:{
|
|
24
|
-
* count:1
|
|
25
|
-
* },
|
|
26
|
-
* computed:{
|
|
27
|
-
* return this.data.count + 1
|
|
28
|
-
* }
|
|
29
|
-
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
computed?:
|
|
35
|
-
& TComputed
|
|
36
|
-
// & ThisType<Instance>
|
|
37
|
-
|
|
38
|
-
// & DuplicateFieldValidator<TComputed, CompareKeys>
|
|
39
|
-
// & G.KeyValidator<TComputed, `${TPrefix}_${string}` | `_${TPrefix}_${string}`>;
|
|
40
|
-
& Validators<
|
|
41
|
-
[
|
|
42
|
-
G.DuplicateFieldValidator<TComputed, CompareKeys, "字段重复">,
|
|
43
|
-
ValidatorPrefix<TComputed, TPrefix>,
|
|
44
|
-
]
|
|
45
|
-
>;
|
|
46
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ChunkComputedConstraint } from "./ChunkComputedConstraint";
|
|
2
|
-
/**
|
|
3
|
-
* 获取computed字段文档类型
|
|
4
|
-
* @param T - ComputedConstraint
|
|
5
|
-
* @returns object
|
|
6
|
-
*/
|
|
7
|
-
export type GetChunkComputedDoc<TComputed extends ChunkComputedConstraint> = {
|
|
8
|
-
[k in keyof TComputed]: ReturnType<TComputed[k]>;
|
|
9
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
2
|
-
import { Checking, type Test } from "hry-types";
|
|
3
|
-
import type { GetChunkComputedDoc } from "../GetChunkComputedDoc";
|
|
4
|
-
|
|
5
|
-
// test1 非空对象字段
|
|
6
|
-
|
|
7
|
-
type Test1 = GetChunkComputedDoc<{
|
|
8
|
-
a: () => number;
|
|
9
|
-
b: () => string;
|
|
10
|
-
c: () => "male" | "femal";
|
|
11
|
-
}>;
|
|
12
|
-
|
|
13
|
-
type Test1Expected = {
|
|
14
|
-
a: number;
|
|
15
|
-
b: string;
|
|
16
|
-
c: "male" | "femal";
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
Checking<Test1, Test1Expected, Test.Pass>;
|
|
20
|
-
|
|
21
|
-
// test2 空对象字段 返回空
|
|
22
|
-
|
|
23
|
-
type Test2 = GetChunkComputedDoc<{}>;
|
|
24
|
-
|
|
25
|
-
Checking<Test2, {}, Test.Pass>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// import { RootComponent } from "../..";
|
|
2
|
-
|
|
3
|
-
import { ChunkComponent } from "../..";
|
|
4
|
-
import type { Mock_RootDoc } from "./mock";
|
|
5
|
-
|
|
6
|
-
// // 1 重复字段
|
|
7
|
-
ChunkComponent<Mock_RootDoc, "bbb">()({
|
|
8
|
-
data: {
|
|
9
|
-
bbb_num: 123,
|
|
10
|
-
},
|
|
11
|
-
store: {
|
|
12
|
-
bbb_str: () => "str",
|
|
13
|
-
},
|
|
14
|
-
computed: {
|
|
15
|
-
// @ts-expect-error '重复字段'
|
|
16
|
-
bbb_num(): string {
|
|
17
|
-
return "与data字段重复";
|
|
18
|
-
},
|
|
19
|
-
// @ts-expect-error "重复字段"
|
|
20
|
-
bbb_str(): string {
|
|
21
|
-
return "与store字段重复";
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
// 2 与root字段重复
|
|
26
|
-
ChunkComponent<{ data: { bbb_xxx: number } }>()({
|
|
27
|
-
computed: {
|
|
28
|
-
// @ts-expect-error '重复字段'
|
|
29
|
-
bbb_xxx(): string {
|
|
30
|
-
return "与root字段重复";
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { RootComponentDefinition } from "../../../RootComponent/returnType";
|
|
2
|
-
|
|
3
|
-
export type Mock_RootDoc = RootComponentDefinition<{
|
|
4
|
-
properties: {
|
|
5
|
-
required_num: number;
|
|
6
|
-
optional_literal_num?: 123 | 456 | 789;
|
|
7
|
-
unionStrNum: string | number;
|
|
8
|
-
required_obj: object | null;
|
|
9
|
-
optional_obj?: object | null;
|
|
10
|
-
slot_num: number;
|
|
11
|
-
_slot_str: string;
|
|
12
|
-
};
|
|
13
|
-
data: {
|
|
14
|
-
str: string;
|
|
15
|
-
literal_str: "a" | "b" | "c";
|
|
16
|
-
bool: boolean;
|
|
17
|
-
};
|
|
18
|
-
store: {
|
|
19
|
-
Storeinon: string | boolean;
|
|
20
|
-
};
|
|
21
|
-
computed: {
|
|
22
|
-
Cuinon: string | boolean;
|
|
23
|
-
};
|
|
24
|
-
}>;
|
|
25
|
-
|
|
26
|
-
// export type Mock_SubDoc = {
|
|
27
|
-
// allDatas: {
|
|
28
|
-
// aaa_num: number;
|
|
29
|
-
// aaa_literal_num: 123 | 456;
|
|
30
|
-
// aaa_str?: string;
|
|
31
|
-
// aaa_union: string | boolean;
|
|
32
|
-
// aaa_obj: object | null;
|
|
33
|
-
// aaa_obj1?: object | null;
|
|
34
|
-
// aaa_computed: string | boolean;
|
|
35
|
-
// aaa_store: string | boolean;
|
|
36
|
-
// };
|
|
37
|
-
// };
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { Checking } from "hry-types";
|
|
2
|
-
import type { ComputeObject } from "../../../../types/ComputeObject";
|
|
3
|
-
import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
|
|
4
|
-
import { ChunkComponent } from "../..";
|
|
5
|
-
import type { Mock_RootDoc } from "./mock";
|
|
6
|
-
|
|
7
|
-
ChunkComponent<Mock_RootDoc, "slot">()({
|
|
8
|
-
data: {
|
|
9
|
-
slot_a: 1,
|
|
10
|
-
},
|
|
11
|
-
store: {
|
|
12
|
-
slot_b: () => 1,
|
|
13
|
-
},
|
|
14
|
-
computed: {
|
|
15
|
-
// 1. 可以使用Mock_RootDoc中的字段
|
|
16
|
-
slot_aaa(): object | null {
|
|
17
|
-
return this.data.optional_obj;
|
|
18
|
-
},
|
|
19
|
-
// 3. 可以使用data和store中的字段
|
|
20
|
-
_slot_ccc(): number {
|
|
21
|
-
return this.data.slot_a + this.data.slot_b;
|
|
22
|
-
},
|
|
23
|
-
// 4.可以使用computed中的字段
|
|
24
|
-
_slot_ddd(): number {
|
|
25
|
-
return this.data._slot_ccc + 1;
|
|
26
|
-
},
|
|
27
|
-
// 5. this.data
|
|
28
|
-
slot_eee(): number {
|
|
29
|
-
// 5 this.data
|
|
30
|
-
void Checking<
|
|
31
|
-
typeof this.data,
|
|
32
|
-
ComputeObject<
|
|
33
|
-
& {
|
|
34
|
-
slot_a: number;
|
|
35
|
-
slot_b: number;
|
|
36
|
-
slot_aaa: object | null;
|
|
37
|
-
_slot_ccc: number;
|
|
38
|
-
_slot_ddd: number;
|
|
39
|
-
slot_eee: number;
|
|
40
|
-
}
|
|
41
|
-
& Required<Mock_RootDoc["properties"]>
|
|
42
|
-
& Mock_RootDoc["data"]
|
|
43
|
-
& Mock_RootDoc["computed"]
|
|
44
|
-
& Mock_RootDoc["store"]
|
|
45
|
-
& IInjectAllData
|
|
46
|
-
>,
|
|
47
|
-
true
|
|
48
|
-
>;
|
|
49
|
-
|
|
50
|
-
return 123;
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// computed中可以使用this实例 之前只能使用this.data字段
|
|
56
|
-
type Custom = { type: "custom"; xxx: string };
|
|
57
|
-
type Chunk = { type: "chunk"; yyy: number };
|
|
58
|
-
type Union = Custom | Chunk;
|
|
59
|
-
ChunkComponent<{ data: { _num: number }; methods: { IsChunk: (union: Union) => union is Chunk } }, "aaa">()({
|
|
60
|
-
data: {
|
|
61
|
-
_aaa_union: { type: "custom", xxx: "123" } as Union,
|
|
62
|
-
},
|
|
63
|
-
computed: {
|
|
64
|
-
_aaa_count(): string | number {
|
|
65
|
-
const { _aaa_union } = this.data;
|
|
66
|
-
return this.aaa_isCustom(_aaa_union) ? _aaa_union.xxx : _aaa_union.yyy;
|
|
67
|
-
},
|
|
68
|
-
_aaa_isChunk(): boolean {
|
|
69
|
-
const { _aaa_union } = this.data;
|
|
70
|
-
return this.IsChunk(_aaa_union);
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
methods: {
|
|
74
|
-
aaa_isCustom(union: Union): union is Custom {
|
|
75
|
-
return union.type === "custom";
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
// 2
|
|
80
|
-
ChunkComponent<{}>()({
|
|
81
|
-
computed: {
|
|
82
|
-
xxx(): string {
|
|
83
|
-
return "";
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
|
|
3
|
-
export type ChunkDataConstraint<Prefix extends string> = IfExtends<
|
|
4
|
-
"",
|
|
5
|
-
Prefix,
|
|
6
|
-
{},
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
|
|
8
|
-
{ [k in (`${Prefix}_${string}` | `_${Prefix}_${string}`)]: unknown }
|
|
9
|
-
>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { G } from "hry-types";
|
|
2
|
-
import type { Validators } from "../../../types/Validators";
|
|
3
|
-
import type { ValidatorPrefix } from "./validatePrefix";
|
|
4
|
-
|
|
5
|
-
export type ChunkDataOption<TData extends object, TDuplicateKeys extends PropertyKey, Prefix extends string> = {
|
|
6
|
-
/**
|
|
7
|
-
* slot块数据
|
|
8
|
-
*/
|
|
9
|
-
data?:
|
|
10
|
-
& TData
|
|
11
|
-
& Validators<
|
|
12
|
-
[
|
|
13
|
-
G.DuplicateFieldValidator<TData, TDuplicateKeys, "字段重复">,
|
|
14
|
-
ValidatorPrefix<TData, Prefix>,
|
|
15
|
-
]
|
|
16
|
-
>;
|
|
17
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ChunkComponent } from "../..";
|
|
2
|
-
import type { Mock_RootDoc } from "./mock";
|
|
3
|
-
|
|
4
|
-
// 1 前缀错误
|
|
5
|
-
ChunkComponent<Mock_RootDoc, "slot">()({
|
|
6
|
-
data: {
|
|
7
|
-
// @ts-expect-error "⚠️字段不合法,请使用'slot_'或'_slot_'开头的字段名⚠️")
|
|
8
|
-
xxx_num: 1,
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
// 2. 内部字段前缀错误
|
|
13
|
-
ChunkComponent<Mock_RootDoc, "xxx">()({
|
|
14
|
-
data: {
|
|
15
|
-
// @ts-expect-error "⚠️字段不合法,请使用'xxx_'或'_xxx_'开头的字段名⚠️")
|
|
16
|
-
_xxxx_num: 1,
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// 3. 与父级字段重复
|
|
21
|
-
ChunkComponent<Mock_RootDoc, "slot">()({
|
|
22
|
-
data: {
|
|
23
|
-
// @ts-expect-error 与RootDoc中的 "⚠️字段重复⚠️")
|
|
24
|
-
slot_num: 1,
|
|
25
|
-
// @ts-expect-error 与RootDoc中的 "⚠️字段重复⚠️")
|
|
26
|
-
_slot_str: "1",
|
|
27
|
-
},
|
|
28
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { RootComponentDefinition } from "../../../RootComponent/returnType";
|
|
2
|
-
|
|
3
|
-
export type Mock_RootDoc = RootComponentDefinition<{
|
|
4
|
-
properties: {
|
|
5
|
-
required_num: number;
|
|
6
|
-
optional_literal_num?: 123 | 456 | 789;
|
|
7
|
-
unionStrNum: string | number;
|
|
8
|
-
required_obj: object | null;
|
|
9
|
-
optional_obj?: object | null;
|
|
10
|
-
slot_num: number;
|
|
11
|
-
_slot_str: string;
|
|
12
|
-
};
|
|
13
|
-
data: {
|
|
14
|
-
str: string;
|
|
15
|
-
literal_str: "a" | "b" | "c";
|
|
16
|
-
bool: boolean;
|
|
17
|
-
};
|
|
18
|
-
computed: {
|
|
19
|
-
Cuinon: string | boolean;
|
|
20
|
-
};
|
|
21
|
-
events: {
|
|
22
|
-
xxx_onTap: string;
|
|
23
|
-
};
|
|
24
|
-
methods: {
|
|
25
|
-
xxx_test: () => void;
|
|
26
|
-
};
|
|
27
|
-
}>;
|
|
28
|
-
|
|
29
|
-
// export type Mock_SubDoc = {
|
|
30
|
-
// allDatas: {
|
|
31
|
-
// aaa_num: number;
|
|
32
|
-
// aaa_literal_num: 123 | 456;
|
|
33
|
-
// aaa_str?: string;
|
|
34
|
-
// aaa_union: string | boolean;
|
|
35
|
-
// aaa_obj: object | null;
|
|
36
|
-
// aaa_obj1?: object | null;
|
|
37
|
-
// };
|
|
38
|
-
// events: {
|
|
39
|
-
// xxx_subEvent: () => string;
|
|
40
|
-
// };
|
|
41
|
-
// methods: {
|
|
42
|
-
// xxx_subMethods: () => void;
|
|
43
|
-
// };
|
|
44
|
-
// };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ChunkComponent } from "../..";
|
|
2
|
-
import type { Mock_RootDoc } from "./mock";
|
|
3
|
-
|
|
4
|
-
// 1 不传入第二个泛型,可写入任意字段
|
|
5
|
-
ChunkComponent<Mock_RootDoc>()({
|
|
6
|
-
data: {
|
|
7
|
-
xxx: 123,
|
|
8
|
-
_xxx: 123,
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
// 2 传入第二个泛型,可写入前缀为 slot_ 或者 _slot_ 的字段
|
|
13
|
-
ChunkComponent<Mock_RootDoc, "slot">()({
|
|
14
|
-
data: {
|
|
15
|
-
slot_xxx: 123,
|
|
16
|
-
_slot_xxx: 123,
|
|
17
|
-
},
|
|
18
|
-
});
|