annil 1.16.0 → 1.18.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/README.md +38 -169
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedConstraint.d.ts +1 -0
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedConstraint.js +2 -0
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedConstraint.js.map +1 -0
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedOption.d.ts +10 -0
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedOption.js +2 -0
- package/dist/api/ChunkComponent/ChunkComputed/ChunkComputedOption.js.map +1 -0
- package/dist/api/ChunkComponent/ChunkData/chunkDataOption.d.ts +9 -0
- package/dist/api/ChunkComponent/ChunkData/chunkDataOption.js +2 -0
- package/dist/api/ChunkComponent/ChunkData/chunkDataOption.js.map +1 -0
- package/dist/api/ChunkComponent/ChunkData/validatePrefix.d.ts +2 -0
- package/dist/api/ChunkComponent/ChunkData/validatePrefix.js +2 -0
- package/dist/api/ChunkComponent/ChunkData/validatePrefix.js.map +1 -0
- package/dist/api/ChunkComponent/ChunkMethods/ChunkMethodsOption.d.ts +10 -0
- package/dist/api/ChunkComponent/ChunkMethods/ChunkMethodsOption.js +2 -0
- package/dist/api/ChunkComponent/ChunkMethods/ChunkMethodsOption.js.map +1 -0
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreConstraint.d.ts +2 -0
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreConstraint.js +2 -0
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreConstraint.js.map +1 -0
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreOption.d.ts +12 -0
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreOption.js +2 -0
- package/dist/api/ChunkComponent/ChunkStore/ChunkStoreOption.js.map +1 -0
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsConstraint.d.ts +2 -0
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsConstraint.js +2 -0
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsConstraint.js.map +1 -0
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsOption.d.ts +10 -0
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsOption.js +2 -0
- package/dist/api/ChunkComponent/ChunklEvents/ChunkEventsOption.js.map +1 -0
- package/dist/api/ChunkComponent/SlotComponentReturnType.d.ts +20 -0
- package/dist/api/ChunkComponent/SlotComponentReturnType.js +2 -0
- package/dist/api/ChunkComponent/SlotComponentReturnType.js.map +1 -0
- package/dist/api/ChunkComponent/index.d.ts +24 -0
- package/dist/api/ChunkComponent/index.js +4 -0
- package/dist/api/ChunkComponent/index.js.map +1 -0
- package/dist/api/CustomComponent/CustomComputed/CustomComputedConstraint.d.ts +3 -0
- package/dist/api/CustomComponent/CustomComputed/CustomComputedConstraint.js +2 -0
- package/dist/api/CustomComponent/CustomComputed/CustomComputedConstraint.js.map +1 -0
- package/dist/api/{SubComponent/SubComputed/SubComputedOption.d.ts → CustomComponent/CustomComputed/CustomComputedOption.d.ts} +1 -1
- package/dist/api/CustomComponent/CustomComputed/CustomComputedOption.js +2 -0
- package/dist/api/CustomComponent/CustomComputed/CustomComputedOption.js.map +1 -0
- package/dist/api/CustomComponent/CustomComputed/GetCustomComputedDoc.d.ts +3 -0
- package/dist/api/CustomComponent/CustomComputed/GetCustomComputedDoc.js +2 -0
- package/dist/api/CustomComponent/CustomComputed/GetCustomComputedDoc.js.map +1 -0
- package/dist/api/CustomComponent/CustomData/CustomDataConstraint.d.ts +3 -0
- package/dist/api/CustomComponent/CustomData/CustomDataConstraint.js +2 -0
- package/dist/api/CustomComponent/CustomData/CustomDataConstraint.js.map +1 -0
- package/dist/api/{SubComponent/SubData/SubDataOption.d.ts → CustomComponent/CustomData/CustomDataOption.d.ts} +1 -1
- package/dist/api/CustomComponent/CustomData/CustomDataOption.js +2 -0
- package/dist/api/CustomComponent/CustomData/CustomDataOption.js.map +1 -0
- package/dist/api/{SubComponent/SubEvents/SubEventsConstraint.d.ts → CustomComponent/CustomEvents/CustomEventsConstraint.d.ts} +1 -1
- package/dist/api/CustomComponent/CustomEvents/CustomEventsConstraint.js +2 -0
- package/dist/api/CustomComponent/CustomEvents/CustomEventsConstraint.js.map +1 -0
- package/dist/api/CustomComponent/CustomEvents/CustomEventsOption.d.ts +4 -0
- package/dist/api/CustomComponent/CustomEvents/CustomEventsOption.js +2 -0
- package/dist/api/CustomComponent/CustomEvents/CustomEventsOption.js.map +1 -0
- package/dist/api/{SubComponent/SubInherit/SubInheritConstraint.d.ts → CustomComponent/CustomInherit/CustomInheritConstraint.d.ts} +1 -1
- package/dist/api/CustomComponent/CustomInherit/CustomInheritConstraint.js +2 -0
- package/dist/api/CustomComponent/CustomInherit/CustomInheritConstraint.js.map +1 -0
- package/dist/api/{SubComponent/SubInherit/SubInheritOption.d.ts → CustomComponent/CustomInherit/CustomInheritOption.d.ts} +1 -1
- package/dist/api/CustomComponent/CustomInherit/CustomInheritOption.js +2 -0
- package/dist/api/CustomComponent/CustomInherit/CustomInheritOption.js.map +1 -0
- package/dist/api/CustomComponent/CustomInstance/CustomInstance.d.ts +2 -0
- package/dist/api/CustomComponent/CustomInstance/CustomInstance.js +2 -0
- package/dist/api/CustomComponent/CustomInstance/CustomInstance.js.map +1 -0
- package/dist/api/{SubComponent/SubLifetimes/SubLifetimesOption.d.ts → CustomComponent/CustomLifetimes/CustomLifetimesOption.d.ts} +1 -1
- package/dist/api/CustomComponent/CustomLifetimes/CustomLifetimesOption.js +2 -0
- package/dist/api/CustomComponent/CustomLifetimes/CustomLifetimesOption.js.map +1 -0
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsConstraint.d.ts +2 -0
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsConstraint.js +2 -0
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsConstraint.js.map +1 -0
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsOption.d.ts +5 -0
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsOption.js +2 -0
- package/dist/api/CustomComponent/CustomMethods/CustomMethodsOption.js.map +1 -0
- package/dist/api/CustomComponent/CustomObservers/CustomObserversOption.d.ts +2 -0
- package/dist/api/CustomComponent/CustomObservers/CustomObserversOption.js +2 -0
- package/dist/api/CustomComponent/CustomObservers/CustomObserversOption.js.map +1 -0
- package/dist/api/CustomComponent/CustomPageLifetimes/CustomPageLifetimesOption.d.ts +2 -0
- package/dist/api/CustomComponent/CustomPageLifetimes/CustomPageLifetimesOption.js +2 -0
- package/dist/api/CustomComponent/CustomPageLifetimes/CustomPageLifetimesOption.js.map +1 -0
- package/dist/api/{SubComponent/SubReturnType/CreateSubComponentDoc.d.ts → CustomComponent/CustomReturnType/CreateCustomComponentDoc.d.ts} +1 -1
- package/dist/api/CustomComponent/CustomReturnType/CreateCustomComponentDoc.js +2 -0
- package/dist/api/CustomComponent/CustomReturnType/CreateCustomComponentDoc.js.map +1 -0
- package/dist/api/{SubComponent/SubStore/SubStoreConstraint.d.ts → CustomComponent/CustomStore/CustomStoreConstraint.d.ts} +1 -1
- package/dist/api/CustomComponent/CustomStore/CustomStoreConstraint.js +2 -0
- package/dist/api/CustomComponent/CustomStore/CustomStoreConstraint.js.map +1 -0
- package/dist/api/{SubComponent/SubStore/SubStoreOption.d.ts → CustomComponent/CustomStore/CustomStoreOption.d.ts} +1 -1
- package/dist/api/CustomComponent/CustomStore/CustomStoreOption.js +2 -0
- package/dist/api/CustomComponent/CustomStore/CustomStoreOption.js.map +1 -0
- package/dist/api/CustomComponent/CustomWatch/CustomWatchOption.d.ts +2 -0
- package/dist/api/CustomComponent/CustomWatch/CustomWatchOption.js +2 -0
- package/dist/api/CustomComponent/CustomWatch/CustomWatchOption.js.map +1 -0
- package/dist/api/CustomComponent/index.d.ts +49 -0
- package/dist/api/CustomComponent/index.js +4 -0
- package/dist/api/CustomComponent/index.js.map +1 -0
- package/dist/api/{SubComponent → CustomComponent}/returnType.d.ts +3 -3
- package/dist/api/CustomComponent/returnType.js.map +1 -0
- package/dist/api/DefineComponent/SubComponents/SubComponentsOption.d.ts +2 -2
- package/dist/api/DefineComponent/index.d.ts +4 -4
- package/dist/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.d.ts +3 -2
- package/dist/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/customEventsHandle.js +3 -3
- package/dist/api/DefineComponent/normalizeOptions/customEventsHandle.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/handleStore/reactionRegister.js +1 -2
- package/dist/api/DefineComponent/normalizeOptions/handleStore/reactionRegister.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/handleSubComponents.d.ts +3 -2
- package/dist/api/DefineComponent/normalizeOptions/handleSubComponents.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/index.js +1 -2
- package/dist/api/DefineComponent/normalizeOptions/index.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/injectInfoHandler.js +1 -1
- package/dist/api/DefineComponent/normalizeOptions/injectInfoHandler.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.d.ts +3 -2
- package/dist/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.js +1 -2
- package/dist/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/watchHandler/getPathsValue.js +1 -1
- package/dist/api/DefineComponent/normalizeOptions/watchHandler/getPathsValue.js.map +1 -1
- package/dist/api/DefineComponent/normalizeOptions/watchHandler/index.js +3 -4
- package/dist/api/DefineComponent/normalizeOptions/watchHandler/index.js.map +1 -1
- package/dist/api/DefineComponent/returnType/ComponentDoc.d.ts +1 -4
- package/dist/api/DefineComponent/returnType/GenerateComponentDoc.d.ts +3 -3
- package/dist/api/DefineComponent/returnType/GetCustomEventDocOfSubDoc.d.ts +3 -3
- package/dist/api/InstanceInject/instanceConfig.d.ts +2 -2
- package/dist/api/InstanceInject/instanceConfig.js +1 -3
- package/dist/api/InstanceInject/instanceConfig.js.map +1 -1
- package/dist/api/RootComponent/Events/EventsConstraint.d.ts +9 -7
- package/dist/api/RootComponent/index.d.ts +6 -5
- package/dist/api/RootComponent/index.js.map +1 -1
- package/dist/behaviors/BbeforeCreated.d.ts +1 -1
- package/dist/behaviors/BthrottleDebounce.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/thirdLib/vant/Button.d.ts +2 -2
- package/dist/thirdLib/vant/NoticeBar.d.ts +2 -2
- package/dist/thirdLib/vant/Popup.d.ts +2 -2
- package/dist/thirdLib/wm/Textarea.d.ts +2 -2
- package/dist/thirdLib/wm/map.d.ts +2 -2
- package/dist/thirdLib/wm/scrollView.d.ts +2 -2
- package/dist/thirdLib/wm/swiper.d.ts +2 -2
- package/dist/thirdLib/wm/view.d.ts +2 -2
- package/dist/types/{CreateComponentType.d.ts → CreateComponentDoc.d.ts} +5 -2
- package/dist/types/CreateComponentDoc.js +2 -0
- package/dist/types/CreateComponentDoc.js.map +1 -0
- package/dist/utils/nonNullable.js +1 -1
- package/dist/utils/nonNullable.js.map +1 -1
- package/package.json +8 -11
- package/CHANGELOG.md +0 -943
- package/dist/api/SubComponent/SubComputed/GetSubComputedDoc.d.ts +0 -3
- package/dist/api/SubComponent/SubComputed/GetSubComputedDoc.js +0 -2
- package/dist/api/SubComponent/SubComputed/GetSubComputedDoc.js.map +0 -1
- package/dist/api/SubComponent/SubComputed/SubComputedConstraint.d.ts +0 -3
- package/dist/api/SubComponent/SubComputed/SubComputedConstraint.js +0 -2
- package/dist/api/SubComponent/SubComputed/SubComputedConstraint.js.map +0 -1
- package/dist/api/SubComponent/SubComputed/SubComputedOption.js +0 -2
- package/dist/api/SubComponent/SubComputed/SubComputedOption.js.map +0 -1
- package/dist/api/SubComponent/SubData/SubDataConstraint.d.ts +0 -3
- package/dist/api/SubComponent/SubData/SubDataConstraint.js +0 -2
- package/dist/api/SubComponent/SubData/SubDataConstraint.js.map +0 -1
- package/dist/api/SubComponent/SubData/SubDataOption.js +0 -2
- package/dist/api/SubComponent/SubData/SubDataOption.js.map +0 -1
- package/dist/api/SubComponent/SubEvents/SubEventsConstraint.js +0 -2
- package/dist/api/SubComponent/SubEvents/SubEventsConstraint.js.map +0 -1
- package/dist/api/SubComponent/SubEvents/SubEventsOption.d.ts +0 -4
- package/dist/api/SubComponent/SubEvents/SubEventsOption.js +0 -2
- package/dist/api/SubComponent/SubEvents/SubEventsOption.js.map +0 -1
- package/dist/api/SubComponent/SubInherit/SubInheritConstraint.js +0 -2
- package/dist/api/SubComponent/SubInherit/SubInheritConstraint.js.map +0 -1
- package/dist/api/SubComponent/SubInherit/SubInheritOption.js +0 -2
- package/dist/api/SubComponent/SubInherit/SubInheritOption.js.map +0 -1
- package/dist/api/SubComponent/SubInstance/SubInstance.d.ts +0 -2
- package/dist/api/SubComponent/SubInstance/SubInstance.js +0 -2
- package/dist/api/SubComponent/SubInstance/SubInstance.js.map +0 -1
- package/dist/api/SubComponent/SubLifetimes/SubLifetimesOption.js +0 -2
- package/dist/api/SubComponent/SubLifetimes/SubLifetimesOption.js.map +0 -1
- package/dist/api/SubComponent/SubMethods/SubMethodsConstraint.d.ts +0 -2
- package/dist/api/SubComponent/SubMethods/SubMethodsConstraint.js +0 -2
- package/dist/api/SubComponent/SubMethods/SubMethodsConstraint.js.map +0 -1
- package/dist/api/SubComponent/SubMethods/SubMethodsOption.d.ts +0 -5
- package/dist/api/SubComponent/SubMethods/SubMethodsOption.js +0 -2
- package/dist/api/SubComponent/SubMethods/SubMethodsOption.js.map +0 -1
- package/dist/api/SubComponent/SubObservers/SubObserversOption.d.ts +0 -2
- package/dist/api/SubComponent/SubObservers/SubObserversOption.js +0 -2
- package/dist/api/SubComponent/SubObservers/SubObserversOption.js.map +0 -1
- package/dist/api/SubComponent/SubPageLifetimes/SubPageLifetimesOption.d.ts +0 -2
- package/dist/api/SubComponent/SubPageLifetimes/SubPageLifetimesOption.js +0 -2
- package/dist/api/SubComponent/SubPageLifetimes/SubPageLifetimesOption.js.map +0 -1
- package/dist/api/SubComponent/SubReturnType/CreateSubComponentDoc.js +0 -2
- package/dist/api/SubComponent/SubReturnType/CreateSubComponentDoc.js.map +0 -1
- package/dist/api/SubComponent/SubStore/SubStoreConstraint.js +0 -2
- package/dist/api/SubComponent/SubStore/SubStoreConstraint.js.map +0 -1
- package/dist/api/SubComponent/SubStore/SubStoreOption.js +0 -2
- package/dist/api/SubComponent/SubStore/SubStoreOption.js.map +0 -1
- package/dist/api/SubComponent/SubWatch/SubWatchOption.d.ts +0 -2
- package/dist/api/SubComponent/SubWatch/SubWatchOption.js +0 -2
- package/dist/api/SubComponent/SubWatch/SubWatchOption.js.map +0 -1
- package/dist/api/SubComponent/index.d.ts +0 -49
- package/dist/api/SubComponent/index.js +0 -4
- package/dist/api/SubComponent/index.js.map +0 -1
- package/dist/api/SubComponent/returnType.js.map +0 -1
- package/dist/types/CreateComponentType.js +0 -2
- package/dist/types/CreateComponentType.js.map +0 -1
- package/dist/types/ExtendComponentType.d.ts +0 -7
- package/dist/types/ExtendComponentType.js +0 -2
- package/dist/types/ExtendComponentType.js.map +0 -1
- package/dist/types/RemoveNullOfRequired.d.ts +0 -4
- package/dist/types/RemoveNullOfRequired.js +0 -2
- package/dist/types/RemoveNullOfRequired.js.map +0 -1
- package/src/api/DefineComponent/NameOrPath/NameOrPathOption.ts +0 -31
- package/src/api/DefineComponent/NameOrPath/test/error.test.ts +0 -32
- package/src/api/DefineComponent/NameOrPath/test/normal.test.ts +0 -13
- package/src/api/DefineComponent/RootComponent/RootComponentOption.ts +0 -11
- package/src/api/DefineComponent/SubComponents/SubComponentsOption.ts +0 -13
- package/src/api/DefineComponent/SubComponents/test/normal.test.ts +0 -1049
- package/src/api/DefineComponent/index.ts +0 -58
- package/src/api/DefineComponent/normalizeOptions/__throttleDebounce__FieldCheck.ts +0 -29
- package/src/api/DefineComponent/normalizeOptions/customEventsHandle.ts +0 -55
- package/src/api/DefineComponent/normalizeOptions/handleRootComponent.ts +0 -33
- package/src/api/DefineComponent/normalizeOptions/handleStore/disposeStore.ts +0 -10
- package/src/api/DefineComponent/normalizeOptions/handleStore/initStore.ts +0 -9
- package/src/api/DefineComponent/normalizeOptions/handleStore/reactionRegister.ts +0 -70
- package/src/api/DefineComponent/normalizeOptions/handleSubComponents.ts +0 -23
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/addDetachedData.ts +0 -10
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/hijack.ts +0 -26
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/index.ts +0 -57
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/isPageCheck.ts +0 -22
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/loadReceivedDataHandle.ts +0 -25
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/onLoadReceivedDataHandle.ts +0 -33
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/pagePathCheck.ts +0 -9
- package/src/api/DefineComponent/normalizeOptions/index.ts +0 -143
- package/src/api/DefineComponent/normalizeOptions/initComputed/computedUpdater.ts +0 -51
- package/src/api/DefineComponent/normalizeOptions/initComputed/data-tracer.ts +0 -62
- package/src/api/DefineComponent/normalizeOptions/initComputed/dependencesOptimize.ts +0 -45
- package/src/api/DefineComponent/normalizeOptions/initComputed/index.ts +0 -42
- package/src/api/DefineComponent/normalizeOptions/initComputed/initComputedAndGetCache.ts +0 -105
- package/src/api/DefineComponent/normalizeOptions/injectInfoHandler.ts +0 -51
- package/src/api/DefineComponent/normalizeOptions/internalFieldProtection.ts +0 -27
- package/src/api/DefineComponent/normalizeOptions/otherFieldsHandle.ts +0 -29
- package/src/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.ts +0 -23
- package/src/api/DefineComponent/normalizeOptions/sameFuncOptionsHandle.ts +0 -36
- package/src/api/DefineComponent/normalizeOptions/watchHandler/getPathsValue.ts +0 -31
- package/src/api/DefineComponent/normalizeOptions/watchHandler/getPropertiesValue.ts +0 -51
- package/src/api/DefineComponent/normalizeOptions/watchHandler/hasComputedPath.ts +0 -9
- package/src/api/DefineComponent/normalizeOptions/watchHandler/index.ts +0 -78
- package/src/api/DefineComponent/returnType/ComponentDoc.ts +0 -25
- package/src/api/DefineComponent/returnType/GenerateComponentDoc.ts +0 -46
- package/src/api/DefineComponent/returnType/GeneratePageDoc.ts +0 -22
- package/src/api/DefineComponent/returnType/GetCustomEventDocOfSubDoc.ts +0 -24
- package/src/api/DefineComponent/returnType/GetPropertiesDocOfSubDoc.ts +0 -7
- package/src/api/DefineComponent/returnType/PageDoc.ts +0 -19
- package/src/api/DefineComponent/returnType/test/normalComponentDoc.test.ts +0 -248
- package/src/api/DefineComponent/returnType/test/normalPageDoc.test.ts +0 -49
- package/src/api/InstanceInject/inject.ts +0 -36
- package/src/api/InstanceInject/instanceConfig.ts +0 -50
- package/src/api/InstanceInject/test/normal.test.ts +0 -41
- package/src/api/RootComponent/Computed/ComputedConstraint.ts +0 -4
- package/src/api/RootComponent/Computed/ComputedOption.ts +0 -35
- package/src/api/RootComponent/Computed/GetComputedDef.ts +0 -10
- package/src/api/RootComponent/Computed/test/GetComputedDoc.test.ts +0 -25
- package/src/api/RootComponent/Computed/test/error.test.ts +0 -50
- package/src/api/RootComponent/Computed/test/normal.test.ts +0 -124
- package/src/api/RootComponent/CustomEvents/CustomEventConstraint.ts +0 -89
- package/src/api/RootComponent/CustomEvents/CustomEventsDef.ts +0 -4
- package/src/api/RootComponent/CustomEvents/CustomEventsDoc.ts +0 -4
- package/src/api/RootComponent/CustomEvents/CustomEventsOption.ts +0 -41
- package/src/api/RootComponent/CustomEvents/CustomEventsTag.ts +0 -59
- package/src/api/RootComponent/CustomEvents/GetCustomEventDef.ts +0 -29
- package/src/api/RootComponent/CustomEvents/GetCustomEventDoc.ts +0 -47
- package/src/api/RootComponent/CustomEvents/test/GetCustomEventDoc.test.ts +0 -38
- package/src/api/RootComponent/CustomEvents/test/GetFullEventDoc.test.ts +0 -57
- package/src/api/RootComponent/CustomEvents/test/GetShortEventDoc.test.ts +0 -36
- package/src/api/RootComponent/CustomEvents/test/error.test.ts +0 -101
- package/src/api/RootComponent/CustomEvents/test/normal.test.ts +0 -99
- package/src/api/RootComponent/Data/DataConstraint.ts +0 -1
- package/src/api/RootComponent/Data/DataOption.ts +0 -25
- package/src/api/RootComponent/Data/GetDataDef.ts +0 -8
- package/src/api/RootComponent/Data/GetDataDoc.ts +0 -8
- package/src/api/RootComponent/Data/test/GetDataDoc.test.ts +0 -32
- package/src/api/RootComponent/Data/test/error.test.ts +0 -14
- package/src/api/RootComponent/Data/test/normal.test.ts +0 -33
- package/src/api/RootComponent/Events/EventsConstraint.ts +0 -74
- package/src/api/RootComponent/Events/EventsOption.ts +0 -55
- package/src/api/RootComponent/Events/test/normal.test.ts +0 -161
- package/src/api/RootComponent/Instance/CustomEventMethods.ts +0 -11
- package/src/api/RootComponent/Instance/CustomSetData.ts +0 -17
- package/src/api/RootComponent/Instance/RootComponentInstance.ts +0 -46
- package/src/api/RootComponent/Instance/test/CustomEventsDoc.test.ts +0 -70
- package/src/api/RootComponent/Instance/test/CustomSetData.test.ts +0 -44
- package/src/api/RootComponent/Instance/test/customEvents/error.test.ts +0 -13
- package/src/api/RootComponent/Instance/test/customEvents/normal.test.ts +0 -71
- package/src/api/RootComponent/Instance/test/methods/error.test.ts +0 -14
- package/src/api/RootComponent/Instance/test/methods/mormal.test.ts +0 -18
- package/src/api/RootComponent/Instance/test/properties/mormal.test.ts +0 -58
- package/src/api/RootComponent/Instance/test/setData/error.test.ts +0 -65
- package/src/api/RootComponent/Instance/test/setData/normal.test.ts +0 -51
- package/src/api/RootComponent/IsPage/IsPageOption.ts +0 -6
- package/src/api/RootComponent/IsPage/test/normal.test.ts +0 -29
- package/src/api/RootComponent/Lifetimes/LifetimesConstraint.ts +0 -14
- package/src/api/RootComponent/Lifetimes/LifetimesOption.ts +0 -31
- package/src/api/RootComponent/Lifetimes/test/error.test.ts +0 -31
- package/src/api/RootComponent/Lifetimes/test/normal.test.ts +0 -34
- package/src/api/RootComponent/Methods/MethodsConstraint.ts +0 -3
- package/src/api/RootComponent/Methods/MethodsOption.ts +0 -15
- package/src/api/RootComponent/Methods/test/error.test.ts +0 -41
- package/src/api/RootComponent/Methods/test/mormal.test.ts +0 -25
- package/src/api/RootComponent/Observers/ObserversOption.ts +0 -58
- package/src/api/RootComponent/Observers/test/normal.test.ts +0 -30
- package/src/api/RootComponent/PageLifetimes/PageLifetimesOption.ts +0 -29
- package/src/api/RootComponent/PageLifetimes/test/error.test.ts +0 -37
- package/src/api/RootComponent/PageLifetimes/test/normal.test.ts +0 -71
- package/src/api/RootComponent/Properties/GetOptionalDef.ts +0 -18
- package/src/api/RootComponent/Properties/GetPropertiesDef.ts +0 -22
- package/src/api/RootComponent/Properties/GetRequiredDef.ts +0 -16
- package/src/api/RootComponent/Properties/PropertiesConstraint.ts +0 -38
- package/src/api/RootComponent/Properties/PropertiesOption.ts +0 -25
- package/src/api/RootComponent/Properties/PropertiesValueValidator.ts +0 -21
- package/src/api/RootComponent/Properties/test/error.test.ts +0 -49
- package/src/api/RootComponent/Properties/test/normalEmpty.test.ts +0 -42
- package/src/api/RootComponent/Properties/test/normalOptional.test.ts +0 -118
- package/src/api/RootComponent/Properties/test/normalRequired.test.ts +0 -107
- package/src/api/RootComponent/Store/GetStoreDef.ts +0 -34
- package/src/api/RootComponent/Store/StoreConstraint.ts +0 -2
- package/src/api/RootComponent/Store/StoreOption.ts +0 -53
- package/src/api/RootComponent/Store/test/error.test.ts +0 -30
- package/src/api/RootComponent/Store/test/normal.test.ts +0 -35
- package/src/api/RootComponent/Watch/WatchOption.ts +0 -67
- package/src/api/RootComponent/Watch/test/WatchComputed.test.ts +0 -40
- package/src/api/RootComponent/Watch/test/WatchData.test.ts +0 -55
- package/src/api/RootComponent/Watch/test/WatchProperties.test.ts +0 -170
- package/src/api/RootComponent/Watch/test/WtachInject.test.ts +0 -16
- package/src/api/RootComponent/Watch/test/error.test.ts +0 -54
- package/src/api/RootComponent/index.ts +0 -151
- package/src/api/RootComponent/returnType.ts +0 -57
- package/src/api/SubComponent/SubComputed/GetSubComputedDoc.ts +0 -4
- package/src/api/SubComponent/SubComputed/SubComputedConstraint.ts +0 -1
- package/src/api/SubComponent/SubComputed/SubComputedOption.ts +0 -11
- package/src/api/SubComponent/SubComputed/test/error.test.ts +0 -88
- package/src/api/SubComponent/SubComputed/test/normal.test.ts +0 -207
- package/src/api/SubComponent/SubData/SubDataConstraint.ts +0 -9
- package/src/api/SubComponent/SubData/SubDataOption.ts +0 -17
- package/src/api/SubComponent/SubData/test/error.test.ts +0 -64
- package/src/api/SubComponent/SubData/test/normal.test.ts +0 -91
- package/src/api/SubComponent/SubEvents/SubEventsConstraint.ts +0 -27
- package/src/api/SubComponent/SubEvents/SubEventsOption.ts +0 -12
- package/src/api/SubComponent/SubEvents/test/error.test.ts +0 -36
- package/src/api/SubComponent/SubEvents/test/normal.test.ts +0 -209
- package/src/api/SubComponent/SubInherit/SubInheritConstraint.ts +0 -17
- package/src/api/SubComponent/SubInherit/SubInheritOption.ts +0 -15
- package/src/api/SubComponent/SubInherit/test/error.test.ts +0 -84
- package/src/api/SubComponent/SubInherit/test/normal.test.ts +0 -81
- package/src/api/SubComponent/SubInstance/SubInstance.ts +0 -9
- package/src/api/SubComponent/SubInstance/test/error.test.ts +0 -22
- package/src/api/SubComponent/SubInstance/test/normal.test.ts +0 -87
- package/src/api/SubComponent/SubLifetimes/SubLifetimesOption.ts +0 -3
- package/src/api/SubComponent/SubMethods/SubMethodsConstraint.ts +0 -3
- package/src/api/SubComponent/SubMethods/SubMethodsOption.ts +0 -17
- package/src/api/SubComponent/SubMethods/test/error.test.ts +0 -51
- package/src/api/SubComponent/SubMethods/test/normarl.test.ts +0 -33
- package/src/api/SubComponent/SubObservers/SubObserversOption.ts +0 -3
- package/src/api/SubComponent/SubPageLifetimes/SubPageLifetimesOption.ts +0 -6
- package/src/api/SubComponent/SubPageLifetimes/test/error.test.ts +0 -1
- package/src/api/SubComponent/SubPageLifetimes/test/normal.test.ts +0 -1
- package/src/api/SubComponent/SubReturnType/CreateSubComponentDoc.ts +0 -41
- package/src/api/SubComponent/SubReturnType/test/error.test.ts +0 -18
- package/src/api/SubComponent/SubReturnType/test/normal.test.ts +0 -98
- package/src/api/SubComponent/SubStore/SubStoreConstraint.ts +0 -13
- package/src/api/SubComponent/SubStore/SubStoreOption.ts +0 -32
- package/src/api/SubComponent/SubStore/test/error.test.ts +0 -60
- package/src/api/SubComponent/SubStore/test/normal.test.ts +0 -43
- package/src/api/SubComponent/SubWatch/SubWatchOption.ts +0 -3
- package/src/api/SubComponent/SubWatch/test/WatchComputed.test.ts +0 -90
- package/src/api/SubComponent/SubWatch/test/WatchProperties.test.ts +0 -151
- package/src/api/SubComponent/SubWatch/test/WatchRootData.test.ts +0 -122
- package/src/api/SubComponent/SubWatch/test/WatchSubData.test.ts +0 -49
- package/src/api/SubComponent/SubWatch/test/WtachInject.test.ts +0 -16
- package/src/api/SubComponent/SubWatch/test/error.test.ts +0 -60
- package/src/api/SubComponent/index.ts +0 -301
- package/src/api/SubComponent/returnType.ts +0 -39
- package/src/api/wxSugar.ts +0 -107
- package/src/behaviors/BbeforeCreated.ts +0 -18
- package/src/behaviors/BthrottleDebounce.ts +0 -28
- package/src/index.ts +0 -46
- package/src/thirdLib/index.ts +0 -3
- package/src/thirdLib/vant/Button.ts +0 -23
- package/src/thirdLib/vant/NoticeBar.ts +0 -32
- package/src/thirdLib/vant/Popup.ts +0 -70
- package/src/thirdLib/vant/index.ts +0 -5
- package/src/thirdLib/wm/Textarea.ts +0 -117
- package/src/thirdLib/wm/baseEvents.ts +0 -54
- package/src/thirdLib/wm/index.ts +0 -9
- package/src/thirdLib/wm/map.ts +0 -266
- package/src/thirdLib/wm/scrollView.ts +0 -86
- package/src/thirdLib/wm/swiper.test.ts +0 -22
- package/src/thirdLib/wm/swiper.ts +0 -111
- package/src/thirdLib/wm/view.ts +0 -28
- package/src/types/AddNullForObject.ts +0 -6
- package/src/types/AddPrefix.ts +0 -10
- package/src/types/Assert.ts +0 -1
- package/src/types/Assign.ts +0 -1
- package/src/types/ComputeObject.ts +0 -1
- package/src/types/CreateComponentType.ts +0 -37
- package/src/types/DetailedType.ts +0 -15
- package/src/types/ExtendComponentType.ts +0 -60
- package/src/types/Extra.ts +0 -1
- package/src/types/GetComponentPrefix.ts +0 -36
- package/src/types/GetPropertiesDuplicatedKeys.ts +0 -14
- package/src/types/Has.ts +0 -1
- package/src/types/InferDetailedType.test.ts +0 -13
- package/src/types/InferDetailedType.ts +0 -12
- package/src/types/InnerData.ts +0 -1
- package/src/types/ListOfSamePrimitive.ts +0 -20
- package/src/types/OfficialTypeAlias.ts +0 -107
- package/src/types/RemoveInnerData.ts +0 -5
- package/src/types/RemoveNever.ts +0 -6
- package/src/types/RemoveNullOfRequired.ts +0 -8
- package/src/types/RemovePrefix.ts +0 -3
- package/src/types/Replace.ts +0 -24
- package/src/types/ReplacePrefix.ts +0 -46
- package/src/types/RequiredKeys.ts +0 -8
- package/src/types/Shift.ts +0 -2
- package/src/types/TwoParamsEqual.ts +0 -3
- package/src/types/UnionToComma.test.ts +0 -9
- package/src/types/Validators.ts +0 -17
- package/src/types/includes.ts +0 -3
- package/src/utils/InnerMarker.ts +0 -3
- package/src/utils/_utils.ts +0 -8
- package/src/utils/applyDebounceAndThrottle.ts +0 -31
- package/src/utils/debounce.ts +0 -22
- package/src/utils/deepClone.ts +0 -20
- package/src/utils/deepEqual.ts +0 -32
- package/src/utils/isEmptyObject.ts +0 -14
- package/src/utils/nonNullable.ts +0 -20
- package/src/utils/throttle.ts +0 -24
- package/src/utils/typeEqual.ts +0 -30
- package/src/utils/typeNotEqual.ts +0 -48
- package/tsconfig.json +0 -24
- /package/dist/api/{SubComponent → CustomComponent}/returnType.js +0 -0
|
@@ -1,41 +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 { ComputeIntersection, Select } from "hry-types/src/Object/_api";
|
|
4
|
-
import type { ComputeObject } from "../../../types/ComputeObject";
|
|
5
|
-
import type { RemovePrefix } from "../../../types/RemovePrefix";
|
|
6
|
-
import type { Composed } from "../../RootComponent/CustomEvents/CustomEventsTag";
|
|
7
|
-
|
|
8
|
-
type SelectStopEvents<T extends object> = {
|
|
9
|
-
[k in keyof T as k extends `${infer R}_catch` ? R : never]: unknown;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
type GetComposedEvents<
|
|
13
|
-
TCustomEventsDoc extends object,
|
|
14
|
-
> = Select<
|
|
15
|
-
TCustomEventsDoc,
|
|
16
|
-
Composed,
|
|
17
|
-
"contains->"
|
|
18
|
-
>;
|
|
19
|
-
|
|
20
|
-
export type CreatSubComponentDoc<
|
|
21
|
-
ComponentCustomEvents extends object,
|
|
22
|
-
EventsDoc extends object,
|
|
23
|
-
// allDatas extends object,
|
|
24
|
-
// SubMethods extends object,
|
|
25
|
-
ComposedEvents extends object = ComputeObject<
|
|
26
|
-
RemovePrefix<
|
|
27
|
-
Omit<
|
|
28
|
-
GetComposedEvents<ComponentCustomEvents>,
|
|
29
|
-
keyof SelectStopEvents<EventsDoc>
|
|
30
|
-
>
|
|
31
|
-
>
|
|
32
|
-
>,
|
|
33
|
-
CustomCompDoc = ComputeIntersection<
|
|
34
|
-
// 1. 从原始组件文档中排除子组件文档中的事件
|
|
35
|
-
IfExtends<EmptyObject, ComposedEvents, {}, { composedEvents: ComposedEvents }>
|
|
36
|
-
>, // & IfExtends<EmptyObject, SubMethods, {}, { methods: SubMethods }>
|
|
37
|
-
> // & IfExtends<EmptyObject, allDatas, {}, { allDatas: allDatas }>
|
|
38
|
-
=
|
|
39
|
-
// SubComponent中计算属性字段函数若不写返回类型,可能会造成结果中没有计算属性字段类型,若没有其他字段,结果就为'{}',如果加入到DefineComponent的subComponents字段中会引起本来应该报错的组件(例如:'aaa组件缺少xxx必传字段')不报错。所以这里把结果为{}的情况替换为never。可以让组件类型为字符串时报错。
|
|
40
|
-
// & IfExtends<EmptyObject, SubEventsDoc, {}, { events: SubEventsDoc }>
|
|
41
|
-
IfExtends<EmptyObject, CustomCompDoc, never, CustomCompDoc>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
import type { ComponentDoc } from "../../../DefineComponent/returnType/ComponentDoc";
|
|
3
|
-
import { SubComponent } from "../..";
|
|
4
|
-
|
|
5
|
-
type CompDoc = ComponentDoc<{
|
|
6
|
-
properties: {
|
|
7
|
-
aaa_str: string;
|
|
8
|
-
aaa_bool: boolean;
|
|
9
|
-
aaa_num?: number;
|
|
10
|
-
};
|
|
11
|
-
}>;
|
|
12
|
-
|
|
13
|
-
const SubDoc = SubComponent<{}, CompDoc>()({});
|
|
14
|
-
void SubDoc;
|
|
15
|
-
// 返回穿透的自定义事件, 并去除了前缀
|
|
16
|
-
type SubDocExpect = "缺少必传的字段aaa_str、aaa_bool";
|
|
17
|
-
|
|
18
|
-
Checking<typeof SubDoc, SubDocExpect, Test.Pass>();
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
2
|
-
import { Checking, type Test } from "hry-types";
|
|
3
|
-
import type { ComponentDoc } from "../../../DefineComponent/returnType/ComponentDoc";
|
|
4
|
-
import type {
|
|
5
|
-
Bubbles,
|
|
6
|
-
BubblesCaptureComposed,
|
|
7
|
-
BubblesComposed,
|
|
8
|
-
Capture,
|
|
9
|
-
CaptureComposed,
|
|
10
|
-
} from "../../../RootComponent/CustomEvents/CustomEventsTag";
|
|
11
|
-
import { SubComponent } from "../..";
|
|
12
|
-
|
|
13
|
-
type CompDoc = ComponentDoc<{
|
|
14
|
-
properties: {
|
|
15
|
-
aaa_str: string;
|
|
16
|
-
};
|
|
17
|
-
events: {
|
|
18
|
-
aaa_num: number;
|
|
19
|
-
aaa_bubbles: number | Bubbles;
|
|
20
|
-
aaa_bubblesComposed: number | BubblesComposed;
|
|
21
|
-
aaa_captrue: number | Capture;
|
|
22
|
-
aaa_captrueComposed: number | CaptureComposed;
|
|
23
|
-
aaa_bubblesCaptrueComposed: number | BubblesCaptureComposed;
|
|
24
|
-
};
|
|
25
|
-
}>;
|
|
26
|
-
|
|
27
|
-
const SubDoc = SubComponent<{}, CompDoc>()({
|
|
28
|
-
data: {
|
|
29
|
-
aaa_str: "string",
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
void SubDoc;
|
|
33
|
-
// 返回穿透的自定义事件,并去除了前缀
|
|
34
|
-
type SubDocExpect = {
|
|
35
|
-
composedEvents: {
|
|
36
|
-
bubblesComposed: number | BubblesComposed;
|
|
37
|
-
captrueComposed: number | CaptureComposed;
|
|
38
|
-
bubblesCaptrueComposed: number | BubblesCaptureComposed;
|
|
39
|
-
};
|
|
40
|
-
// allDatas: {
|
|
41
|
-
// aaa_str: "string";
|
|
42
|
-
// };
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
Checking<typeof SubDoc, SubDocExpect, Test.Pass>();
|
|
46
|
-
// 去除已经声明的穿透事件
|
|
47
|
-
const removeCatchedEvents = SubComponent<{}, CompDoc>()({
|
|
48
|
-
data: {
|
|
49
|
-
aaa_str: "string",
|
|
50
|
-
},
|
|
51
|
-
events: {
|
|
52
|
-
aaa_bubblesCaptrueComposed_catch() {
|
|
53
|
-
},
|
|
54
|
-
aaa_bubblesComposed_catch() {
|
|
55
|
-
},
|
|
56
|
-
aaa_captrueComposed_catch() {
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
void removeCatchedEvents;
|
|
61
|
-
// 返回穿透的自定义事件,并去除了前缀
|
|
62
|
-
// type RemoveSubDoc = {
|
|
63
|
-
// allDatas: {
|
|
64
|
-
// aaa_str: "string";
|
|
65
|
-
// };
|
|
66
|
-
// events: {
|
|
67
|
-
// aaa_bubblesCaptrueComposed_catch(): void;
|
|
68
|
-
// aaa_bubblesComposed_catch(): void;
|
|
69
|
-
// aaa_captrueComposed_catch(): void;
|
|
70
|
-
// };
|
|
71
|
-
// };
|
|
72
|
-
|
|
73
|
-
Checking<typeof removeCatchedEvents, never, Test.Pass>();
|
|
74
|
-
// 去除有后缀时,已经声明的穿透事件
|
|
75
|
-
const removeCatchedEventsOfSuffix = SubComponent<{}, CompDoc, "aa">()({
|
|
76
|
-
data: {
|
|
77
|
-
aaaAa_str: "string",
|
|
78
|
-
},
|
|
79
|
-
events: {
|
|
80
|
-
aaaAa_bubblesCaptrueComposed_catch() {},
|
|
81
|
-
aaaAa_bubblesComposed_catch() {},
|
|
82
|
-
aaaAa_captrueComposed_catch() {},
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
void removeCatchedEventsOfSuffix;
|
|
86
|
-
// 返回穿透的自定义事件,并去除了前缀
|
|
87
|
-
// type RemoveCatchedEventsOfSuffix = {
|
|
88
|
-
// allDatas: {
|
|
89
|
-
// aaaAa_str: "string";
|
|
90
|
-
// };
|
|
91
|
-
// events: {
|
|
92
|
-
// aaaAa_bubblesCaptrueComposed_catch(): void;
|
|
93
|
-
// aaaAa_bubblesComposed_catch(): void;
|
|
94
|
-
// aaaAa_captrueComposed_catch(): void;
|
|
95
|
-
// };
|
|
96
|
-
// };
|
|
97
|
-
|
|
98
|
-
Checking<typeof removeCatchedEventsOfSuffix, never, Test.Pass>();
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { AddNullForObject } from "../../../types/AddNullForObject";
|
|
2
|
-
import type { Getter } from "../../RootComponent/Store/StoreConstraint";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 子组件Data字段约束
|
|
6
|
-
* @returns 当剩余对象不为空对象,约束对象的key为剩余key,类型为剩余key对应的文档类型或函数返回类型。
|
|
7
|
-
*/
|
|
8
|
-
export type SubStoreConstraint<
|
|
9
|
-
PropertyDoc extends object,
|
|
10
|
-
legal extends object,
|
|
11
|
-
> = {
|
|
12
|
-
[k in keyof legal]?: Getter<PropertyDoc, AddNullForObject<legal[k]> | undefined>;
|
|
13
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { G } from "hry-types";
|
|
2
|
-
import type { Validators } from "../../../types/Validators";
|
|
3
|
-
|
|
4
|
-
export type SubStoreOption<TStore extends object, legalKeys extends PropertyKey> = {
|
|
5
|
-
/**
|
|
6
|
-
* 全局响应式数据字段,全局store对应数据变化实例对应数据自动setData。
|
|
7
|
-
* 约束为组件properties字段去除inherit和data的剩余字段和内部字段
|
|
8
|
-
* 有非法字段(除了约束字段外的字段)检测
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* {
|
|
12
|
-
* //...
|
|
13
|
-
* store: {
|
|
14
|
-
* aaa_str: () => sroreX.str,
|
|
15
|
-
* },
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
store?:
|
|
20
|
-
& TStore
|
|
21
|
-
& Validators<
|
|
22
|
-
[
|
|
23
|
-
G.IllegalFieldValidator<
|
|
24
|
-
TStore,
|
|
25
|
-
legalKeys,
|
|
26
|
-
0,
|
|
27
|
-
"",
|
|
28
|
-
"与inherit和data字段重复或前缀错误"
|
|
29
|
-
>,
|
|
30
|
-
]
|
|
31
|
-
>;
|
|
32
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { observable } from "mobx";
|
|
2
|
-
|
|
3
|
-
import type { ComponentDoc } from "../../../DefineComponent/returnType/ComponentDoc";
|
|
4
|
-
import { SubComponent } from "../..";
|
|
5
|
-
const user = observable({
|
|
6
|
-
name: "zhao",
|
|
7
|
-
age: 20,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
type DocA = ComponentDoc<{
|
|
11
|
-
properties: {
|
|
12
|
-
aaa_str: string;
|
|
13
|
-
aaa_num: number;
|
|
14
|
-
};
|
|
15
|
-
}>;
|
|
16
|
-
|
|
17
|
-
SubComponent<{
|
|
18
|
-
properties: {
|
|
19
|
-
str: string;
|
|
20
|
-
};
|
|
21
|
-
}, DocA>()({
|
|
22
|
-
inherit: {
|
|
23
|
-
aaa_str: "str",
|
|
24
|
-
},
|
|
25
|
-
data: {
|
|
26
|
-
aaa_num: 20,
|
|
27
|
-
_aaa_xxx: 30,
|
|
28
|
-
},
|
|
29
|
-
store: {
|
|
30
|
-
// @ts-expect-error 1 与 inherit 字段重复
|
|
31
|
-
aaa_str: () => user.name,
|
|
32
|
-
// @ts-expect-error 2 与 data 字段重复
|
|
33
|
-
aaa_num: () => user.age,
|
|
34
|
-
// @ts-expect-error 3 超出约束字段
|
|
35
|
-
nu1m: () => user.age,
|
|
36
|
-
// @ts-expect-error 4 与data的内部字段重复
|
|
37
|
-
_aaa_xxx: () => user.age,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
SubComponent<{
|
|
41
|
-
properties: {
|
|
42
|
-
aaa_num: number;
|
|
43
|
-
};
|
|
44
|
-
}, DocA>()({
|
|
45
|
-
store: {
|
|
46
|
-
// @ts-expect-error 与 root 的 properties 字段重复
|
|
47
|
-
aaa_num: () => 123,
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
// 类型约束错误
|
|
51
|
-
SubComponent<{
|
|
52
|
-
properties: {
|
|
53
|
-
aaa_num: number;
|
|
54
|
-
};
|
|
55
|
-
}, DocA>()({
|
|
56
|
-
store: {
|
|
57
|
-
// @ts-expect-error 返回类型错误
|
|
58
|
-
aaa_num: () => "str",
|
|
59
|
-
},
|
|
60
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { observable } from "mobx";
|
|
2
|
-
|
|
3
|
-
import type { ComponentDoc } from "../../../DefineComponent/returnType/ComponentDoc";
|
|
4
|
-
import { SubComponent } from "../..";
|
|
5
|
-
const user = observable({
|
|
6
|
-
name: "zhao",
|
|
7
|
-
age: 20,
|
|
8
|
-
isReady: false,
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
type DocA = ComponentDoc<{
|
|
12
|
-
properties: {
|
|
13
|
-
aaa_str: string;
|
|
14
|
-
aaa_num: number;
|
|
15
|
-
};
|
|
16
|
-
}>;
|
|
17
|
-
|
|
18
|
-
SubComponent<{}, DocA>()({
|
|
19
|
-
store: {
|
|
20
|
-
// 1 可写文档字段
|
|
21
|
-
aaa_str: () => user.name,
|
|
22
|
-
aaa_num: () => user.age,
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
SubComponent<{}, DocA, "a">()({
|
|
27
|
-
store: {
|
|
28
|
-
// 2 可写内部字段
|
|
29
|
-
_aaaA_xxx: () => user.age,
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
// store中可写 额外字段 isReady
|
|
33
|
-
SubComponent<{ data: { _num: number } }, DocA, "a">()({
|
|
34
|
-
store: {
|
|
35
|
-
aaaA_isReady: () => user.isReady,
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
// 4 可以返回undefined,表示该字段不可响应式,不报错,有警告。
|
|
39
|
-
SubComponent<{ properties: { num: number } }, DocA, "a">()({
|
|
40
|
-
store: {
|
|
41
|
-
aaaA_num: (data) => data.num > 10 ? user.age : void 0,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
import type { ComponentDoc } from "../../../DefineComponent/returnType/ComponentDoc";
|
|
3
|
-
import type { Mock_User } from "../../../RootComponent/Properties/test/normalRequired.test";
|
|
4
|
-
import type { RootComponentDefinition } from "../../../RootComponent/returnType";
|
|
5
|
-
import { SubComponent } from "../..";
|
|
6
|
-
|
|
7
|
-
type RootDoc = RootComponentDefinition<{
|
|
8
|
-
properties: {
|
|
9
|
-
obj: Mock_User | null;
|
|
10
|
-
};
|
|
11
|
-
data: {
|
|
12
|
-
num: number;
|
|
13
|
-
};
|
|
14
|
-
store: {
|
|
15
|
-
bool: boolean;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
|
|
19
|
-
type CompDoc = ComponentDoc<{
|
|
20
|
-
properties: {
|
|
21
|
-
aaa_obj: Mock_User | null;
|
|
22
|
-
aaa_str: string;
|
|
23
|
-
aaa_num: number;
|
|
24
|
-
aaa_bool: boolean;
|
|
25
|
-
};
|
|
26
|
-
}>;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* watch computed字段时需要手写类型,可悬停鼠标到key查看类型
|
|
30
|
-
*/
|
|
31
|
-
SubComponent<RootDoc, CompDoc>()({
|
|
32
|
-
computed: {
|
|
33
|
-
aaa_str(): string {
|
|
34
|
-
return this.data.aaa_num.toString();
|
|
35
|
-
},
|
|
36
|
-
aaa_num(): number {
|
|
37
|
-
return 123;
|
|
38
|
-
},
|
|
39
|
-
aaa_bool(): boolean {
|
|
40
|
-
return this.data.bool;
|
|
41
|
-
},
|
|
42
|
-
aaa_obj(): Mock_User {
|
|
43
|
-
return {} as Mock_User;
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
watch: {
|
|
47
|
-
aaa_num(newValue: number, oldValue: number) {
|
|
48
|
-
void oldValue;
|
|
49
|
-
Checking<number, typeof newValue, Test.Pass>();
|
|
50
|
-
|
|
51
|
-
Checking<number, typeof oldValue, Test.Pass>();
|
|
52
|
-
},
|
|
53
|
-
aaa_str(newValue: string, oldValue: string) {
|
|
54
|
-
void oldValue;
|
|
55
|
-
Checking<string, typeof newValue, Test.Pass>();
|
|
56
|
-
|
|
57
|
-
Checking<string, typeof oldValue, Test.Pass>();
|
|
58
|
-
},
|
|
59
|
-
aaa_bool(newValue: boolean, oldValue: boolean) {
|
|
60
|
-
void oldValue;
|
|
61
|
-
Checking<boolean, typeof newValue, Test.Pass>();
|
|
62
|
-
|
|
63
|
-
Checking<boolean, typeof oldValue, Test.Pass>();
|
|
64
|
-
},
|
|
65
|
-
aaa_obj(newValue: Mock_User, oldValue: Mock_User | null) {
|
|
66
|
-
void oldValue;
|
|
67
|
-
Checking<Mock_User, typeof newValue, Test.Pass>();
|
|
68
|
-
|
|
69
|
-
Checking<Mock_User | null, typeof oldValue, Test.Pass>();
|
|
70
|
-
},
|
|
71
|
-
"aaa_obj.**"(newValue: Mock_User, oldValue: Mock_User | null) {
|
|
72
|
-
void oldValue;
|
|
73
|
-
Checking<Mock_User, typeof newValue, Test.Pass>();
|
|
74
|
-
|
|
75
|
-
Checking<Mock_User | null, typeof oldValue, Test.Pass>();
|
|
76
|
-
},
|
|
77
|
-
"aaa_obj.id"(newValue: string, oldValue: string) {
|
|
78
|
-
void oldValue;
|
|
79
|
-
Checking<string, typeof newValue, Test.Pass>();
|
|
80
|
-
|
|
81
|
-
Checking<string, typeof oldValue, Test.Pass>();
|
|
82
|
-
},
|
|
83
|
-
"aaa_obj.age"(newValue: number, oldValue: number) {
|
|
84
|
-
void oldValue;
|
|
85
|
-
Checking<number, typeof newValue, Test.Pass>();
|
|
86
|
-
|
|
87
|
-
Checking<number, typeof oldValue, Test.Pass>();
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
});
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
import { type DetailedType, RootComponent, SubComponent } from "../../../..";
|
|
3
|
-
import type { OptionalType } from "../../../RootComponent/Properties/PropertiesConstraint";
|
|
4
|
-
import {
|
|
5
|
-
type Mock_Cart,
|
|
6
|
-
mock_requiredTypes,
|
|
7
|
-
mock_requiredUnion,
|
|
8
|
-
type Mock_User,
|
|
9
|
-
} from "../../../RootComponent/Properties/test/normalRequired.test";
|
|
10
|
-
|
|
11
|
-
const mock_optional = {
|
|
12
|
-
optional_num: {
|
|
13
|
-
type: Number,
|
|
14
|
-
value: 123,
|
|
15
|
-
},
|
|
16
|
-
optional_gender: {
|
|
17
|
-
type: String as DetailedType<"male" | "female">,
|
|
18
|
-
value: "male" as const,
|
|
19
|
-
},
|
|
20
|
-
optional_obj: {
|
|
21
|
-
type: Object as DetailedType<Mock_User>,
|
|
22
|
-
value: {
|
|
23
|
-
id: "id",
|
|
24
|
-
name: "name",
|
|
25
|
-
age: 20,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
optional_objOrNull: {
|
|
29
|
-
type: Object as DetailedType<Mock_User | null>, // 可选类型定义null默认值方可为null
|
|
30
|
-
value: null,
|
|
31
|
-
},
|
|
32
|
-
} satisfies Record<string, OptionalType>;
|
|
33
|
-
|
|
34
|
-
const rootComponent = RootComponent()({
|
|
35
|
-
properties: {
|
|
36
|
-
...mock_requiredTypes,
|
|
37
|
-
...mock_requiredUnion,
|
|
38
|
-
...mock_optional,
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
type Root = typeof rootComponent;
|
|
43
|
-
void rootComponent;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* watch properties字段 深度只读, 必传对象字段newValue去除null
|
|
47
|
-
*/
|
|
48
|
-
SubComponent<Root, { properties: { aaa_num: number } }>()({
|
|
49
|
-
watch: {
|
|
50
|
-
// 必传单一字段
|
|
51
|
-
str(newValue, oldValue) {
|
|
52
|
-
void oldValue;
|
|
53
|
-
void Checking<string, typeof newValue, Test.Pass>;
|
|
54
|
-
void Checking<string, typeof oldValue, Test.Pass>;
|
|
55
|
-
},
|
|
56
|
-
num(newValue, oldValue) {
|
|
57
|
-
void oldValue;
|
|
58
|
-
void Checking<number, typeof newValue, Test.Pass>;
|
|
59
|
-
void Checking<number, typeof oldValue, Test.Pass>;
|
|
60
|
-
},
|
|
61
|
-
bool(newValue, oldValue) {
|
|
62
|
-
void oldValue;
|
|
63
|
-
void Checking<boolean, typeof newValue, Test.Pass>;
|
|
64
|
-
void Checking<boolean, typeof oldValue, Test.Pass>;
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
obj(newValue, oldValue) {
|
|
68
|
-
void oldValue;
|
|
69
|
-
void Checking<object, typeof newValue, Test.Pass>;
|
|
70
|
-
void Checking<object, typeof oldValue, Test.Pass>;
|
|
71
|
-
},
|
|
72
|
-
tuple(newValue, oldValue) {
|
|
73
|
-
void oldValue;
|
|
74
|
-
void Checking<[string, number, boolean], typeof newValue, Test.Pass>;
|
|
75
|
-
void Checking<[string, number, boolean], typeof oldValue, Test.Pass>;
|
|
76
|
-
},
|
|
77
|
-
union_str(newValue, oldValue) {
|
|
78
|
-
void oldValue;
|
|
79
|
-
void Checking<"male" | "female", typeof newValue, Test.Pass>;
|
|
80
|
-
void Checking<"male" | "female", typeof oldValue, Test.Pass>;
|
|
81
|
-
},
|
|
82
|
-
union_num(newValue, oldValue) {
|
|
83
|
-
void oldValue;
|
|
84
|
-
void Checking<0 | 1 | 2, typeof newValue, Test.Pass>;
|
|
85
|
-
void Checking<0 | 1 | 2, typeof oldValue, Test.Pass>;
|
|
86
|
-
},
|
|
87
|
-
union_bool(newValue, oldValue) {
|
|
88
|
-
void oldValue;
|
|
89
|
-
void Checking<false | true, typeof newValue, Test.Pass>;
|
|
90
|
-
void Checking<false | true, typeof oldValue, Test.Pass>;
|
|
91
|
-
},
|
|
92
|
-
union_arr(newValue, oldValue) {
|
|
93
|
-
void oldValue;
|
|
94
|
-
void Checking<number[] | string[], typeof newValue, Test.Pass>;
|
|
95
|
-
void Checking<number[] | string[], typeof oldValue, Test.Pass>;
|
|
96
|
-
},
|
|
97
|
-
union_obj(newValue, oldValue) {
|
|
98
|
-
void oldValue;
|
|
99
|
-
void Checking<Mock_User | Mock_Cart, typeof newValue, Test.Pass>;
|
|
100
|
-
void Checking<Mock_User | Mock_Cart, typeof oldValue, Test.Pass>;
|
|
101
|
-
},
|
|
102
|
-
// 必传多类型联合
|
|
103
|
-
union_str_num_bool(newValue, oldValue) {
|
|
104
|
-
void oldValue;
|
|
105
|
-
void Checking<string | number | boolean, typeof newValue, Test.Pass>;
|
|
106
|
-
void Checking<string | number | boolean, typeof oldValue, Test.Pass>;
|
|
107
|
-
},
|
|
108
|
-
union_literalStr_Literalnum(newValue, oldValue) {
|
|
109
|
-
void oldValue;
|
|
110
|
-
void Checking<0 | 1 | 2 | "male" | "female", typeof newValue, Test.Pass>;
|
|
111
|
-
void Checking<0 | 1 | 2 | "male" | "female", typeof oldValue, Test.Pass>;
|
|
112
|
-
},
|
|
113
|
-
union_mockUser_num(newValue, oldValue) {
|
|
114
|
-
void oldValue;
|
|
115
|
-
void Checking<number | Mock_User, typeof newValue, Test.Pass>;
|
|
116
|
-
void Checking<number | Mock_User, typeof oldValue, Test.Pass>;
|
|
117
|
-
},
|
|
118
|
-
// 可选字段
|
|
119
|
-
optional_gender(newValue, oldValue) {
|
|
120
|
-
void oldValue;
|
|
121
|
-
void Checking<"male" | "female", typeof newValue, Test.Pass>;
|
|
122
|
-
void Checking<"male" | "female", typeof oldValue, Test.Pass>;
|
|
123
|
-
},
|
|
124
|
-
optional_num(newValue, oldValue) {
|
|
125
|
-
void oldValue;
|
|
126
|
-
void Checking<number, typeof newValue, Test.Pass>;
|
|
127
|
-
void Checking<number, typeof oldValue, Test.Pass>;
|
|
128
|
-
},
|
|
129
|
-
optional_obj(newValue, oldValue) {
|
|
130
|
-
void oldValue;
|
|
131
|
-
void Checking<Mock_User, typeof newValue, Test.Pass>;
|
|
132
|
-
void Checking<Mock_User, typeof oldValue, Test.Pass>;
|
|
133
|
-
},
|
|
134
|
-
// 对象的二段key
|
|
135
|
-
"optional_obj.age"(newValue, oldValue) {
|
|
136
|
-
void oldValue;
|
|
137
|
-
void Checking<number, typeof newValue, Test.Pass>;
|
|
138
|
-
void Checking<number | undefined, typeof oldValue, Test.Pass>;
|
|
139
|
-
},
|
|
140
|
-
"optional_obj.**"(newValue, oldValue) {
|
|
141
|
-
void oldValue;
|
|
142
|
-
void Checking<Mock_User, typeof newValue, Test.Pass>;
|
|
143
|
-
void Checking<Mock_User, typeof oldValue, Test.Pass>;
|
|
144
|
-
},
|
|
145
|
-
"optional_obj.id"(newValue, oldValue) {
|
|
146
|
-
void oldValue;
|
|
147
|
-
void Checking<string, typeof newValue, Test.Pass>;
|
|
148
|
-
void Checking<string, typeof oldValue, Test.Pass>;
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
});
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
|
|
3
|
-
import type { ComponentDoc } from "../../../DefineComponent/returnType/ComponentDoc";
|
|
4
|
-
|
|
5
|
-
import type { Mock_User } from "../../../RootComponent/Properties/test/normalRequired.test";
|
|
6
|
-
import { SubComponent } from "../..";
|
|
7
|
-
|
|
8
|
-
interface TestObj {
|
|
9
|
-
subObj: Mock_User;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
type CompDoc = ComponentDoc<{
|
|
13
|
-
properties: {
|
|
14
|
-
aaa_str: string;
|
|
15
|
-
aaa_num: number;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
|
|
19
|
-
interface RootDoc {
|
|
20
|
-
properties: {
|
|
21
|
-
num: number;
|
|
22
|
-
literal_num: 123 | 456;
|
|
23
|
-
unionStrNum: string | number;
|
|
24
|
-
required_obj: Mock_User | null;
|
|
25
|
-
optional_obj?: TestObj;
|
|
26
|
-
};
|
|
27
|
-
data: {
|
|
28
|
-
str: string;
|
|
29
|
-
literal_str: "a" | "b";
|
|
30
|
-
arr: string[];
|
|
31
|
-
};
|
|
32
|
-
computed: {
|
|
33
|
-
Cuinon: string | boolean;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* watch RootDoc中的数据字段
|
|
39
|
-
*/
|
|
40
|
-
SubComponent<RootDoc, CompDoc>()({
|
|
41
|
-
data: {
|
|
42
|
-
aaa_str: "str",
|
|
43
|
-
},
|
|
44
|
-
store: {
|
|
45
|
-
aaa_num() {
|
|
46
|
-
return 123;
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
watch: {
|
|
50
|
-
// properties 字段
|
|
51
|
-
|
|
52
|
-
num(newValue, oldValue) {
|
|
53
|
-
void oldValue;
|
|
54
|
-
void Checking<number, typeof newValue, Test.Pass>;
|
|
55
|
-
|
|
56
|
-
void Checking<number, typeof oldValue, Test.Pass>;
|
|
57
|
-
},
|
|
58
|
-
literal_num(newValue, oldValue) {
|
|
59
|
-
void oldValue;
|
|
60
|
-
void Checking<123 | 456, typeof newValue, Test.Pass>;
|
|
61
|
-
|
|
62
|
-
void Checking<123 | 456, typeof oldValue, Test.Pass>;
|
|
63
|
-
},
|
|
64
|
-
unionStrNum(newValue, oldValue) {
|
|
65
|
-
void oldValue;
|
|
66
|
-
void Checking<string | number, typeof newValue, Test.Pass>;
|
|
67
|
-
|
|
68
|
-
void Checking<string | number, typeof oldValue, Test.Pass>;
|
|
69
|
-
},
|
|
70
|
-
required_obj(newValue, oldValue) {
|
|
71
|
-
void oldValue;
|
|
72
|
-
void Checking<Mock_User | null, typeof newValue, Test.Pass>;
|
|
73
|
-
|
|
74
|
-
void Checking<Mock_User | null, typeof oldValue, Test.Pass>;
|
|
75
|
-
},
|
|
76
|
-
optional_obj(newValue, oldValue) {
|
|
77
|
-
void oldValue;
|
|
78
|
-
void Checking<TestObj, typeof newValue, Test.Pass>;
|
|
79
|
-
|
|
80
|
-
void Checking<TestObj, typeof oldValue, Test.Pass>;
|
|
81
|
-
},
|
|
82
|
-
"optional_obj.**"(newValue, oldValue) {
|
|
83
|
-
void oldValue;
|
|
84
|
-
void Checking<TestObj, typeof newValue, Test.Pass>;
|
|
85
|
-
|
|
86
|
-
void Checking<TestObj, typeof oldValue, Test.Pass>;
|
|
87
|
-
},
|
|
88
|
-
"optional_obj.subObj"(newValue, oldValue) {
|
|
89
|
-
void oldValue;
|
|
90
|
-
void Checking<Mock_User, typeof newValue, Test.Pass>;
|
|
91
|
-
|
|
92
|
-
void Checking<Mock_User, typeof oldValue, Test.Pass>;
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
// data 字段
|
|
96
|
-
str(newValue, oldValue) {
|
|
97
|
-
void oldValue;
|
|
98
|
-
void Checking<string, typeof newValue, Test.Pass>;
|
|
99
|
-
|
|
100
|
-
void Checking<string, typeof oldValue, Test.Pass>;
|
|
101
|
-
},
|
|
102
|
-
arr(newValue, oldValue) {
|
|
103
|
-
void oldValue;
|
|
104
|
-
void Checking<string[], typeof newValue, Test.Pass>;
|
|
105
|
-
|
|
106
|
-
void Checking<string[], typeof oldValue, Test.Pass>;
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
literal_str(newValue, oldValue) {
|
|
110
|
-
void oldValue;
|
|
111
|
-
void Checking<"a" | "b", typeof newValue, Test.Pass>;
|
|
112
|
-
|
|
113
|
-
void Checking<"a" | "b", typeof oldValue, Test.Pass>;
|
|
114
|
-
},
|
|
115
|
-
// 计算字段
|
|
116
|
-
Cuinon(newValue, oldValue) {
|
|
117
|
-
void oldValue;
|
|
118
|
-
void Checking<string | boolean, typeof newValue, Test.Pass>;
|
|
119
|
-
void Checking<string | boolean, typeof oldValue, Test.Pass>;
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
});
|