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,49 +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_num: number;
|
|
9
|
-
};
|
|
10
|
-
}>;
|
|
11
|
-
|
|
12
|
-
// 可以为空对象
|
|
13
|
-
SubComponent<{}, CompDoc>()({
|
|
14
|
-
watch: {},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* watch 自身data字段
|
|
19
|
-
*/
|
|
20
|
-
SubComponent<{}, CompDoc>()({
|
|
21
|
-
data: {
|
|
22
|
-
aaa_str: "123",
|
|
23
|
-
|
|
24
|
-
_aaa_other: 123,
|
|
25
|
-
},
|
|
26
|
-
store: {
|
|
27
|
-
aaa_num: () => 123,
|
|
28
|
-
},
|
|
29
|
-
watch: {
|
|
30
|
-
aaa_str(newValue, oldValue) {
|
|
31
|
-
void oldValue;
|
|
32
|
-
void Checking<"123", typeof newValue, Test.Pass>;
|
|
33
|
-
|
|
34
|
-
void Checking<"123", typeof oldValue, Test.Pass>;
|
|
35
|
-
},
|
|
36
|
-
aaa_num(newValue, oldValue) {
|
|
37
|
-
void oldValue;
|
|
38
|
-
void Checking<number, typeof newValue, Test.Pass>;
|
|
39
|
-
|
|
40
|
-
void Checking<number, typeof oldValue, Test.Pass>;
|
|
41
|
-
},
|
|
42
|
-
_aaa_other(newValue, oldValue) {
|
|
43
|
-
void oldValue;
|
|
44
|
-
void Checking<number, typeof newValue, Test.Pass>;
|
|
45
|
-
|
|
46
|
-
void Checking<number, typeof oldValue, Test.Pass>;
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
import { SubComponent } from "../..";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* watch 注入的store字段
|
|
6
|
-
*/
|
|
7
|
-
SubComponent<{}, { properties: { aaa_num: number } }>()({
|
|
8
|
-
watch: {
|
|
9
|
-
injectTheme(newValue, oldValue) {
|
|
10
|
-
void Checking<"dark" | "light" | undefined, typeof newValue, Test.Pass>;
|
|
11
|
-
|
|
12
|
-
void Checking<"dark" | "light" | undefined, typeof oldValue, Test.Pass>;
|
|
13
|
-
void oldValue;
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { Wm } from "../../../..";
|
|
2
|
-
import { SubComponent } from "../..";
|
|
3
|
-
|
|
4
|
-
// 测试1
|
|
5
|
-
SubComponent<{ events: { a: string } }, Wm.View>()({
|
|
6
|
-
watch: {
|
|
7
|
-
// @ts-expect-error 无可监控字段时,约束为EmptyObject,不可写任何字段
|
|
8
|
-
nothing() {
|
|
9
|
-
void 0;
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 测试2 超出约束字段报错
|
|
16
|
-
*/
|
|
17
|
-
SubComponent<{ events: { a: string } }, Wm.View>()({
|
|
18
|
-
data: {
|
|
19
|
-
view_hoverClass: " h-100",
|
|
20
|
-
},
|
|
21
|
-
watch: {
|
|
22
|
-
view_hoverClass(newValue, oldValue) { // ok
|
|
23
|
-
console.log(newValue, oldValue);
|
|
24
|
-
},
|
|
25
|
-
// @ts-expect-error 超出约束字段错误
|
|
26
|
-
view_xxxhoverClass() {
|
|
27
|
-
// do something
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
SubComponent<{ data: { user: null | object } }, Wm.View>()({
|
|
32
|
-
data: {
|
|
33
|
-
view_hoverClass: " h-100",
|
|
34
|
-
},
|
|
35
|
-
watch: {
|
|
36
|
-
view_hoverClass(newValue, oldValue) { // ok
|
|
37
|
-
console.log(newValue, oldValue);
|
|
38
|
-
},
|
|
39
|
-
// @ts-expect-error 超出约束字段错误
|
|
40
|
-
view_xxxhoverClass() {
|
|
41
|
-
// do something
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
/**
|
|
46
|
-
* 3 对象联合null的类型 不能watch子字段
|
|
47
|
-
*/
|
|
48
|
-
SubComponent<{ data: { user: null | object } }, { properties: { a: number } }>()({
|
|
49
|
-
watch: {
|
|
50
|
-
user(newValue, oldValue) {
|
|
51
|
-
void oldValue;
|
|
52
|
-
void newValue;
|
|
53
|
-
},
|
|
54
|
-
// @ts-expect-error 不能watch子字段 因为user可能为null
|
|
55
|
-
"user.name"(newValue, oldValue) {
|
|
56
|
-
void oldValue;
|
|
57
|
-
void newValue;
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
});
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
import type { EmptyObject } from "hry-types/src/Misc/EmptyObject";
|
|
3
|
-
import type { RequiredKeys } from "hry-types/src/Object/RequiredKeys";
|
|
4
|
-
import type { Extra } from "../../types/Extra";
|
|
5
|
-
import type { GetComponentPrefix } from "../../types/GetComponentPrefix";
|
|
6
|
-
import type { InnerFields } from "../../types/InnerData";
|
|
7
|
-
import type { WMCompOtherOption } from "../../types/OfficialTypeAlias";
|
|
8
|
-
import type { Replace } from "../../types/Replace";
|
|
9
|
-
import type { ReplacePrefix } from "../../types/ReplacePrefix";
|
|
10
|
-
import type { UnionToComma } from "../../types/UnionToComma.test";
|
|
11
|
-
import type { ComponentDoc } from "../DefineComponent/returnType/ComponentDoc";
|
|
12
|
-
import type { IInjectStore } from "../InstanceInject/instanceConfig";
|
|
13
|
-
import type { RootComponentDefinition } from "../RootComponent/returnType";
|
|
14
|
-
import type { GetStoreDef } from "../RootComponent/Store/GetStoreDef";
|
|
15
|
-
import type { GetSubComputedDoc } from "./SubComputed/GetSubComputedDoc";
|
|
16
|
-
import type { SubComputedConstraint } from "./SubComputed/SubComputedConstraint";
|
|
17
|
-
import type { SubComputedOption } from "./SubComputed/SubComputedOption";
|
|
18
|
-
import type { SubDataConstraint } from "./SubData/SubDataConstraint";
|
|
19
|
-
import type { SubDataOption } from "./SubData/SubDataOption";
|
|
20
|
-
import type { SubEventsConstraint } from "./SubEvents/SubEventsConstraint";
|
|
21
|
-
import type { SubEventsOption } from "./SubEvents/SubEventsOption";
|
|
22
|
-
import type { SubInheritConstraint } from "./SubInherit/SubInheritConstraint";
|
|
23
|
-
import type { SubInheritOption } from "./SubInherit/SubInheritOption";
|
|
24
|
-
import type { SubInstance } from "./SubInstance/SubInstance";
|
|
25
|
-
import type { SubLifetimesOption } from "./SubLifetimes/SubLifetimesOption";
|
|
26
|
-
import type { SubMethodsConstraint } from "./SubMethods/SubMethodsConstraint";
|
|
27
|
-
import type { SubMethodsOption } from "./SubMethods/SubMethodsOption";
|
|
28
|
-
import type { SubObserversOption } from "./SubObservers/SubObserversOption";
|
|
29
|
-
import type { SubPageLifetimesOption } from "./SubPageLifetimes/SubPageLifetimesOption";
|
|
30
|
-
import type { CreatSubComponentDoc } from "./SubReturnType/CreateSubComponentDoc";
|
|
31
|
-
import type { SubStoreConstraint } from "./SubStore/SubStoreConstraint";
|
|
32
|
-
import type { SubStoreOption } from "./SubStore/SubStoreOption";
|
|
33
|
-
import type { SubWatchOption } from "./SubWatch/SubWatchOption";
|
|
34
|
-
|
|
35
|
-
type Options<
|
|
36
|
-
RootDoc extends RootComponentDefinition,
|
|
37
|
-
IsPage extends boolean,
|
|
38
|
-
CurrentCompDoc extends ComponentDoc,
|
|
39
|
-
Prefix extends string,
|
|
40
|
-
AllRootDataDoc extends object,
|
|
41
|
-
TInherit extends object,
|
|
42
|
-
TSubData extends object,
|
|
43
|
-
TSubStore extends object,
|
|
44
|
-
TSubComputed extends object,
|
|
45
|
-
TEvents extends object,
|
|
46
|
-
TSubMethods extends SubMethodsConstraint,
|
|
47
|
-
InheritDoc extends object,
|
|
48
|
-
SubDataDoc extends object,
|
|
49
|
-
SubStoreDoc extends object,
|
|
50
|
-
SubComputedDoc extends object,
|
|
51
|
-
SubEventsDoc extends object,
|
|
52
|
-
SubMethodsDoc extends object,
|
|
53
|
-
CompDocKeys extends PropertyKey = keyof CurrentCompDoc["properties"],
|
|
54
|
-
> =
|
|
55
|
-
& SubInheritOption<
|
|
56
|
-
TInherit,
|
|
57
|
-
{
|
|
58
|
-
[k in keyof NoInfer<TInherit>]:
|
|
59
|
-
// 与根组件的数据字段重复的不合法
|
|
60
|
-
k extends keyof (AllRootDataDoc) ? never
|
|
61
|
-
// 继承CompDocKeys的字段合法
|
|
62
|
-
: k extends CompDocKeys ? k
|
|
63
|
-
: never;
|
|
64
|
-
}[keyof NoInfer<TInherit>]
|
|
65
|
-
>
|
|
66
|
-
& SubDataOption<
|
|
67
|
-
TSubData,
|
|
68
|
-
// 合法的配置
|
|
69
|
-
{
|
|
70
|
-
[k in keyof NoInfer<TSubData>]:
|
|
71
|
-
// 与根组件和InheritDoc的数据字段重复的不合法
|
|
72
|
-
k extends keyof (AllRootDataDoc) ? never
|
|
73
|
-
// 继承剩余的Doc的字段合法
|
|
74
|
-
: k extends Exclude<CompDocKeys, (keyof (InheritDoc))> ? k
|
|
75
|
-
// 内部字段合法
|
|
76
|
-
: k extends InnerFields<Prefix> ? k
|
|
77
|
-
: never;
|
|
78
|
-
}[keyof NoInfer<TSubData>],
|
|
79
|
-
"子组件无需此字段或与Inherit字段重复"
|
|
80
|
-
>
|
|
81
|
-
& SubStoreOption<
|
|
82
|
-
TSubStore,
|
|
83
|
-
{
|
|
84
|
-
[k in keyof NoInfer<TSubStore>]:
|
|
85
|
-
// 与根组件和DataDoc的数据字段重复的不合法(主要是验证内部字段)
|
|
86
|
-
k extends keyof (AllRootDataDoc & SubDataDoc) ? never
|
|
87
|
-
// 继承剩余Doc的字段合法
|
|
88
|
-
: k extends Exclude<CompDocKeys, (keyof (InheritDoc & SubDataDoc))> ? k
|
|
89
|
-
// 内部字段合法
|
|
90
|
-
: k extends InnerFields<Prefix> ? k
|
|
91
|
-
: never;
|
|
92
|
-
}[keyof NoInfer<TSubStore>]
|
|
93
|
-
>
|
|
94
|
-
& SubComputedOption<
|
|
95
|
-
TSubComputed,
|
|
96
|
-
{
|
|
97
|
-
[k in keyof NoInfer<TSubComputed>]:
|
|
98
|
-
// 与根组件和DataDoc和SubStoreDoc的key重复的不合法(主要是验证内部字段)
|
|
99
|
-
k extends keyof (AllRootDataDoc & SubDataDoc & SubStoreDoc) ? never
|
|
100
|
-
// 继承剩余Doc的字段合法
|
|
101
|
-
: k extends Exclude<CompDocKeys, (keyof (InheritDoc & SubDataDoc & SubStoreDoc))> ? k
|
|
102
|
-
// 内部字段合法
|
|
103
|
-
: k extends InnerFields<Prefix> ? k
|
|
104
|
-
: never;
|
|
105
|
-
}[keyof NoInfer<TSubComputed>]
|
|
106
|
-
> // 下面为之前的写法 不好与根组件的字段重复检测。
|
|
107
|
-
// | Exclude<CompDocKeys, (keyof (InheritDoc & SubDataDoc & SubStoreDoc))>
|
|
108
|
-
// | Extract<Exclude<keyof NoInfer<TSubComputed>, keyof (SubDataDoc & SubStoreDoc)>, InnerFields<Prefix>>,
|
|
109
|
-
// {
|
|
110
|
-
// data: ComputeObject<
|
|
111
|
-
// & AllRootDataDoc
|
|
112
|
-
// & Replace<SubComputedDoc, Required<CurrentCompDoc["properties"]>>
|
|
113
|
-
// & SubStoreDoc
|
|
114
|
-
// & SubDataDoc
|
|
115
|
-
// & IInjectAllData
|
|
116
|
-
// >;
|
|
117
|
-
// }
|
|
118
|
-
// 无需与根组件的events字段重复检测,因为根组件多了bubbles字段,一定不会重复
|
|
119
|
-
& SubEventsOption<TEvents, SubEventsDoc, keyof SubEventsConstraint<CurrentCompDoc>>
|
|
120
|
-
& SubMethodsOption<TSubMethods, Prefix, keyof (CurrentCompDoc["events"] & SubEventsDoc)>
|
|
121
|
-
& SubPageLifetimesOption<IsPage, NonNullable<RootDoc["properties"]>>
|
|
122
|
-
& SubLifetimesOption
|
|
123
|
-
& SubWatchOption<
|
|
124
|
-
& SubComputedDoc
|
|
125
|
-
& SubDataDoc
|
|
126
|
-
& AllRootDataDoc
|
|
127
|
-
& SubStoreDoc
|
|
128
|
-
& IInjectStore
|
|
129
|
-
>
|
|
130
|
-
& Partial<Omit<WMCompOtherOption, "pageLifetimes" | "definitionFilter" | "export" | "observers" | "relations">>
|
|
131
|
-
& SubObserversOption<
|
|
132
|
-
& SubComputedDoc
|
|
133
|
-
& SubDataDoc
|
|
134
|
-
& AllRootDataDoc
|
|
135
|
-
& SubStoreDoc
|
|
136
|
-
& IInjectStore
|
|
137
|
-
>
|
|
138
|
-
& ThisType<
|
|
139
|
-
SubInstance<
|
|
140
|
-
SubMethodsDoc & RootDoc["methods"],
|
|
141
|
-
Replace<SubDataDoc, Required<CurrentCompDoc["properties"]>>, // Replace目的是让setData中的类型与文档中定义的类型一致
|
|
142
|
-
// SubDataDoc,
|
|
143
|
-
AllRootDataDoc & Replace<SubDataDoc & SubComputedDoc & SubStoreDoc, Required<CurrentCompDoc["properties"]>>, // Replace的目的是让实例中的类型与文档中定义的类型一致
|
|
144
|
-
// AllRootDataDoc & SubDataDoc & SubComputedDoc & SubStoreDoc,
|
|
145
|
-
NonNullable<RootDoc["customEvents"]>,
|
|
146
|
-
SubStoreDoc
|
|
147
|
-
>
|
|
148
|
-
>;
|
|
149
|
-
|
|
150
|
-
type SubComponentConstructor<
|
|
151
|
-
TRootDoc extends RootComponentDefinition,
|
|
152
|
-
TOriginalCompDoc extends ComponentDoc,
|
|
153
|
-
// 补充的前缀
|
|
154
|
-
TSupplementalPrefix extends string = "",
|
|
155
|
-
IsPage extends boolean = TRootDoc["isPage"] extends true ? true : false,
|
|
156
|
-
// 重构子组件的前缀
|
|
157
|
-
CurrentPrefix extends string = `${GetComponentPrefix<TOriginalCompDoc>}${Capitalize<TSupplementalPrefix>}`,
|
|
158
|
-
// 更新原始文档的前缀为Prefix
|
|
159
|
-
CurrentCompDoc extends ComponentDoc = IfExtends<
|
|
160
|
-
TSupplementalPrefix,
|
|
161
|
-
"",
|
|
162
|
-
TOriginalCompDoc & { properties: Extra<CurrentPrefix> }, // 为文档增加格外字段
|
|
163
|
-
ReplacePrefix<TOriginalCompDoc & { properties: Extra<CurrentPrefix> }, CurrentPrefix> // 为文档增加格外字段
|
|
164
|
-
>,
|
|
165
|
-
AllRootDataDoc extends object =
|
|
166
|
-
// rootDoc中的properties是带有可选的,这是为了给使用者(上层组件)提示,而在自身组件实例中并不存在可选状态,故加了Required,正因加了Required使得最终结果不可能为unknown而是`{}`,满足object约束
|
|
167
|
-
& Required<TRootDoc["properties"]> // Required<unknown> = {}
|
|
168
|
-
& TRootDoc["data"]
|
|
169
|
-
& TRootDoc["computed"]
|
|
170
|
-
& TRootDoc["store"],
|
|
171
|
-
> = <
|
|
172
|
-
TInherit extends SubInheritConstraint<AllRootDataDoc, CurrentCompDoc>,
|
|
173
|
-
TData extends SubDataConstraint<
|
|
174
|
-
& Omit<Required<CurrentCompDoc["properties"]>, keyof InheritDoc>
|
|
175
|
-
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
176
|
-
>,
|
|
177
|
-
TStore extends SubStoreConstraint<
|
|
178
|
-
Required<TRootDoc["properties"]>,
|
|
179
|
-
& Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & DataDoc)>
|
|
180
|
-
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
181
|
-
>,
|
|
182
|
-
TEvents extends SubEventsConstraint<CurrentCompDoc>,
|
|
183
|
-
// 加默认值计算字段无提示且需要手写返回类型,不加watch无法对computed监控
|
|
184
|
-
TComputed extends SubComputedConstraint<
|
|
185
|
-
& Omit<
|
|
186
|
-
Required<CurrentCompDoc["properties"]>,
|
|
187
|
-
keyof (InheritDoc & DataDoc & StoreDoc)
|
|
188
|
-
>
|
|
189
|
-
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
190
|
-
>,
|
|
191
|
-
TMethods extends SubMethodsConstraint = {},
|
|
192
|
-
InheritDoc extends object = IfExtends<
|
|
193
|
-
SubInheritConstraint<AllRootDataDoc, CurrentCompDoc>,
|
|
194
|
-
TInherit,
|
|
195
|
-
{},
|
|
196
|
-
TInherit
|
|
197
|
-
>,
|
|
198
|
-
DataDoc extends object = IfExtends<
|
|
199
|
-
SubDataConstraint<
|
|
200
|
-
& Omit<Required<CurrentCompDoc["properties"]>, keyof InheritDoc>
|
|
201
|
-
& Record<InnerFields<CurrentPrefix>, unknown>
|
|
202
|
-
>,
|
|
203
|
-
TData,
|
|
204
|
-
{},
|
|
205
|
-
TData
|
|
206
|
-
>,
|
|
207
|
-
StoreDoc extends object = IfExtends<
|
|
208
|
-
SubStoreConstraint<
|
|
209
|
-
Required<TRootDoc["properties"]>,
|
|
210
|
-
& Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & DataDoc)>
|
|
211
|
-
& Record<InnerFields<CurrentPrefix>, unknown>
|
|
212
|
-
>,
|
|
213
|
-
TStore,
|
|
214
|
-
{},
|
|
215
|
-
GetStoreDef<TStore>
|
|
216
|
-
>,
|
|
217
|
-
// 无效的计算
|
|
218
|
-
ComputedDoc extends object = IfExtends<
|
|
219
|
-
SubComputedConstraint<
|
|
220
|
-
& Omit<
|
|
221
|
-
Required<CurrentCompDoc["properties"]>,
|
|
222
|
-
keyof (InheritDoc & DataDoc & StoreDoc)
|
|
223
|
-
>
|
|
224
|
-
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
225
|
-
>,
|
|
226
|
-
TComputed,
|
|
227
|
-
{},
|
|
228
|
-
GetSubComputedDoc<TComputed>
|
|
229
|
-
>,
|
|
230
|
-
EventsDoc extends object = IfExtends<
|
|
231
|
-
SubEventsConstraint<CurrentCompDoc>,
|
|
232
|
-
TEvents,
|
|
233
|
-
{},
|
|
234
|
-
TEvents
|
|
235
|
-
>,
|
|
236
|
-
MethodsDoc extends object = TMethods,
|
|
237
|
-
// 缺失的必传字段(配置中inhrit,data,computed的字段不包含的必传字段)
|
|
238
|
-
MissingRequiredField extends PropertyKey = Exclude<
|
|
239
|
-
RequiredKeys<NonNullable<CurrentCompDoc["properties"]>>,
|
|
240
|
-
keyof (
|
|
241
|
-
& InheritDoc
|
|
242
|
-
& DataDoc
|
|
243
|
-
& StoreDoc
|
|
244
|
-
// 改用ComputedDoc是会报错的
|
|
245
|
-
& IfExtends<
|
|
246
|
-
SubComputedConstraint<
|
|
247
|
-
Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & DataDoc & StoreDoc)>
|
|
248
|
-
>,
|
|
249
|
-
TComputed,
|
|
250
|
-
{},
|
|
251
|
-
GetSubComputedDoc<TComputed>
|
|
252
|
-
>
|
|
253
|
-
)
|
|
254
|
-
>,
|
|
255
|
-
>(
|
|
256
|
-
options: Options<
|
|
257
|
-
TRootDoc,
|
|
258
|
-
IsPage,
|
|
259
|
-
CurrentCompDoc,
|
|
260
|
-
CurrentPrefix,
|
|
261
|
-
AllRootDataDoc,
|
|
262
|
-
TInherit,
|
|
263
|
-
TData,
|
|
264
|
-
TStore,
|
|
265
|
-
TComputed,
|
|
266
|
-
TEvents,
|
|
267
|
-
TMethods,
|
|
268
|
-
InheritDoc,
|
|
269
|
-
DataDoc,
|
|
270
|
-
StoreDoc,
|
|
271
|
-
ComputedDoc,
|
|
272
|
-
EventsDoc,
|
|
273
|
-
MethodsDoc
|
|
274
|
-
>,
|
|
275
|
-
) => IfExtends<
|
|
276
|
-
MissingRequiredField,
|
|
277
|
-
never,
|
|
278
|
-
CreatSubComponentDoc<
|
|
279
|
-
NonNullable<CurrentCompDoc["events"]>,
|
|
280
|
-
EventsDoc
|
|
281
|
-
>,
|
|
282
|
-
`缺少必传的字段${UnionToComma<MissingRequiredField & string>}`
|
|
283
|
-
>;
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* 自定义组件构建函数
|
|
287
|
-
* @returns `(options:) => ComponentDoc`
|
|
288
|
-
*/
|
|
289
|
-
export function SubComponent<
|
|
290
|
-
TRootComponentDefinition extends RootComponentDefinition,
|
|
291
|
-
TCompDoc extends ComponentDoc,
|
|
292
|
-
Prefix extends string = "",
|
|
293
|
-
>(): IfExtends<
|
|
294
|
-
EmptyObject,
|
|
295
|
-
TCompDoc,
|
|
296
|
-
(opt: EmptyObject) => never,
|
|
297
|
-
SubComponentConstructor<TRootComponentDefinition, TCompDoc, Prefix>
|
|
298
|
-
> {
|
|
299
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
300
|
-
return ((options: any) => options) as any;
|
|
301
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Func } from "hry-types/src/Misc/Func";
|
|
2
|
-
import type { ComputedConstraint } from "../RootComponent/Computed/ComputedConstraint";
|
|
3
|
-
import type { DataConstraint } from "../RootComponent/Data/DataConstraint";
|
|
4
|
-
import type { EventsConstraint } from "../RootComponent/Events/EventsConstraint";
|
|
5
|
-
import type { LifetimesConstraint } from "../RootComponent/Lifetimes/LifetimesConstraint";
|
|
6
|
-
import type { MethodsConstraint } from "../RootComponent/Methods/MethodsConstraint";
|
|
7
|
-
import type { PageLifetimesOption } from "../RootComponent/PageLifetimes/PageLifetimesOption";
|
|
8
|
-
import type { StoreConstraint } from "../RootComponent/Store/StoreConstraint";
|
|
9
|
-
|
|
10
|
-
type _SubComponentDefinition = {
|
|
11
|
-
composedEvents?: Record<string, unknown>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
// 验证key是否合法
|
|
15
|
-
type _Validator<O, Doc, ErrKeys = Exclude<keyof O, keyof Doc>> = [ErrKeys] extends [never] ? Doc
|
|
16
|
-
: `错误的字段${ErrKeys & string}`;
|
|
17
|
-
/**
|
|
18
|
-
* SubComponent API 的返回类型
|
|
19
|
-
*/
|
|
20
|
-
export type SubComponentDefinition<
|
|
21
|
-
O extends _Validator<O, _SubComponentDefinition> = _SubComponentDefinition,
|
|
22
|
-
> = O;
|
|
23
|
-
/**
|
|
24
|
-
* SubComponent API 返回的运行时类型
|
|
25
|
-
*/
|
|
26
|
-
export type SubComponentDefinitionRuntime = {
|
|
27
|
-
inhrit?: string;
|
|
28
|
-
data?: DataConstraint;
|
|
29
|
-
computed?: ComputedConstraint;
|
|
30
|
-
store?: StoreConstraint;
|
|
31
|
-
events?: EventsConstraint;
|
|
32
|
-
methods?: MethodsConstraint;
|
|
33
|
-
observers?: Record<string, Func>;
|
|
34
|
-
watch?: Record<string, Func>;
|
|
35
|
-
lifetimes?: LifetimesConstraint;
|
|
36
|
-
pageLifetimes?:
|
|
37
|
-
| PageLifetimesOption<false, object>["pageLifetimes"]
|
|
38
|
-
| PageLifetimesOption<true, object>["pageLifetimes"];
|
|
39
|
-
};
|
package/src/api/wxSugar.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { IfEquals } from "hry-types/src/Any/IfEquals";
|
|
2
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
3
|
-
import type { NoInfer } from "hry-types/src/Generic/NoInfer";
|
|
4
|
-
import type { ComputeObject } from "../types/ComputeObject";
|
|
5
|
-
import type { WMNavigateToOption } from "../types/OfficialTypeAlias";
|
|
6
|
-
import type { RequiredKeys } from "../types/RequiredKeys";
|
|
7
|
-
import { INNERMARKER } from "../utils/InnerMarker";
|
|
8
|
-
import type { PageDoc } from "./DefineComponent/returnType/PageDoc";
|
|
9
|
-
|
|
10
|
-
type NavigateToOption<T extends PageDoc> = ComputeObject<
|
|
11
|
-
& {
|
|
12
|
-
url: T["path"];
|
|
13
|
-
}
|
|
14
|
-
& IfExtends<
|
|
15
|
-
unknown,
|
|
16
|
-
T["properties"],
|
|
17
|
-
unknown,
|
|
18
|
-
IfEquals<
|
|
19
|
-
RequiredKeys<NonNullable<T["properties"]>>,
|
|
20
|
-
never,
|
|
21
|
-
{
|
|
22
|
-
data?: T["properties"];
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
data: T["properties"];
|
|
26
|
-
}
|
|
27
|
-
>
|
|
28
|
-
>
|
|
29
|
-
& Omit<WMNavigateToOption, "url">
|
|
30
|
-
>;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 对象中可以使用 `"; / ? : @ & = + $ `, #"做为数据的一部分
|
|
34
|
-
*/
|
|
35
|
-
function _encodeURIComponent(
|
|
36
|
-
option: Omit<WMNavigateToOption, "url"> & { url: string; data: object },
|
|
37
|
-
): WechatMiniprogram.NavigateToOption {
|
|
38
|
-
const result: WMNavigateToOption = {
|
|
39
|
-
url: `${option.url}?${INNERMARKER.url}=${
|
|
40
|
-
encodeURIComponent(
|
|
41
|
-
JSON.stringify(option.data),
|
|
42
|
-
)
|
|
43
|
-
}`,
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
Reflect.deleteProperty(option, "url");
|
|
47
|
-
|
|
48
|
-
Reflect.deleteProperty(option, "data");
|
|
49
|
-
|
|
50
|
-
return Object.assign(result, option);
|
|
51
|
-
}
|
|
52
|
-
const backFuncs: (undefined | ((...args: unknown[]) => void))[] = [];
|
|
53
|
-
/**
|
|
54
|
-
* 页面onload参数中接受的数据值是传递的url解析后的字符串。例如:A页面通过`wx.navigateTo({url:'/pages/test/test?num=123&obj={"name":"zhao"}'})`
|
|
55
|
-
* test页面onLoad(data)的参数data接受内容为` data = {num:"123",obj:"{"name":"zhao"}"}`即默认的url传的数据值为字符串,需要在接收时自行解析(JSON.parse)。且url采取ASCII编码只能接受0x20-0x7e区间的符号。无法使用一些特殊符号 如 ` :/?#[]@!$&'()*+,;= `。
|
|
56
|
-
* navigateTo API 为 wx.navigateTo的语法糖,增加了data字段,最终的url数据拼接了通过encodeURIComponent编码(支持默认忽略的特殊符号)的data字段,在跳转页面的onload中通过decodeURIComponent解析url赋值给实例的data对象。为求使用时更加方便(无需对参数data解析再赋值)。且有ts类型提示。
|
|
57
|
-
*/
|
|
58
|
-
export function navigateTo<TPageDoc extends PageDoc = never>(
|
|
59
|
-
option: NoInfer<NavigateToOption<TPageDoc>> & { data?: object },
|
|
60
|
-
onBack?: (res: unknown) => void,
|
|
61
|
-
) {
|
|
62
|
-
backFuncs.push(onBack);
|
|
63
|
-
if (!option.data) {
|
|
64
|
-
return wx.navigateTo(option);
|
|
65
|
-
} else {
|
|
66
|
-
return wx.navigateTo(
|
|
67
|
-
_encodeURIComponent(option as NavigateToOption<TPageDoc> & { data: object }),
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
type WMNavigateBackOption = WechatMiniprogram.NavigateBackOption;
|
|
72
|
-
type NavigateBackOption<Data> = WMNavigateBackOption & { data?: Data };
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* @param options
|
|
76
|
-
* @returns
|
|
77
|
-
*/
|
|
78
|
-
export function navigateBack<Data, T extends NavigateBackOption<Data> = NavigateBackOption<Data>>(
|
|
79
|
-
options?: T,
|
|
80
|
-
): WechatMiniprogram.PromisifySuccessResult<T, WMNavigateBackOption> {
|
|
81
|
-
const backFunc = backFuncs.pop();
|
|
82
|
-
if (backFunc) {
|
|
83
|
-
if (!options || options.data === undefined) {
|
|
84
|
-
throw new Error("navigateBack 需要带有data参数的配置对象,因为返回的组件需要data数据");
|
|
85
|
-
}
|
|
86
|
-
const data = options.data;
|
|
87
|
-
const complete = options.complete;
|
|
88
|
-
options.complete = (res) => {
|
|
89
|
-
backFunc(data);
|
|
90
|
-
if (complete) {
|
|
91
|
-
complete(res);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
return wx.navigateBack(options);
|
|
96
|
-
}
|
|
97
|
-
export function redirectTo<TPageDoc extends PageDoc = never>(
|
|
98
|
-
option: NoInfer<NavigateToOption<TPageDoc>> & { data?: object },
|
|
99
|
-
) {
|
|
100
|
-
if (!option.data) {
|
|
101
|
-
return wx.redirectTo(option);
|
|
102
|
-
} else {
|
|
103
|
-
return wx.redirectTo(
|
|
104
|
-
_encodeURIComponent(option as NavigateToOption<TPageDoc> & { data: object }),
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { FinalOptionsOfComponent } from "../api/DefineComponent/normalizeOptions";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 增加beforeCreate生命周期函数,便于测试
|
|
5
|
-
*/
|
|
6
|
-
export const BBeforeCreate = Behavior({
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
definitionFilter(
|
|
9
|
-
options: Omit<FinalOptionsOfComponent, "customEvents" | "store" | "events" | "computed">,
|
|
10
|
-
) {
|
|
11
|
-
// 触发beforeCreate生命周期函数
|
|
12
|
-
const beforeCreateFunc = options.lifetimes.beforeCreate;
|
|
13
|
-
|
|
14
|
-
if (beforeCreateFunc) {
|
|
15
|
-
beforeCreateFunc.call(undefined, options);
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import type { Instance } from "../api/RootComponent/Instance/RootComponentInstance";
|
|
3
|
-
import { debounce } from "../utils/debounce";
|
|
4
|
-
import { throttle } from "../utils/throttle";
|
|
5
|
-
|
|
6
|
-
export const BthrottleDebounce = Behavior({
|
|
7
|
-
lifetimes: {
|
|
8
|
-
created(this: Instance) {
|
|
9
|
-
const __throttleDebounce__ = this.data.__throttleDebounce__;
|
|
10
|
-
if (!__throttleDebounce__) return;
|
|
11
|
-
const debounceConfig = __throttleDebounce__.debounce;
|
|
12
|
-
if (debounceConfig) {
|
|
13
|
-
for (const key in debounceConfig) {
|
|
14
|
-
const _this = this as any;
|
|
15
|
-
_this[key] = debounce(_this[key].bind(this), debounceConfig[key]);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
const throttleConfig = __throttleDebounce__.throttle;
|
|
19
|
-
if (throttleConfig) {
|
|
20
|
-
for (const key in throttleConfig) {
|
|
21
|
-
const _this = this as any;
|
|
22
|
-
_this[key] = throttle(_this[key].bind(this), throttleConfig[key]);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
delete this.data.__throttleDebounce__;
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { DefineComponent } from "./api/DefineComponent";
|
|
2
|
-
import { type IInjectInfo, instanceConfig } from "./api/InstanceInject/instanceConfig";
|
|
3
|
-
import { RootComponent } from "./api/RootComponent";
|
|
4
|
-
import { SubComponent } from "./api/SubComponent";
|
|
5
|
-
import { navigateBack, navigateTo, redirectTo } from "./api/wxSugar";
|
|
6
|
-
import type { CreateComponentType } from "./types/CreateComponentType";
|
|
7
|
-
import type { DetailedType } from "./types/DetailedType";
|
|
8
|
-
import type { ExtendComponentType } from "./types/ExtendComponentType";
|
|
9
|
-
|
|
10
|
-
export * from "./utils/_utils";
|
|
11
|
-
|
|
12
|
-
export type {
|
|
13
|
-
Bubbles,
|
|
14
|
-
BubblesCapture,
|
|
15
|
-
BubblesCaptureComposed,
|
|
16
|
-
BubblesComposed,
|
|
17
|
-
Capture,
|
|
18
|
-
CaptureComposed,
|
|
19
|
-
Composed,
|
|
20
|
-
CustomEventsTags,
|
|
21
|
-
} from "./api/RootComponent/CustomEvents/CustomEventsTag";
|
|
22
|
-
export type { Vant, Wm } from "./thirdLib";
|
|
23
|
-
|
|
24
|
-
export type {
|
|
25
|
-
CurrentTargetDataset,
|
|
26
|
-
Dataset,
|
|
27
|
-
Detail,
|
|
28
|
-
Mark,
|
|
29
|
-
TargetDataset,
|
|
30
|
-
WMBaseEvent,
|
|
31
|
-
WMCustomEvent,
|
|
32
|
-
} from "./types/OfficialTypeAlias";
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
type CreateComponentType,
|
|
36
|
-
DefineComponent,
|
|
37
|
-
type DetailedType,
|
|
38
|
-
type ExtendComponentType,
|
|
39
|
-
type IInjectInfo,
|
|
40
|
-
instanceConfig,
|
|
41
|
-
navigateBack,
|
|
42
|
-
navigateTo,
|
|
43
|
-
redirectTo,
|
|
44
|
-
RootComponent,
|
|
45
|
-
SubComponent,
|
|
46
|
-
};
|
package/src/thirdLib/index.ts
DELETED