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,44 +0,0 @@
|
|
|
1
|
-
import { RootComponent } from "../..";
|
|
2
|
-
|
|
3
|
-
RootComponent()({
|
|
4
|
-
properties: {
|
|
5
|
-
a: String,
|
|
6
|
-
},
|
|
7
|
-
data: {
|
|
8
|
-
str: "str",
|
|
9
|
-
num: 123,
|
|
10
|
-
bool: true,
|
|
11
|
-
arr: [1, 2, 3],
|
|
12
|
-
obj: { a: 1, b: "str" },
|
|
13
|
-
reactiveData: () => 123,
|
|
14
|
-
},
|
|
15
|
-
computed: {
|
|
16
|
-
Cstr() {
|
|
17
|
-
return this.data.str;
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
methods: {
|
|
21
|
-
M1() {
|
|
22
|
-
this.setData({
|
|
23
|
-
str: "string",
|
|
24
|
-
num: 456,
|
|
25
|
-
bool: false,
|
|
26
|
-
arr: [1, 2, 3],
|
|
27
|
-
obj: {
|
|
28
|
-
a: 456,
|
|
29
|
-
b: "str",
|
|
30
|
-
},
|
|
31
|
-
"obj.a": 456,
|
|
32
|
-
"obj.b": "str",
|
|
33
|
-
// @ts-expect-error 不可设置data中响应式数据
|
|
34
|
-
reactiveData: 456,
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
errField() {
|
|
38
|
-
this.setData({
|
|
39
|
-
// @ts-expect-error 不能设置不存在的字段
|
|
40
|
-
"nonexistent": {},
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
});
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
2
|
-
import { Checking, type Test } from "hry-types";
|
|
3
|
-
import type { DetailedType } from "../../../../..";
|
|
4
|
-
import { RootComponent } from "../../..";
|
|
5
|
-
|
|
6
|
-
RootComponent()({
|
|
7
|
-
customEvents: {
|
|
8
|
-
str: String,
|
|
9
|
-
num: Number as DetailedType<1 | 2>,
|
|
10
|
-
union: [String as DetailedType<"male" | "femal">, Number],
|
|
11
|
-
null: null,
|
|
12
|
-
undefined: undefined,
|
|
13
|
-
bubbles: {
|
|
14
|
-
detail: String,
|
|
15
|
-
options: {
|
|
16
|
-
bubbles: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
capturePhase: {
|
|
20
|
-
detail: Number,
|
|
21
|
-
options: {
|
|
22
|
-
capturePhase: true,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
bubblesComposed: {
|
|
26
|
-
detail: Number,
|
|
27
|
-
options: {
|
|
28
|
-
bubbles: true,
|
|
29
|
-
composed: true,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
capturePhaseComposed: {
|
|
33
|
-
detail: Number,
|
|
34
|
-
options: {
|
|
35
|
-
capturePhase: true,
|
|
36
|
-
composed: true,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
bubblesCapturePhaseComposed: {
|
|
40
|
-
detail: null,
|
|
41
|
-
options: {
|
|
42
|
-
bubbles: true,
|
|
43
|
-
capturePhase: true,
|
|
44
|
-
composed: true,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
methods: {
|
|
49
|
-
M1() {
|
|
50
|
-
Checking<(detail: string) => void, typeof this.str, Test.Pass>;
|
|
51
|
-
|
|
52
|
-
Checking<(detail: 1 | 2) => void, typeof this.num, Test.Pass>;
|
|
53
|
-
|
|
54
|
-
Checking<(detail: "male" | "femal" | number) => void, typeof this.union, Test.Pass>;
|
|
55
|
-
|
|
56
|
-
Checking<(detail: null) => void, typeof this.null, Test.Pass>;
|
|
57
|
-
|
|
58
|
-
Checking<() => void, typeof this.undefined, Test.Pass>;
|
|
59
|
-
|
|
60
|
-
Checking<(detail: string) => void, typeof this.str, Test.Pass>;
|
|
61
|
-
|
|
62
|
-
Checking<(detail: number) => void, typeof this.capturePhase, Test.Pass>;
|
|
63
|
-
|
|
64
|
-
Checking<(detail: number) => void, typeof this.bubblesComposed, Test.Pass>;
|
|
65
|
-
|
|
66
|
-
Checking<(detail: number) => void, typeof this.capturePhaseComposed, Test.Pass>;
|
|
67
|
-
|
|
68
|
-
Checking<(detail: null) => void, typeof this.bubblesCapturePhaseComposed, Test.Pass>;
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
import { RootComponent } from "../../../../..";
|
|
3
|
-
|
|
4
|
-
RootComponent()({
|
|
5
|
-
methods: {
|
|
6
|
-
M1() {
|
|
7
|
-
return 1;
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
M2(str: string) {
|
|
11
|
-
void Checking<typeof this.M1, () => 1, Test.Pass>;
|
|
12
|
-
|
|
13
|
-
void Checking<typeof this.M2, (str: string) => string, Test.Pass>;
|
|
14
|
-
|
|
15
|
-
return str;
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
3
|
-
import { Checking, type Test } from "hry-types";
|
|
4
|
-
import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
|
|
5
|
-
import { type DetailedType, RootComponent } from "../../../../..";
|
|
6
|
-
import type { IInjectAllData } from "../../../../InstanceInject/instanceConfig";
|
|
7
|
-
|
|
8
|
-
// 组件时
|
|
9
|
-
RootComponent()({
|
|
10
|
-
properties: {
|
|
11
|
-
obj: Object,
|
|
12
|
-
optionalObj: {
|
|
13
|
-
type: Object as DetailedType<{ name: string }>,
|
|
14
|
-
value: { name: "zhao" },
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
lifetimes: {
|
|
18
|
-
attached() {
|
|
19
|
-
// 组件实例对象格外添加null类型
|
|
20
|
-
Checking<
|
|
21
|
-
typeof this.data,
|
|
22
|
-
ComputeIntersection<
|
|
23
|
-
{
|
|
24
|
-
optionalObj: { name: string };
|
|
25
|
-
obj: object;
|
|
26
|
-
} & IInjectAllData
|
|
27
|
-
>,
|
|
28
|
-
Test.Pass
|
|
29
|
-
>;
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// 页面时
|
|
35
|
-
RootComponent()({
|
|
36
|
-
isPage: true,
|
|
37
|
-
properties: {
|
|
38
|
-
obj: Object,
|
|
39
|
-
optionalObj: {
|
|
40
|
-
type: Object as DetailedType<{ name: string }>,
|
|
41
|
-
value: { name: "zhao" },
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
pageLifetimes: {
|
|
45
|
-
onLoad(data) {
|
|
46
|
-
Checking<typeof data, {
|
|
47
|
-
optionalObj: {
|
|
48
|
-
name: string;
|
|
49
|
-
};
|
|
50
|
-
obj: object;
|
|
51
|
-
}, Test.Pass>;
|
|
52
|
-
// 页面可选对象不额外添加null
|
|
53
|
-
Checking<typeof this.data.optionalObj, { name: string }, Test.Pass>;
|
|
54
|
-
// 页面必传对象没有null
|
|
55
|
-
Checking<typeof this.data.obj, object, Test.Pass>;
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { RootComponent } from "../../..";
|
|
2
|
-
|
|
3
|
-
RootComponent()({
|
|
4
|
-
properties: {
|
|
5
|
-
Pobj: Object,
|
|
6
|
-
},
|
|
7
|
-
data: {
|
|
8
|
-
str: "str",
|
|
9
|
-
num: 123,
|
|
10
|
-
literal: 456 as 456 | 789,
|
|
11
|
-
bool: true,
|
|
12
|
-
arr: [1, 2, 3],
|
|
13
|
-
obj: { num: 1, str: "str" },
|
|
14
|
-
},
|
|
15
|
-
store: {
|
|
16
|
-
Snum: () => 123,
|
|
17
|
-
},
|
|
18
|
-
computed: {
|
|
19
|
-
Cnum() {
|
|
20
|
-
return this.data.Snum;
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
methods: {
|
|
24
|
-
M1() {
|
|
25
|
-
this.setData({
|
|
26
|
-
// @ts-expect-error 不可对properties字段setData
|
|
27
|
-
Pobj: {},
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
this.setData({
|
|
31
|
-
// @ts-expect-error 不可对Store字段setData
|
|
32
|
-
Snum: 123,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
this.setData({
|
|
36
|
-
// @ts-expect-error 不可对computed字段setData
|
|
37
|
-
Cnum: 123,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// 对data字段set时有类型检查
|
|
41
|
-
this.setData({
|
|
42
|
-
// @ts-expect-error 类型错误 string
|
|
43
|
-
str: 123,
|
|
44
|
-
// @ts-expect-error 类型错误 number
|
|
45
|
-
num: "str",
|
|
46
|
-
// @ts-expect-error 类型错误 456 | 789
|
|
47
|
-
literal: 123,
|
|
48
|
-
// @ts-expect-error 类型错误 boolean
|
|
49
|
-
bool: 123,
|
|
50
|
-
// @ts-expect-error 类型错误 number[]
|
|
51
|
-
arr: [1, 2, 3, "a"],
|
|
52
|
-
obj: {
|
|
53
|
-
// @ts-expect-error 类型错误 number
|
|
54
|
-
num: "str",
|
|
55
|
-
// @ts-expect-error 类型错误 number
|
|
56
|
-
str: 123,
|
|
57
|
-
},
|
|
58
|
-
// @ts-expect-error 类型错误 number
|
|
59
|
-
"obj.num": "str",
|
|
60
|
-
// @ts-expect-error 类型错误 string
|
|
61
|
-
"obj.str": 123,
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { observable, runInAction } from "mobx";
|
|
2
|
-
import { RootComponent } from "../../..";
|
|
3
|
-
|
|
4
|
-
// 可以对data数据进行setData
|
|
5
|
-
RootComponent()({
|
|
6
|
-
data: {
|
|
7
|
-
str: "str",
|
|
8
|
-
num: 123,
|
|
9
|
-
literal: 456 as 456 | 789,
|
|
10
|
-
bool: true,
|
|
11
|
-
arr: [1, 2, 3],
|
|
12
|
-
obj: { a: 1, b: "str" },
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
methods: {
|
|
16
|
-
M1() {
|
|
17
|
-
// 可以对data数据进行setData
|
|
18
|
-
this.setData({
|
|
19
|
-
str: "string",
|
|
20
|
-
num: 456,
|
|
21
|
-
bool: false,
|
|
22
|
-
literal: 456,
|
|
23
|
-
arr: [1, 2, 3],
|
|
24
|
-
obj: {
|
|
25
|
-
a: 456,
|
|
26
|
-
b: "str",
|
|
27
|
-
},
|
|
28
|
-
"obj.a": 456,
|
|
29
|
-
"obj.b": "str",
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const store = observable({
|
|
36
|
-
name: "zhao",
|
|
37
|
-
age: 20,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
RootComponent()({
|
|
41
|
-
store: {
|
|
42
|
-
name: () => store.name,
|
|
43
|
-
},
|
|
44
|
-
lifetimes: {
|
|
45
|
-
attached() {
|
|
46
|
-
runInAction(() => {
|
|
47
|
-
store.name = "liil";
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
3
|
-
import { Checking, type Test } from "hry-types";
|
|
4
|
-
import { RootComponent } from "../..";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 1. 无isPage字段时,返回Doc中无isPage字段
|
|
8
|
-
*/
|
|
9
|
-
const noIsPage = RootComponent()({});
|
|
10
|
-
|
|
11
|
-
Checking<typeof noIsPage, {}, Test.Pass>;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 2. isPage字段为false时,返回Doc中无isPage字段
|
|
15
|
-
*/
|
|
16
|
-
const isPageIsfalse = RootComponent()({
|
|
17
|
-
isPage: false,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Checking<typeof isPageIsfalse, {}, Test.Pass>;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* 3. isPage字段为true时,返回Doc中isPage为true
|
|
24
|
-
*/
|
|
25
|
-
const isPageIsTrue = RootComponent()({
|
|
26
|
-
isPage: true,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
Checking<typeof isPageIsTrue, { isPage: true }, Test.Pass>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
|
|
2
|
-
import type { WMCompLifetimes } from "../../../types/OfficialTypeAlias";
|
|
3
|
-
import type { FinalOptionsOfComponent } from "../../DefineComponent/normalizeOptions";
|
|
4
|
-
|
|
5
|
-
export type LifetimesConstraint = // 官方组件生命周期
|
|
6
|
-
ComputeIntersection<
|
|
7
|
-
& WMCompLifetimes["lifetimes"]
|
|
8
|
-
& {
|
|
9
|
-
/**
|
|
10
|
-
* 建立组件时的真正配置对象
|
|
11
|
-
*/
|
|
12
|
-
beforeCreate?: (this: undefined, options: FinalOptionsOfComponent) => void;
|
|
13
|
-
}
|
|
14
|
-
>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { LifetimesConstraint } from "./LifetimesConstraint";
|
|
2
|
-
|
|
3
|
-
export type LifetimesOption = {
|
|
4
|
-
/**
|
|
5
|
-
* 在原生类型上增加了beforeCreate周期
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* RootComponent()({
|
|
9
|
-
* lifetimes: {
|
|
10
|
-
* beforeCreate(opitons) {
|
|
11
|
-
* opitons;//为最终进入Component的配置对象
|
|
12
|
-
* },
|
|
13
|
-
* created() {
|
|
14
|
-
* },
|
|
15
|
-
* attached() {
|
|
16
|
-
* },
|
|
17
|
-
* ready() {
|
|
18
|
-
* },
|
|
19
|
-
* detached() {
|
|
20
|
-
* },
|
|
21
|
-
* error(err) {
|
|
22
|
-
* err.cause;
|
|
23
|
-
* },
|
|
24
|
-
* moved() {
|
|
25
|
-
* },
|
|
26
|
-
* },
|
|
27
|
-
* });
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
lifetimes?: LifetimesConstraint;
|
|
31
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { RootComponent } from "../..";
|
|
2
|
-
|
|
3
|
-
RootComponent()({
|
|
4
|
-
lifetimes: {
|
|
5
|
-
beforeCreate() {
|
|
6
|
-
void 0;
|
|
7
|
-
},
|
|
8
|
-
created() {
|
|
9
|
-
void 0;
|
|
10
|
-
},
|
|
11
|
-
attached() {
|
|
12
|
-
void 0;
|
|
13
|
-
},
|
|
14
|
-
ready() {
|
|
15
|
-
void 0;
|
|
16
|
-
},
|
|
17
|
-
detached() {
|
|
18
|
-
void 0;
|
|
19
|
-
},
|
|
20
|
-
error(err) {
|
|
21
|
-
void err.message;
|
|
22
|
-
},
|
|
23
|
-
moved() {
|
|
24
|
-
void 0;
|
|
25
|
-
},
|
|
26
|
-
// @ts-expect-error 1 错误的生命周期字段报错
|
|
27
|
-
xxx() {
|
|
28
|
-
void 0;
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
import { RootComponent } from "../../../..";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 组件时(无ispage字段或为false),lifetimes为官方约束 + beforeCreate声明周期
|
|
6
|
-
*/
|
|
7
|
-
RootComponent()({
|
|
8
|
-
lifetimes: {
|
|
9
|
-
// 新增声明周期可用于查看或拓展配置文件
|
|
10
|
-
beforeCreate(opitons) {
|
|
11
|
-
void Checking<typeof this, undefined, Test.Pass>;
|
|
12
|
-
|
|
13
|
-
void opitons;
|
|
14
|
-
},
|
|
15
|
-
created() {
|
|
16
|
-
void 0;
|
|
17
|
-
},
|
|
18
|
-
attached() {
|
|
19
|
-
void 0;
|
|
20
|
-
},
|
|
21
|
-
ready() {
|
|
22
|
-
void 0;
|
|
23
|
-
},
|
|
24
|
-
detached() {
|
|
25
|
-
void 0;
|
|
26
|
-
},
|
|
27
|
-
error(err) {
|
|
28
|
-
void err.message;
|
|
29
|
-
},
|
|
30
|
-
moved() {
|
|
31
|
-
void 0;
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { G } from "hry-types";
|
|
2
|
-
|
|
3
|
-
import type { MethodsConstraint } from "./MethodsConstraint";
|
|
4
|
-
|
|
5
|
-
export type MethodsOption<
|
|
6
|
-
TMethods extends MethodsConstraint,
|
|
7
|
-
DuplicateField extends PropertyKey,
|
|
8
|
-
> = {
|
|
9
|
-
/**
|
|
10
|
-
* 与customEvents和events字段重复检测
|
|
11
|
-
*/
|
|
12
|
-
methods?:
|
|
13
|
-
& TMethods
|
|
14
|
-
& G.DuplicateFieldValidator<TMethods, DuplicateField>;
|
|
15
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { RootComponent } from "../..";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 重复字段错误
|
|
5
|
-
*/
|
|
6
|
-
RootComponent()({
|
|
7
|
-
events: {
|
|
8
|
-
eventField() {
|
|
9
|
-
void 0;
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
customEvents: {
|
|
13
|
-
customField: String,
|
|
14
|
-
},
|
|
15
|
-
methods: {
|
|
16
|
-
// @ts-expect-error "⚠️与events字段重复⚠️"
|
|
17
|
-
eventField() {
|
|
18
|
-
void 0;
|
|
19
|
-
},
|
|
20
|
-
// @ts-expect-error "⚠️与customEvents字段重复⚠️"
|
|
21
|
-
customField() {
|
|
22
|
-
void 0;
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 2. 没有的字段报错
|
|
29
|
-
*/
|
|
30
|
-
RootComponent()({
|
|
31
|
-
methods: {
|
|
32
|
-
M1() {
|
|
33
|
-
void 0;
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
M2() {
|
|
37
|
-
// @ts-expect-error 没有的字段
|
|
38
|
-
this.M3();
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
import { RootComponent } from "../..";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 1 有methods时 返回Doc中methods类型与定义相同
|
|
6
|
-
*/
|
|
7
|
-
const RootDoc = RootComponent()({
|
|
8
|
-
methods: {
|
|
9
|
-
num() {
|
|
10
|
-
return 1;
|
|
11
|
-
},
|
|
12
|
-
str(str: string) {
|
|
13
|
-
return str;
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
void RootDoc;
|
|
18
|
-
type RootDocExpected = {
|
|
19
|
-
methods: {
|
|
20
|
-
num: () => 1;
|
|
21
|
-
str: (str: string) => string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
void Checking<typeof RootDoc, RootDocExpected, Test.Pass>;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
import type { IsPureObject } from "hry-types/src/Any/IsPureObject";
|
|
3
|
-
import type { NoInfer } from "hry-types/src/Generic/NoInfer";
|
|
4
|
-
import type { EmptyObject } from "hry-types/src/Misc/EmptyObject";
|
|
5
|
-
|
|
6
|
-
type getFirstKeys<T extends string> = T extends `${infer F}.${string}` ? F : never;
|
|
7
|
-
|
|
8
|
-
type getLastKeys<T extends string> = T extends `${string}.${infer L}` ? L : never;
|
|
9
|
-
|
|
10
|
-
// 加入对象字段一级key 例如 `obj.xxx`(newValue,oldValue){...}和`obj.**`
|
|
11
|
-
type AddFieldsOfObject<
|
|
12
|
-
TWatchData extends object,
|
|
13
|
-
_WatchKeys extends keyof TWatchData,
|
|
14
|
-
secondKeys extends string = {
|
|
15
|
-
[k in _WatchKeys]: IsPureObject<Exclude<TWatchData[k], null>> extends true
|
|
16
|
-
? `${k & string}.${(keyof Exclude<TWatchData[k], null>) & string}` | `${k & string}.**`
|
|
17
|
-
: never;
|
|
18
|
-
}[_WatchKeys],
|
|
19
|
-
> = {
|
|
20
|
-
[k in secondKeys]?: (
|
|
21
|
-
// @ts-ignore
|
|
22
|
-
newValue: IfExtends<
|
|
23
|
-
getLastKeys<k>,
|
|
24
|
-
"**",
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
TWatchData[getFirstKeys<k>],
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
NonNullable<(Exclude<TWatchData[getFirstKeys<k>], null>)[getLastKeys<k>]>
|
|
29
|
-
>,
|
|
30
|
-
) => void | Promise<void>;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type ObserversOption<TWatchData extends object, _WatchKeys extends keyof TWatchData = keyof TWatchData> = {
|
|
34
|
-
/**
|
|
35
|
-
* 监控所有data字段,值变化时(JSON.stringify判断)运行watch函数,一参为最新值,二参为变化前值。
|
|
36
|
-
* 对象数据可通过`obj.xxx:`监控具体字段(只加入了一级字段类型提示)
|
|
37
|
-
*/
|
|
38
|
-
observers?: IfExtends<
|
|
39
|
-
{},
|
|
40
|
-
TWatchData,
|
|
41
|
-
EmptyObject,
|
|
42
|
-
// 不加NoInfer会导致只监控计算字段时错误
|
|
43
|
-
NoInfer<
|
|
44
|
-
& {
|
|
45
|
-
[k in _WatchKeys | "**"]?: (
|
|
46
|
-
newValue: k extends keyof TWatchData ? TWatchData[k] : unknown,
|
|
47
|
-
) => void | Promise<void>;
|
|
48
|
-
}
|
|
49
|
-
// 解决单独书写计算书写字段的报错(或许是:ts字面量约束检测提前计算属性key引起的错误提示)
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
|
|
51
|
-
& {
|
|
52
|
-
[k in _WatchKeys as never]: unknown;
|
|
53
|
-
}
|
|
54
|
-
// 加入对象的一级字段类型提示
|
|
55
|
-
& AddFieldsOfObject<TWatchData, _WatchKeys>
|
|
56
|
-
>
|
|
57
|
-
>;
|
|
58
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
|
|
3
|
-
import { RootComponent } from "../..";
|
|
4
|
-
type User = {
|
|
5
|
-
name: string;
|
|
6
|
-
age?: number;
|
|
7
|
-
};
|
|
8
|
-
RootComponent()({
|
|
9
|
-
data: {
|
|
10
|
-
obj: {} as User | null,
|
|
11
|
-
},
|
|
12
|
-
observers: {
|
|
13
|
-
obj(a) {
|
|
14
|
-
void a;
|
|
15
|
-
void Checking<typeof a, User | null, Test.Pass>;
|
|
16
|
-
},
|
|
17
|
-
"obj.**"(a) {
|
|
18
|
-
void a;
|
|
19
|
-
void Checking<typeof a, User | null, Test.Pass>;
|
|
20
|
-
},
|
|
21
|
-
"obj.age"(a) {
|
|
22
|
-
void a;
|
|
23
|
-
void Checking<typeof a, number, Test.Pass>;
|
|
24
|
-
},
|
|
25
|
-
"obj.name"(a) {
|
|
26
|
-
void a;
|
|
27
|
-
void Checking<typeof a, string, Test.Pass>;
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
});
|