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,111 +0,0 @@
|
|
|
1
|
-
import type { CreateComponentType } from "../../types/CreateComponentType";
|
|
2
|
-
|
|
3
|
-
type CssVar<T extends string = string> = `var(--${T}-${string})`;
|
|
4
|
-
|
|
5
|
-
type Color = `rgba(${number}, ${number}, ${number}, ${number})` | `#${number}` | CssVar<"color">;
|
|
6
|
-
|
|
7
|
-
interface ChangeEventDetail {
|
|
8
|
-
current: number;
|
|
9
|
-
currentItemId: string;
|
|
10
|
-
source: "touch" | "" | "autoplay";
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type AnimationfinishEventDetail = ChangeEventDetail;
|
|
14
|
-
|
|
15
|
-
export type Swiper = CreateComponentType<"swiper", {
|
|
16
|
-
properties: {
|
|
17
|
-
/**
|
|
18
|
-
* @description class
|
|
19
|
-
*/
|
|
20
|
-
class?: string;
|
|
21
|
-
/**
|
|
22
|
-
* @description style
|
|
23
|
-
*/
|
|
24
|
-
style?: string;
|
|
25
|
-
/**
|
|
26
|
-
* 是否显示面板指示点
|
|
27
|
-
* @defaultValue false
|
|
28
|
-
*/
|
|
29
|
-
indicatorDots?: boolean;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* 指示点颜色
|
|
33
|
-
* @defaultValue 'rgba(0, 0, 0, .3)'
|
|
34
|
-
*/
|
|
35
|
-
indicatorColor?: Color;
|
|
36
|
-
/**
|
|
37
|
-
* 当前选中的指示点颜色
|
|
38
|
-
* @defaultValue "#000000"
|
|
39
|
-
*/
|
|
40
|
-
indicatorActiveColor?: Color;
|
|
41
|
-
/**
|
|
42
|
-
* 是否自动切换
|
|
43
|
-
* @defaultValue false
|
|
44
|
-
*/
|
|
45
|
-
autoplay?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* 当前所在滑块的 index
|
|
48
|
-
* @defaultValue 0
|
|
49
|
-
*/
|
|
50
|
-
current?: number;
|
|
51
|
-
/**
|
|
52
|
-
* 自动切换时间间隔
|
|
53
|
-
* @defaultValue 5000
|
|
54
|
-
*/
|
|
55
|
-
interval?: number;
|
|
56
|
-
/**
|
|
57
|
-
* 滑动动画时长
|
|
58
|
-
* @defaultValue 500
|
|
59
|
-
*/
|
|
60
|
-
duration?: number;
|
|
61
|
-
/**
|
|
62
|
-
* 是否采用衔接滑动
|
|
63
|
-
* @defaultValue false
|
|
64
|
-
*/
|
|
65
|
-
circular?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* 滑动方向是否为纵向
|
|
68
|
-
* @defaultValue false
|
|
69
|
-
*/
|
|
70
|
-
vertical?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* 前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值
|
|
73
|
-
* @defaultValue '0px'
|
|
74
|
-
*/
|
|
75
|
-
previousMargin?: string;
|
|
76
|
-
/**
|
|
77
|
-
* 后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值
|
|
78
|
-
* @defaultValue '0px'
|
|
79
|
-
*/
|
|
80
|
-
nextMargin?: string;
|
|
81
|
-
/**
|
|
82
|
-
* 当 swiper-item 的个数大于等于 2,关闭 circular 并且开启 previous-margin 或 next-margin 的时候,可以指定这个边距是否应用到第一个、最后一个元素
|
|
83
|
-
* @defaultValue false
|
|
84
|
-
*/
|
|
85
|
-
snapToEdge?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* 同时显示的滑块数量
|
|
88
|
-
* @defaultValue 1
|
|
89
|
-
*/
|
|
90
|
-
displayMultipleItems?: number;
|
|
91
|
-
/**
|
|
92
|
-
* 指定 swiper 切换缓动动画类型
|
|
93
|
-
* @defaultValue 'defaultValue'
|
|
94
|
-
*/
|
|
95
|
-
easingFunction?: "defaultValue" | "linear" | "easeInCubic" | "easeOutCubic" | "easeInOutCubic";
|
|
96
|
-
};
|
|
97
|
-
events: {
|
|
98
|
-
/**
|
|
99
|
-
* current 改变时会触发 change 事件,event.detail = `{current, source}`
|
|
100
|
-
*/
|
|
101
|
-
change: ChangeEventDetail;
|
|
102
|
-
/**
|
|
103
|
-
* swiper-item 的位置发生改变时会触发 transition 事件,event.detail = `{dx: number, dy: number}`
|
|
104
|
-
*/
|
|
105
|
-
transition: { dx: number; dy: number };
|
|
106
|
-
/**
|
|
107
|
-
* animationfinish 动画结束时会触发 animationfinish 事件,event.detail change字段
|
|
108
|
-
*/
|
|
109
|
-
animationfinish: AnimationfinishEventDetail;
|
|
110
|
-
};
|
|
111
|
-
}>;
|
package/src/thirdLib/wm/view.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { CreateComponentType } from "../../types/CreateComponentType";
|
|
2
|
-
import type { BaseEvents } from "./baseEvents";
|
|
3
|
-
|
|
4
|
-
export type View = CreateComponentType<"view", {
|
|
5
|
-
properties: {
|
|
6
|
-
/**
|
|
7
|
-
* 指定按下去的样式类。当 hover-class="none" 时,没有点击态效果
|
|
8
|
-
* @defaultValue 'none'
|
|
9
|
-
*/
|
|
10
|
-
hoverClass?: string;
|
|
11
|
-
/**
|
|
12
|
-
* 指定是否阻止本节点的祖先节点出现点击态
|
|
13
|
-
* @defaultValue false
|
|
14
|
-
*/
|
|
15
|
-
hoverStopPropagation?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* 按住后多久出现点击态,单位毫秒
|
|
18
|
-
* @defaultValue 50
|
|
19
|
-
*/
|
|
20
|
-
hoverStartTime?: number;
|
|
21
|
-
/**
|
|
22
|
-
* 手指松开后点击态保留时间,单位毫秒
|
|
23
|
-
* @defaultValue 400
|
|
24
|
-
*/
|
|
25
|
-
hoverStayTime?: number;
|
|
26
|
-
};
|
|
27
|
-
events: BaseEvents;
|
|
28
|
-
}>;
|
package/src/types/AddPrefix.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 将对象 T 的所有属性名添加前缀 TPrefix。
|
|
3
|
-
* 如果 TPrefix 为空字符串,则返回原对象 T。
|
|
4
|
-
* @param T - 要添加前缀的对象。
|
|
5
|
-
* @param TPrefix - 要添加的前缀。
|
|
6
|
-
* @returns 添加前缀后的新对象或原对象。
|
|
7
|
-
*/
|
|
8
|
-
export type AddPrefix<T extends object, TPrefix extends string> = "" extends TPrefix ? T : {
|
|
9
|
-
[k in keyof T as `${TPrefix}_${k & string}`]: T[k];
|
|
10
|
-
};
|
package/src/types/Assert.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Assert<T, U> = T extends U ? T : never;
|
package/src/types/Assign.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Assign<O1, O2> = Omit<O1, keyof O2> & O2;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ComputeObject<T> = T extends unknown ? { [k in keyof T]: T[k] } : never;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { IfExtends } from "hry-types/src/Any/_api";
|
|
2
|
-
import type { ComputeIntersection } from "hry-types/src/Object/_api";
|
|
3
|
-
import type { ComponentDoc } from "../api/DefineComponent/returnType/ComponentDoc";
|
|
4
|
-
import type { AddPrefix } from "./AddPrefix";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 建立一个组件类型
|
|
8
|
-
* @param TName 组件名称
|
|
9
|
-
* @param T 类型配置
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* type $CustomA = CreateComponentType<"customA", {
|
|
13
|
-
* properties: { num: string };
|
|
14
|
-
* events: { onTap: string }
|
|
15
|
-
* }>;
|
|
16
|
-
*
|
|
17
|
-
* // 等同下面的类型
|
|
18
|
-
* type $CustomA = {
|
|
19
|
-
* properties: {
|
|
20
|
-
* customA_num: string;
|
|
21
|
-
* };
|
|
22
|
-
* events: {
|
|
23
|
-
* customA_onTap: string;
|
|
24
|
-
* };
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export type CreateComponentType<TName extends string, T extends ComponentDoc> = ComputeIntersection<
|
|
28
|
-
& IfExtends<
|
|
29
|
-
unknown,
|
|
30
|
-
T["properties"],
|
|
31
|
-
{},
|
|
32
|
-
{
|
|
33
|
-
properties: AddPrefix<T["properties"] & {}, TName>;
|
|
34
|
-
}
|
|
35
|
-
>
|
|
36
|
-
& IfExtends<unknown, T["events"], {}, { events: AddPrefix<T["events"] & {}, TName> }>
|
|
37
|
-
>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 通过as DetailedType 指定具体类型。
|
|
3
|
-
* @remarks
|
|
4
|
-
* 在js中使用构造函数(Object,Array等)表示类型时,无法给出明确的类型,DetailedType为此而生
|
|
5
|
-
* @example
|
|
6
|
-
* ``` ts
|
|
7
|
-
* RootComponent()({
|
|
8
|
-
* properties: {
|
|
9
|
-
* gender: String as DetailedType<"male" | "female">,
|
|
10
|
-
* unionArr: Array as DetailedType<string[] | number[]>,
|
|
11
|
-
* },
|
|
12
|
-
* });
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export type DetailedType<T = unknown> = (() => T) | (new(...arg: unknown[]) => T);
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
import type { ComputeIntersectionDeep } from "hry-types/src/Object/ComputeIntersectionDeep";
|
|
3
|
-
import type { ComponentDoc } from "../api/DefineComponent/returnType/ComponentDoc";
|
|
4
|
-
import type { GetComponentPrefix } from "./GetComponentPrefix";
|
|
5
|
-
|
|
6
|
-
type Validator<
|
|
7
|
-
TOriginalComponentType extends ComponentDoc,
|
|
8
|
-
TExtensionType extends ComponentDoc,
|
|
9
|
-
TOriginalPrefix extends PropertyKey = GetComponentPrefix<TOriginalComponentType>,
|
|
10
|
-
TExtenstionPrefix extends PropertyKey = GetComponentPrefix<TExtensionType>,
|
|
11
|
-
DuplicateKeys extends PropertyKey =
|
|
12
|
-
| Extract<keyof TExtensionType["properties"], keyof TOriginalComponentType["properties"]>
|
|
13
|
-
| Extract<keyof TExtensionType["events"], keyof TOriginalComponentType["events"]>,
|
|
14
|
-
> = IfExtends<
|
|
15
|
-
TOriginalPrefix,
|
|
16
|
-
TExtenstionPrefix,
|
|
17
|
-
IfExtends<DuplicateKeys, never, ComponentDoc, `${DuplicateKeys & string}字段重复`>,
|
|
18
|
-
`前缀错误,应为${TOriginalPrefix & string}`
|
|
19
|
-
>;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 拓展组件类型
|
|
23
|
-
* @param TOriginalComponentType 原始组件类型
|
|
24
|
-
* @param TExtensionType 拓展类型
|
|
25
|
-
* @description 拓展类型必须与原始类型有相同的前缀
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* type $CustomA = ExtendComponentType<
|
|
29
|
-
* { properties: { aaa_num: number };
|
|
30
|
-
* events: { aaa_xxx: string }
|
|
31
|
-
* },
|
|
32
|
-
* { properties: { aaa_str: string };
|
|
33
|
-
* events: { aaa_yyy: string }
|
|
34
|
-
* }>;
|
|
35
|
-
*
|
|
36
|
-
* // 等同下面的类型
|
|
37
|
-
* type $CustomA = {
|
|
38
|
-
* properties: {
|
|
39
|
-
* aaa_num: number;
|
|
40
|
-
* aaa_str: string;
|
|
41
|
-
* };
|
|
42
|
-
* events: {
|
|
43
|
-
* aaa_xxx: string;
|
|
44
|
-
* aaa_yyy: string;
|
|
45
|
-
* };
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
export type ExtendComponentType<
|
|
49
|
-
TOriginalComponentType extends ComponentDoc,
|
|
50
|
-
// @ts-ignore
|
|
51
|
-
TExtensionType extends Validator<TOriginalComponentType, TExtensionType>,
|
|
52
|
-
> = ComputeIntersectionDeep<TOriginalComponentType & TExtensionType>;
|
|
53
|
-
|
|
54
|
-
// type test0 = ExtendComponentType<{ properties: { aaa_xxx: string } }, { properties: { aaa_xxx: string } }>; // => "aaa_xxx字段重复"
|
|
55
|
-
|
|
56
|
-
// type test1 = ExtendComponentType<{ events: { aaa_xxx: string } }, { events: { aaa_xxx: string } }>; // => "aaa_xxx字段重复"
|
|
57
|
-
|
|
58
|
-
// type test2 = ExtendComponentType<{ properties: { aaa_xxx: string } }, { properties: { ddd_xxx: string } }>; // => "前缀错误,应为aaa"
|
|
59
|
-
|
|
60
|
-
// type test3 = ExtendComponentType<{ events: { aaa_xxx: string } }, { events: { ddd_xxx: string } }>; // => "前缀错误,应为aaa"
|
package/src/types/Extra.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Extra<Prefix extends string> = Partial<Record<`${Prefix}_isReady`, boolean>>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// import { Checking, type Test } from "hry-types";
|
|
2
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
3
|
-
import type { EmptyObject } from "hry-types/src/Misc/EmptyObject";
|
|
4
|
-
import type { ComponentDoc } from "../api/DefineComponent/returnType/ComponentDoc";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 提取文档前缀名
|
|
8
|
-
*/
|
|
9
|
-
export type GetComponentPrefix<TComponentDoc extends ComponentDoc> = EmptyObject extends TComponentDoc ? never
|
|
10
|
-
: keyof IfExtends<
|
|
11
|
-
unknown,
|
|
12
|
-
TComponentDoc["properties"],
|
|
13
|
-
TComponentDoc["events"],
|
|
14
|
-
TComponentDoc["properties"]
|
|
15
|
-
> extends `${infer P}_${string}` ? P
|
|
16
|
-
: never;
|
|
17
|
-
|
|
18
|
-
// type Test1 = GetComponentPrefix<{ properties: { xxx_name: string } }>;
|
|
19
|
-
|
|
20
|
-
// type Test1Expect = "xxx";
|
|
21
|
-
|
|
22
|
-
// Checking<Test1, Test1Expect, Test.Pass>;
|
|
23
|
-
|
|
24
|
-
// type Test2 = GetComponentPrefix<{ events: { xxx_name: string } }>;
|
|
25
|
-
|
|
26
|
-
// type Test2Expect = "xxx";
|
|
27
|
-
|
|
28
|
-
// Checking<Test2, Test2Expect, Test.Pass>;
|
|
29
|
-
|
|
30
|
-
// type demo = never extends `${infer P}_${string}` ? P : ""; // => string why?
|
|
31
|
-
|
|
32
|
-
// type Test3 = GetComponentPrefix<{}>;
|
|
33
|
-
|
|
34
|
-
// type Test3Expect = never;
|
|
35
|
-
|
|
36
|
-
// Checking<Test3, Test3Expect, Test.Pass>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// import type { SubComponentType } from "../api/SubComponent/SubComponentType";
|
|
2
|
-
|
|
3
|
-
// // 获取元组中properties字段的重复keys
|
|
4
|
-
// export type GetPropertiesDuplicatedKeys<
|
|
5
|
-
// O extends SubComponentType[],
|
|
6
|
-
// Comparekeys extends PropertyKey,
|
|
7
|
-
// Duplicatekey extends string = never,
|
|
8
|
-
// > = O extends [infer Head extends SubComponentType, ...infer Rest extends SubComponentType[]]
|
|
9
|
-
// ? GetPropertiesDuplicatedKeys<
|
|
10
|
-
// Rest,
|
|
11
|
-
// Comparekeys | keyof Head["properties"],
|
|
12
|
-
// Extract<Comparekeys, keyof Head["properties"]> & string | Duplicatekey
|
|
13
|
-
// >
|
|
14
|
-
// : Duplicatekey;
|
package/src/types/Has.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Has<S extends string, Target extends string> = S extends `${string}${Target}${string}` ? true : false;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
|
|
3
|
-
import type { DetailedType } from "./DetailedType";
|
|
4
|
-
import type { InferDetailedType } from "./InferDetailedType";
|
|
5
|
-
|
|
6
|
-
void Checking<InferDetailedType<StringConstructor>, string, Test.Pass>;
|
|
7
|
-
|
|
8
|
-
void Checking<InferDetailedType<NumberConstructor>, number, Test.Pass>;
|
|
9
|
-
void void Checking<InferDetailedType<BooleanConstructor>, boolean, Test.Pass>;
|
|
10
|
-
void void Checking<InferDetailedType<ArrayConstructor>, unknown[], Test.Pass>;
|
|
11
|
-
void void Checking<InferDetailedType<ObjectConstructor>, object, Test.Pass>;
|
|
12
|
-
void Checking<InferDetailedType<DetailedType<"a" | "b">>, "a" | "b", Test.Pass>;
|
|
13
|
-
void Checking<InferDetailedType<DetailedType<[string, number, boolean]>>, [string, number, boolean], Test.Pass>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { DetailedType } from "./DetailedType";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 解析DetailedType的类型
|
|
5
|
-
*/
|
|
6
|
-
export type InferDetailedType<T> = T extends StringConstructor ? string
|
|
7
|
-
: T extends NumberConstructor ? number
|
|
8
|
-
: T extends BooleanConstructor ? boolean
|
|
9
|
-
: T extends ArrayConstructor ? unknown[]
|
|
10
|
-
: T extends ObjectConstructor ? object
|
|
11
|
-
: T extends DetailedType<infer R> ? R
|
|
12
|
-
: never;
|
package/src/types/InnerData.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type InnerFields<Prefix extends string> = `_${Prefix}_${string}`;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 提取联合类型中相同原始类型为数组的一项
|
|
3
|
-
* @example
|
|
4
|
-
* ```ts
|
|
5
|
-
* type test = ListOfSamePrimitive< 1 | 2 | "a" | "b" | { name: string } | { age: number } | string[] | number[]>
|
|
6
|
-
* //=> ["a" | "b", 1 | 2, string[] | number[], {name: string;} | {age: number;}]
|
|
7
|
-
* ```
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { RemoveNever } from "./RemoveNever";
|
|
11
|
-
|
|
12
|
-
export type ListOfSamePrimitive<U> = RemoveNever<
|
|
13
|
-
[
|
|
14
|
-
Extract<U, string>,
|
|
15
|
-
Extract<U, number>,
|
|
16
|
-
Extract<U, boolean>,
|
|
17
|
-
Extract<U, unknown[]>,
|
|
18
|
-
U extends unknown[] ? never : Extract<U, object>,
|
|
19
|
-
]
|
|
20
|
-
>;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
export type WMTriggerEventOption = WechatMiniprogram.Component.TriggerEventOption;
|
|
2
|
-
|
|
3
|
-
export type WMCustomEvent<
|
|
4
|
-
Detail = undefined,
|
|
5
|
-
Mark extends object = object,
|
|
6
|
-
CurrentTargetDataset extends object = object,
|
|
7
|
-
TargetDataset extends object = CurrentTargetDataset,
|
|
8
|
-
> = WechatMiniprogram.CustomEvent<
|
|
9
|
-
// @ts-ignore 官方的类型定义有问题
|
|
10
|
-
Detail,
|
|
11
|
-
Mark,
|
|
12
|
-
CurrentTargetDataset,
|
|
13
|
-
TargetDataset
|
|
14
|
-
>;
|
|
15
|
-
|
|
16
|
-
export type WMBaseEvent<
|
|
17
|
-
Mark extends object = object,
|
|
18
|
-
CurrentTargetDataset extends object = object,
|
|
19
|
-
TargetDataset extends object = CurrentTargetDataset,
|
|
20
|
-
> = WechatMiniprogram.BaseEvent<Mark, CurrentTargetDataset, TargetDataset>;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* 事件触发组件的Dataset类型
|
|
24
|
-
*/
|
|
25
|
-
export type Dataset<
|
|
26
|
-
TCurrentTargetDataset extends object,
|
|
27
|
-
TargetDataset extends object = TCurrentTargetDataset,
|
|
28
|
-
Detail = undefined,
|
|
29
|
-
> = WMCustomEvent<Detail, object, TCurrentTargetDataset, TargetDataset>;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* 自定义事件Detail类型
|
|
33
|
-
*/
|
|
34
|
-
export type Mark<TMark extends object> = Required<
|
|
35
|
-
WechatMiniprogram.CustomEvent<
|
|
36
|
-
object,
|
|
37
|
-
TMark,
|
|
38
|
-
object,
|
|
39
|
-
object
|
|
40
|
-
>
|
|
41
|
-
>;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* 自定义事件Detail类型
|
|
45
|
-
*/
|
|
46
|
-
export type Detail<T> = WMCustomEvent<T>;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* 当前事件组件Dataset
|
|
50
|
-
*/
|
|
51
|
-
export type CurrentTargetDataset<T extends object> = WMCustomEvent<{}, {}, T>;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* 触发事件组件Dataset
|
|
55
|
-
*/
|
|
56
|
-
export type TargetDataset<TargetDataset extends object> = WMCustomEvent<{}, {}, {}, TargetDataset>;
|
|
57
|
-
|
|
58
|
-
export type WMComponentOption = WechatMiniprogram.Component.ComponentOptions;
|
|
59
|
-
|
|
60
|
-
export type WMNavigateToSuccessCallbackResult = WechatMiniprogram.NavigateToSuccessCallbackResult;
|
|
61
|
-
|
|
62
|
-
export type WMCompPageLifetimes = WechatMiniprogram.Component.PageLifetimes;
|
|
63
|
-
|
|
64
|
-
export type WMComponentInstance = WechatMiniprogram.Component.InstanceProperties;
|
|
65
|
-
|
|
66
|
-
export type WMPageInstance = WechatMiniprogram.Page.InstanceProperties;
|
|
67
|
-
|
|
68
|
-
export type WMNavigateToOption = WechatMiniprogram.NavigateToOption;
|
|
69
|
-
|
|
70
|
-
export type WMInstanceMethods<T extends object> = WechatMiniprogram.Component.InstanceMethods<T>;
|
|
71
|
-
|
|
72
|
-
export type WMCompLifetimes = WechatMiniprogram.Component.Lifetimes;
|
|
73
|
-
|
|
74
|
-
export type WMCompOtherOption = WechatMiniprogram.Component.OtherOption;
|
|
75
|
-
|
|
76
|
-
export type WMPageLifetimes = WechatMiniprogram.Page.ILifetime;
|
|
77
|
-
|
|
78
|
-
// export declare namespace WMComponent {
|
|
79
|
-
// interface Options {
|
|
80
|
-
// /**
|
|
81
|
-
// * [启用多slot支持](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#组件wxml的slot)
|
|
82
|
-
// */
|
|
83
|
-
// multipleSlots?: boolean;
|
|
84
|
-
// /**
|
|
85
|
-
// * 原始文档 [组件样式隔离](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#组件样式隔离)
|
|
86
|
-
// * @deprecated glass-easel框架下被废弃 [兼容文档](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/glass-easel/migration.html#JSON-%E9%85%8D%E7%BD%AE)
|
|
87
|
-
// */
|
|
88
|
-
// addGlobalClass?: boolean;
|
|
89
|
-
// /**
|
|
90
|
-
// * [组件样式隔离](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#组件样式隔离)
|
|
91
|
-
// */
|
|
92
|
-
// styleIsolation?:
|
|
93
|
-
// | "isolated"
|
|
94
|
-
// | "apply-shared"
|
|
95
|
-
// | "shared"
|
|
96
|
-
// | "page-isolated"
|
|
97
|
-
// | "page-apply-shared"
|
|
98
|
-
// | "page-shared";
|
|
99
|
-
// /**
|
|
100
|
-
// * [纯数据字段](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/pure-data.html) 是一些不用于界面渲染的 data 字段,可以用于提升页面更新性能。从小程序基础库版本 2.8.2 开始支持。
|
|
101
|
-
// */
|
|
102
|
-
// pureDataPattern?: RegExp;
|
|
103
|
-
// /**
|
|
104
|
-
// * [虚拟化组件节点](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#%E8%99%9A%E6%8B%9F%E5%8C%96%E7%BB%84%E4%BB%B6%E8%8A%82%E7%82%B9) 使自定义组件内部的第一层节点由自定义组件本身完全决定。从小程序基础库版本 [`2.11.2`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 开始支持 */
|
|
105
|
-
// virtualHost?: boolean;
|
|
106
|
-
// }
|
|
107
|
-
// }
|
package/src/types/RemoveNever.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { RequiredKeys } from "hry-types/src/Object/RequiredKeys";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 去除对象中非可选字段类型中的null
|
|
5
|
-
*/
|
|
6
|
-
export type RemoveNullOfRequired<T extends object, RequireKeys extends keyof T = RequiredKeys<T>> = {
|
|
7
|
-
[k in keyof T]: k extends RequireKeys ? Exclude<T[k], null> : T[k];
|
|
8
|
-
};
|
package/src/types/Replace.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
|
|
2
|
-
|
|
3
|
-
type _Replace<Target, Source, DifferentKeys extends keyof Target, SameKey extends keyof Source> = ComputeIntersection<
|
|
4
|
-
& { [k in DifferentKeys]: Target[k] }
|
|
5
|
-
& { [k in SameKey]: Source[k] }
|
|
6
|
-
>;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Target与Source相同的key类型替换为Source的类型
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* type obj = { a: "a"; b: "b"; c: boolean };
|
|
13
|
-
* type obj2 = { a: number; b: string; d: number };
|
|
14
|
-
* type test = Replace<obj, obj2>;
|
|
15
|
-
* // test = { a: number; b: string; c: boolean}
|
|
16
|
-
* type test1 = Replace<{}, obj2>; // {}
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export type Replace<Target extends object, Source extends object> = _Replace<
|
|
20
|
-
Target,
|
|
21
|
-
Source,
|
|
22
|
-
Exclude<keyof Target, keyof Source>,
|
|
23
|
-
Extract<keyof Target, keyof Source>
|
|
24
|
-
>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
import type { ComponentDoc } from "../api/DefineComponent/returnType/ComponentDoc";
|
|
3
|
-
// import type { ComponentDoc } from "../api/DefineComponent/CreateDoc/ComponentDoc";
|
|
4
|
-
|
|
5
|
-
type _ReplacePrefix<O, TPrefix extends string> = {
|
|
6
|
-
[k in keyof O as k extends `${string}_${infer L}` ? `${TPrefix}_${L}` : k]: O[k];
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 更改文档前缀
|
|
11
|
-
* @param TComponentDoc - ComponentDoc
|
|
12
|
-
* @returns ComponentDoc
|
|
13
|
-
*/
|
|
14
|
-
export type ReplacePrefix<TComponentDoc extends ComponentDoc, TPrefix extends string = ""> =
|
|
15
|
-
& IfExtends<
|
|
16
|
-
unknown,
|
|
17
|
-
TComponentDoc["properties"],
|
|
18
|
-
{},
|
|
19
|
-
{
|
|
20
|
-
properties: _ReplacePrefix<TComponentDoc["properties"], TPrefix>;
|
|
21
|
-
}
|
|
22
|
-
>
|
|
23
|
-
& IfExtends<
|
|
24
|
-
unknown,
|
|
25
|
-
TComponentDoc["events"],
|
|
26
|
-
{},
|
|
27
|
-
{ events: _ReplacePrefix<TComponentDoc["events"], TPrefix> }
|
|
28
|
-
>;
|
|
29
|
-
|
|
30
|
-
// type Test1 = ReplacePrefix<{ properties: { xxx_name: string } }, "xxxDaa">;
|
|
31
|
-
|
|
32
|
-
// type Test1Expect = { properties: { xxxDaa_name: string } };
|
|
33
|
-
|
|
34
|
-
// Checking<Test1, Test1Expect, Test.Pass>;
|
|
35
|
-
|
|
36
|
-
// type Test2 = ReplacePrefix<{ events: { xxx_name: string } }, "xxxDaa">;
|
|
37
|
-
|
|
38
|
-
// type Test2Expect = { events: { xxxDaa_name: string } };
|
|
39
|
-
|
|
40
|
-
// Checking<Test2, Test2Expect, Test.Pass>;
|
|
41
|
-
|
|
42
|
-
// type Test3 = ReplacePrefix<{}, "xxxDaa">;
|
|
43
|
-
|
|
44
|
-
// type Test3Expect = {};
|
|
45
|
-
|
|
46
|
-
// Checking<Test3, Test3Expect, Test.Pass>;
|
package/src/types/Shift.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IsUnion } from "hry-types/src/Any/IsUnion";
|
|
2
|
-
import type { Last } from "hry-types/src/Union/Last";
|
|
3
|
-
|
|
4
|
-
type _UnionToComma<U, Prev extends string> = [U] extends [never] ? Prev
|
|
5
|
-
: _UnionToComma<Exclude<U, Last<U>>, `${Last<U> & string}、${Prev}`>;
|
|
6
|
-
|
|
7
|
-
export type UnionToComma<U extends string> = IsUnion<U> extends true
|
|
8
|
-
? _UnionToComma<Exclude<U, Last<U>>, Last<U> & string>
|
|
9
|
-
: U;
|
package/src/types/Validators.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// import { Checking, type Test } from "hry-types";
|
|
2
|
-
|
|
3
|
-
export type Validators<L extends unknown[]> = L extends [infer Head, ...infer Tail extends unknown[]]
|
|
4
|
-
? unknown extends Head ? Validators<Tail> : Head
|
|
5
|
-
: unknown;
|
|
6
|
-
|
|
7
|
-
// type list = [1, 2, 3];
|
|
8
|
-
|
|
9
|
-
// type list2 = [unknown, 1, 2];
|
|
10
|
-
|
|
11
|
-
// type lll = Validators<list>;
|
|
12
|
-
|
|
13
|
-
// Checking<lll, 1, Test.Pass>;
|
|
14
|
-
|
|
15
|
-
// type lll2 = Validators<list2>;
|
|
16
|
-
|
|
17
|
-
// Checking<lll2, 1, Test.Pass>;
|
package/src/types/includes.ts
DELETED
package/src/utils/InnerMarker.ts
DELETED