annil 1.17.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/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.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 +4 -3
- 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 -950
- 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 -41
- package/src/api/InstanceInject/instanceConfig.ts +0 -49
- package/src/api/InstanceInject/test/normal.test.ts +0 -42
- 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/datas/mormal.test.ts +0 -43
- package/src/api/RootComponent/Instance/test/methods/error.test.ts +0 -14
- package/src/api/RootComponent/Instance/test/methods/mormal.test.ts +0 -27
- 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 -55
- 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 -164
- 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,124 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
-
import { Checking, type Test } from "hry-types";
|
|
4
|
-
import type { ComputeIntersection } from "hry-types/src/Object/_api";
|
|
5
|
-
|
|
6
|
-
import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
|
|
7
|
-
import { RootComponent } from "../..";
|
|
8
|
-
import type { Mock_User } from "../../Properties/test/normalRequired.test";
|
|
9
|
-
type User = {
|
|
10
|
-
name: string;
|
|
11
|
-
age?: number;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const RootDoc = RootComponent()({
|
|
15
|
-
properties: {
|
|
16
|
-
firstName: String,
|
|
17
|
-
},
|
|
18
|
-
data: {
|
|
19
|
-
lastName: "lastName",
|
|
20
|
-
mock_User: {} as Mock_User,
|
|
21
|
-
},
|
|
22
|
-
store: {
|
|
23
|
-
prefix: () => "hry-", // 模拟而已
|
|
24
|
-
},
|
|
25
|
-
computed: {
|
|
26
|
-
fullName() {
|
|
27
|
-
// 1 计算属性字段可以通过this.data 引用properties、data、store字段
|
|
28
|
-
return this.data.prefix + this.data.firstName + this.data.lastName;
|
|
29
|
-
},
|
|
30
|
-
user() {
|
|
31
|
-
return {} as Mock_User;
|
|
32
|
-
},
|
|
33
|
-
// 2. 可依赖其他计算字段
|
|
34
|
-
id_fullName() {
|
|
35
|
-
return this.data.user.id + this.data.fullName;
|
|
36
|
-
},
|
|
37
|
-
readOnly() {
|
|
38
|
-
// 3 this.data 类型是深度只读的
|
|
39
|
-
Checking<
|
|
40
|
-
typeof this.data,
|
|
41
|
-
ComputeIntersection<
|
|
42
|
-
{
|
|
43
|
-
firstName: string;
|
|
44
|
-
lastName: string;
|
|
45
|
-
mock_User: Mock_User;
|
|
46
|
-
fullName: string;
|
|
47
|
-
user: Mock_User;
|
|
48
|
-
prefix: string;
|
|
49
|
-
id_fullName: string;
|
|
50
|
-
readOnly: "str";
|
|
51
|
-
} & IInjectAllData
|
|
52
|
-
>,
|
|
53
|
-
Test.Pass
|
|
54
|
-
>;
|
|
55
|
-
|
|
56
|
-
// @ts-expect-error 深度只读 不可赋值
|
|
57
|
-
this.data.user.id = "xxx";
|
|
58
|
-
|
|
59
|
-
return "str";
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// 4. 返回的文档类型中computed类型为计算字段函数返回类型
|
|
65
|
-
type ComputedDocExpected = {
|
|
66
|
-
fullName: string;
|
|
67
|
-
user: Mock_User;
|
|
68
|
-
id_fullName: string;
|
|
69
|
-
readOnly: "str";
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
Checking<typeof RootDoc["computed"], ComputedDocExpected, Test.Pass>;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 5 无计算属性字段时,返回文档中无computed字段
|
|
76
|
-
*/
|
|
77
|
-
const noComputedFieldDoc = RootComponent()({
|
|
78
|
-
methods: {
|
|
79
|
-
M1() {
|
|
80
|
-
// 5.1 无computed,this.data中为{}
|
|
81
|
-
Checking<typeof this.data, IInjectAllData, Test.Pass>;
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
Checking<typeof noComputedFieldDoc, { methods: { M1: () => void } }, Test.Pass>;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 6 计算属性字段为空对象时,返回文档中无computed字段
|
|
90
|
-
*/
|
|
91
|
-
const EmptyComputedFieldDoc = RootComponent()({
|
|
92
|
-
computed: {},
|
|
93
|
-
methods: {
|
|
94
|
-
M1() {
|
|
95
|
-
// 6.1 computed为{},this.data中为{}
|
|
96
|
-
Checking<typeof this.data, IInjectAllData, Test.Pass>;
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
Checking<typeof EmptyComputedFieldDoc, { methods: { M1: () => void } }, Test.Pass>;
|
|
102
|
-
|
|
103
|
-
type Custom = { type: "custom"; xxx: string };
|
|
104
|
-
type Chunk = { type: "chunk"; yyy: number };
|
|
105
|
-
type Union = Custom | Chunk;
|
|
106
|
-
/**
|
|
107
|
-
* 6 计算属性可以使用实例上的方法和属性
|
|
108
|
-
*/
|
|
109
|
-
RootComponent()({
|
|
110
|
-
data: {
|
|
111
|
-
union: { type: "custom", xxx: "123" } as Union,
|
|
112
|
-
},
|
|
113
|
-
computed: {
|
|
114
|
-
count(): string | number {
|
|
115
|
-
const { union } = this.data;
|
|
116
|
-
return this.isCustom(union) ? union.xxx : union.yyy;
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
methods: {
|
|
120
|
-
isCustom(union: Union): union is Custom {
|
|
121
|
-
return union.type === "custom";
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { DetailedType } from "../../../types/DetailedType";
|
|
2
|
-
|
|
3
|
-
type SimpleCustomeEvents = DetailedType | null | undefined;
|
|
4
|
-
|
|
5
|
-
export type SimpleCustomeEventsList = SimpleCustomeEvents[];
|
|
6
|
-
|
|
7
|
-
export type ShortCustomeEvents = SimpleCustomeEvents | SimpleCustomeEventsList;
|
|
8
|
-
|
|
9
|
-
// options
|
|
10
|
-
type BubblesConfig = { bubbles: true };
|
|
11
|
-
|
|
12
|
-
type CaptureConfig = { capturePhase: true };
|
|
13
|
-
|
|
14
|
-
type ComposedCongifg = { composed: true };
|
|
15
|
-
|
|
16
|
-
type NonBubblesConfig = { bubbles?: never };
|
|
17
|
-
|
|
18
|
-
type NonComposedConfig = { composed?: never };
|
|
19
|
-
|
|
20
|
-
type NonCaptureConfig = { capturePhase?: never };
|
|
21
|
-
|
|
22
|
-
export type BubblesOption = BubblesConfig & NonComposedConfig & NonCaptureConfig;
|
|
23
|
-
|
|
24
|
-
export type CaptureOption = CaptureConfig & NonBubblesConfig & NonComposedConfig;
|
|
25
|
-
|
|
26
|
-
export type BubblesCaptureOption = BubblesConfig & CaptureConfig & NonComposedConfig;
|
|
27
|
-
|
|
28
|
-
export type BubblesComposedOption = BubblesConfig & ComposedCongifg & NonCaptureConfig;
|
|
29
|
-
|
|
30
|
-
export type CaptureComposedOption = CaptureConfig & ComposedCongifg & NonBubblesConfig;
|
|
31
|
-
|
|
32
|
-
export type BubblesCaptureComposedOption = BubblesConfig & ComposedCongifg & CaptureConfig;
|
|
33
|
-
|
|
34
|
-
export type OptionsFieldsConfigOfCustomEvents =
|
|
35
|
-
| BubblesOption
|
|
36
|
-
| CaptureOption
|
|
37
|
-
| BubblesCaptureOption
|
|
38
|
-
| BubblesComposedOption
|
|
39
|
-
| CaptureComposedOption
|
|
40
|
-
| BubblesCaptureComposedOption;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* 带options的CustomEvents配置
|
|
44
|
-
*/
|
|
45
|
-
export type FullCustomEventsOptions = {
|
|
46
|
-
detail: ShortCustomeEvents;
|
|
47
|
-
options: OptionsFieldsConfigOfCustomEvents;
|
|
48
|
-
debounce?: never;
|
|
49
|
-
throttle?: never;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export type FullCustomEventsWithDebounce = {
|
|
53
|
-
detail: ShortCustomeEvents;
|
|
54
|
-
options?: never;
|
|
55
|
-
debounce: number;
|
|
56
|
-
throttle?: never;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export type FullCustomEventsWithThrottle = {
|
|
60
|
-
detail: ShortCustomeEvents;
|
|
61
|
-
options?: never;
|
|
62
|
-
debounce?: never;
|
|
63
|
-
throttle: number;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export type FullCustomEventsOptionsWithThrottle = {
|
|
67
|
-
detail: ShortCustomeEvents;
|
|
68
|
-
options: OptionsFieldsConfigOfCustomEvents;
|
|
69
|
-
debounce?: never;
|
|
70
|
-
throttle: number;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export type FullCustomEventsOptionsWithDebounce = {
|
|
74
|
-
detail: ShortCustomeEvents;
|
|
75
|
-
options: OptionsFieldsConfigOfCustomEvents;
|
|
76
|
-
debounce: number;
|
|
77
|
-
throttle?: never;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export type FullCustomEvents =
|
|
81
|
-
| FullCustomEventsOptions
|
|
82
|
-
| FullCustomEventsWithDebounce
|
|
83
|
-
| FullCustomEventsWithThrottle
|
|
84
|
-
| FullCustomEventsOptionsWithThrottle
|
|
85
|
-
| FullCustomEventsOptionsWithDebounce;
|
|
86
|
-
|
|
87
|
-
export type CustomEvents = FullCustomEvents | ShortCustomeEvents;
|
|
88
|
-
|
|
89
|
-
export type CustomEventConstraint = Record<string, CustomEvents>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { G } from "hry-types";
|
|
2
|
-
import type { CustomEventConstraint } from "./CustomEventConstraint";
|
|
3
|
-
|
|
4
|
-
export type CustomEventsOption<
|
|
5
|
-
TCustomEvents extends CustomEventConstraint,
|
|
6
|
-
DuplicateFields extends PropertyKey,
|
|
7
|
-
> = {
|
|
8
|
-
/**
|
|
9
|
-
* customEvents 定义组件的自定义事件 [类型约束](CustomEventConstraint.ts)
|
|
10
|
-
* @remarks 通过this.A(123)调用。与events字段重复检测
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* {
|
|
14
|
-
* customEvents: {
|
|
15
|
-
* A: Number, // number
|
|
16
|
-
* B: [String as DetailedType<"male" | "femal">, Number], // "male" | "femal" | number
|
|
17
|
-
* C: {
|
|
18
|
-
* detail: String,
|
|
19
|
-
* options: {
|
|
20
|
-
* bubbles: true,
|
|
21
|
-
* composed: true,
|
|
22
|
-
* capturePhase: true,
|
|
23
|
-
* },
|
|
24
|
-
* },
|
|
25
|
-
* },
|
|
26
|
-
* methods: {
|
|
27
|
-
* M1() {
|
|
28
|
-
* // 调用自定义事件
|
|
29
|
-
* this.A(123);
|
|
30
|
-
* this.B("femal");
|
|
31
|
-
* this.C("string");
|
|
32
|
-
* },
|
|
33
|
-
* },
|
|
34
|
-
* },
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
customEvents?:
|
|
38
|
-
& TCustomEvents
|
|
39
|
-
& G.IllegalFieldValidator<TCustomEvents, "bubbles" | "composed" | "capturePhase", 1, "options">
|
|
40
|
-
& G.DuplicateFieldValidator<TCustomEvents, DuplicateFields, "字段重复">;
|
|
41
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
import type {
|
|
3
|
-
BubblesCaptureComposedOption,
|
|
4
|
-
BubblesCaptureOption,
|
|
5
|
-
BubblesComposedOption,
|
|
6
|
-
BubblesOption,
|
|
7
|
-
CaptureComposedOption,
|
|
8
|
-
CaptureOption,
|
|
9
|
-
OptionsFieldsConfigOfCustomEvents,
|
|
10
|
-
} from "./CustomEventConstraint";
|
|
11
|
-
|
|
12
|
-
export type Bubbles = () => "bubbles";
|
|
13
|
-
|
|
14
|
-
export type Capture = () => "capture";
|
|
15
|
-
|
|
16
|
-
export type Composed = () => "composed";
|
|
17
|
-
|
|
18
|
-
export type BubblesCapture = Bubbles | Capture;
|
|
19
|
-
|
|
20
|
-
export type BubblesComposed = Bubbles | Composed;
|
|
21
|
-
|
|
22
|
-
export type CaptureComposed = Capture | Composed;
|
|
23
|
-
|
|
24
|
-
export type BubblesCaptureComposed = Bubbles | Capture | Composed;
|
|
25
|
-
|
|
26
|
-
export type CustomEventsTags =
|
|
27
|
-
| Bubbles
|
|
28
|
-
| Capture
|
|
29
|
-
| BubblesCapture
|
|
30
|
-
| BubblesComposed
|
|
31
|
-
| CaptureComposed
|
|
32
|
-
| BubblesCaptureComposed;
|
|
33
|
-
|
|
34
|
-
export type AddTagForCustomEventsDef<Options extends OptionsFieldsConfigOfCustomEvents> = IfExtends<
|
|
35
|
-
BubblesOption,
|
|
36
|
-
Options,
|
|
37
|
-
Bubbles,
|
|
38
|
-
IfExtends<
|
|
39
|
-
CaptureOption,
|
|
40
|
-
Options,
|
|
41
|
-
Capture,
|
|
42
|
-
IfExtends<
|
|
43
|
-
BubblesCaptureOption,
|
|
44
|
-
Options,
|
|
45
|
-
BubblesCapture,
|
|
46
|
-
IfExtends<
|
|
47
|
-
BubblesComposedOption,
|
|
48
|
-
Options,
|
|
49
|
-
BubblesComposed,
|
|
50
|
-
IfExtends<
|
|
51
|
-
CaptureComposedOption,
|
|
52
|
-
Options,
|
|
53
|
-
CaptureComposed,
|
|
54
|
-
IfExtends<BubblesCaptureComposedOption, Options, BubblesCaptureComposed>
|
|
55
|
-
>
|
|
56
|
-
>
|
|
57
|
-
>
|
|
58
|
-
>
|
|
59
|
-
>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
import type { DetailedType } from "../../../types/DetailedType";
|
|
3
|
-
import type { InferDetailedType } from "../../../types/InferDetailedType";
|
|
4
|
-
import type {
|
|
5
|
-
CustomEventConstraint,
|
|
6
|
-
FullCustomEvents,
|
|
7
|
-
ShortCustomeEvents,
|
|
8
|
-
SimpleCustomeEventsList,
|
|
9
|
-
} from "./CustomEventConstraint";
|
|
10
|
-
import type { AddTagForCustomEventsDef } from "./CustomEventsTag";
|
|
11
|
-
|
|
12
|
-
export type GetShortCustomEventsDef<T extends ShortCustomeEvents> = T extends DetailedType ? InferDetailedType<T>
|
|
13
|
-
: T extends null ? null
|
|
14
|
-
: T extends undefined ? undefined
|
|
15
|
-
: T extends SimpleCustomeEventsList ? GetShortCustomEventsDef<T[number]>
|
|
16
|
-
: never;
|
|
17
|
-
|
|
18
|
-
export type GetFullCustomEventsDef<T extends FullCustomEvents> =
|
|
19
|
-
| GetShortCustomEventsDef<T["detail"]>
|
|
20
|
-
| IfExtends<unknown, T["options"], never, AddTagForCustomEventsDef<T["options"] & {}>>;
|
|
21
|
-
|
|
22
|
-
export type GetCustomEventsDef<T extends CustomEventConstraint> = {
|
|
23
|
-
[k in keyof T]: T[k] extends ShortCustomeEvents ? GetShortCustomEventsDef<T[k]>
|
|
24
|
-
: T[k] extends FullCustomEvents ?
|
|
25
|
-
| GetShortCustomEventsDef<T[k]["detail"]>
|
|
26
|
-
// 为事件加上标签
|
|
27
|
-
| IfExtends<unknown, T[k]["options"], never, AddTagForCustomEventsDef<NonNullable<T[k]["options"]>>>
|
|
28
|
-
: never;
|
|
29
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
|
-
import type { DetailedType } from "../../../types/DetailedType";
|
|
3
|
-
import type { InferDetailedType } from "../../../types/InferDetailedType";
|
|
4
|
-
import type {
|
|
5
|
-
CustomEventConstraint,
|
|
6
|
-
FullCustomEvents,
|
|
7
|
-
ShortCustomeEvents,
|
|
8
|
-
SimpleCustomeEventsList,
|
|
9
|
-
} from "./CustomEventConstraint";
|
|
10
|
-
import type { AddTagForCustomEventsDef } from "./CustomEventsTag";
|
|
11
|
-
|
|
12
|
-
export type GetShortCustomEventsDoc<T extends ShortCustomeEvents> = T extends DetailedType ? InferDetailedType<T>
|
|
13
|
-
: T extends null ? null
|
|
14
|
-
: T extends undefined ? undefined
|
|
15
|
-
: T extends SimpleCustomeEventsList ? GetShortCustomEventsDoc<T[number]>
|
|
16
|
-
: never;
|
|
17
|
-
|
|
18
|
-
export type GetFullCustomEventsDoc<T extends FullCustomEvents> =
|
|
19
|
-
| GetShortCustomEventsDoc<T["detail"]>
|
|
20
|
-
| IfExtends<unknown, T["options"], never, AddTagForCustomEventsDef<T["options"] & {}>>;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* 获取自定义事件的文档
|
|
24
|
-
* demo
|
|
25
|
-
* ```ts
|
|
26
|
-
* customEvents:{
|
|
27
|
-
* a:Number,
|
|
28
|
-
* b:{ detail: String,options:{ bubbles:true } }
|
|
29
|
-
* c:{ detail: Number,options:{ bubbles:true, composed:true } }
|
|
30
|
-
* }
|
|
31
|
-
* //result => {a:number,b:string|()=>'bubbles',c:number | ()=>'composed' }
|
|
32
|
-
* ```
|
|
33
|
-
* @returns object
|
|
34
|
-
*/
|
|
35
|
-
// @dprint-ignore
|
|
36
|
-
export type GetCustomEventDoc<T extends CustomEventConstraint> =
|
|
37
|
-
{
|
|
38
|
-
[k in keyof T]: T[k] extends ShortCustomeEvents ? GetShortCustomEventsDoc<T[k]>
|
|
39
|
-
// 应该写GetFullCustomEventsDoc<T[k]>带鼠标悬停时不是计算结果。所以代码重复了。
|
|
40
|
-
: // @ts-ignore T[k] 一定为 FullCustomEvents 类型
|
|
41
|
-
| GetShortCustomEventsDoc<T[k]["detail"]>
|
|
42
|
-
// 为自定义事件模型加标记,方便识别
|
|
43
|
-
// @ts-ignore T[k] 一定为 FullCustomEvents 类型
|
|
44
|
-
// | AddTagForCustomEventsDoc<T[k]["options"]>;
|
|
45
|
-
| IfExtends<unknown, T[k]["options"], never, AddTagForCustomEventsDef<T[k]["options"] & {}>>;
|
|
46
|
-
}
|
|
47
|
-
;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Checking, type Test } from "hry-types";
|
|
2
|
-
import type { GetCustomEventsDef } from "../GetCustomEventDef";
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
type BubblesCapturePhaseComposedExpected,
|
|
6
|
-
type BubblesCapturePhaseExpected,
|
|
7
|
-
type BubblesComposedExpected,
|
|
8
|
-
type bubblesExpected,
|
|
9
|
-
type CapturePhaseComposedExpected,
|
|
10
|
-
type CapturePhaseExpected,
|
|
11
|
-
} from "./GetFullEventDoc.test";
|
|
12
|
-
import {
|
|
13
|
-
type ListExpected,
|
|
14
|
-
type NullExpected,
|
|
15
|
-
type ObjExpected,
|
|
16
|
-
type StrExpected,
|
|
17
|
-
type UnionStrExpected,
|
|
18
|
-
} from "./GetShortEventDoc.test";
|
|
19
|
-
import { type mock_customEvents } from "./normal.test";
|
|
20
|
-
|
|
21
|
-
type Mock_CustomEventsDoc = GetCustomEventsDef<typeof mock_customEvents>;
|
|
22
|
-
|
|
23
|
-
export type Mock_CustomEventsDocExpected = {
|
|
24
|
-
str: StrExpected;
|
|
25
|
-
null: NullExpected;
|
|
26
|
-
nothing: undefined;
|
|
27
|
-
unionStr: UnionStrExpected;
|
|
28
|
-
union: ListExpected;
|
|
29
|
-
obj: ObjExpected;
|
|
30
|
-
bubbles: bubblesExpected;
|
|
31
|
-
capturePhase: CapturePhaseExpected;
|
|
32
|
-
bubbles_capturePhase: BubblesCapturePhaseExpected;
|
|
33
|
-
bubbles_composed: BubblesComposedExpected;
|
|
34
|
-
capturePhase_composed: CapturePhaseComposedExpected;
|
|
35
|
-
bubbles_capturePhase_composed: BubblesCapturePhaseComposedExpected;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
void Checking<Mock_CustomEventsDoc, Mock_CustomEventsDocExpected, Test.Pass>;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
2
|
-
import { Checking, type Test } from "hry-types";
|
|
3
|
-
import type {
|
|
4
|
-
Bubbles,
|
|
5
|
-
BubblesCapture,
|
|
6
|
-
BubblesCaptureComposed,
|
|
7
|
-
BubblesComposed,
|
|
8
|
-
Capture,
|
|
9
|
-
CaptureComposed,
|
|
10
|
-
} from "../CustomEventsTag";
|
|
11
|
-
|
|
12
|
-
import type { GetFullCustomEventsDoc } from "../GetCustomEventDoc";
|
|
13
|
-
import { type mock_fullCustomEvents } from "./normal.test";
|
|
14
|
-
|
|
15
|
-
// bubbles
|
|
16
|
-
type bubblesResult = GetFullCustomEventsDoc<typeof mock_fullCustomEvents["bubbles"]>;
|
|
17
|
-
|
|
18
|
-
export type bubblesExpected = string | Bubbles;
|
|
19
|
-
|
|
20
|
-
Checking<bubblesResult, bubblesExpected, Test.Pass>;
|
|
21
|
-
|
|
22
|
-
// CapturePhase
|
|
23
|
-
type CapturePhaseResult = GetFullCustomEventsDoc<typeof mock_fullCustomEvents["capturePhase"]>;
|
|
24
|
-
|
|
25
|
-
export type CapturePhaseExpected = Capture | null;
|
|
26
|
-
|
|
27
|
-
Checking<CapturePhaseResult, CapturePhaseExpected, Test.Pass>;
|
|
28
|
-
|
|
29
|
-
// bubbles_capturePhase
|
|
30
|
-
type BubblesCapturePhaseResult = GetFullCustomEventsDoc<typeof mock_fullCustomEvents["bubbles_capturePhase"]>;
|
|
31
|
-
|
|
32
|
-
export type BubblesCapturePhaseExpected = string | number | BubblesCapture;
|
|
33
|
-
|
|
34
|
-
Checking<BubblesCapturePhaseResult, BubblesCapturePhaseExpected, Test.Pass>;
|
|
35
|
-
|
|
36
|
-
// bubbles_composed
|
|
37
|
-
type BubblesComposedResult = GetFullCustomEventsDoc<typeof mock_fullCustomEvents["bubbles_composed"]>;
|
|
38
|
-
|
|
39
|
-
export type BubblesComposedExpected = "male" | "female" | BubblesComposed;
|
|
40
|
-
|
|
41
|
-
Checking<BubblesComposedResult, BubblesComposedExpected, Test.Pass>;
|
|
42
|
-
|
|
43
|
-
// capturePhase_composed
|
|
44
|
-
type CapturePhaseComposedResult = GetFullCustomEventsDoc<typeof mock_fullCustomEvents["capturePhase_composed"]>;
|
|
45
|
-
|
|
46
|
-
export type CapturePhaseComposedExpected = string | 0 | 1 | 2 | null | CaptureComposed;
|
|
47
|
-
|
|
48
|
-
Checking<CapturePhaseComposedResult, CapturePhaseComposedExpected, Test.Pass>;
|
|
49
|
-
|
|
50
|
-
// bubbles_capturePhase_composed
|
|
51
|
-
type BubblesCapturePhaseComposedResult = GetFullCustomEventsDoc<
|
|
52
|
-
typeof mock_fullCustomEvents["bubbles_capturePhase_composed"]
|
|
53
|
-
>;
|
|
54
|
-
|
|
55
|
-
export type BubblesCapturePhaseComposedExpected = boolean | BubblesCaptureComposed;
|
|
56
|
-
|
|
57
|
-
Checking<BubblesCapturePhaseComposedResult, BubblesCapturePhaseComposedExpected, Test.Pass>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
2
|
-
import { Checking, type Test } from "hry-types";
|
|
3
|
-
|
|
4
|
-
import type { Mock_User } from "../../Properties/test/normalRequired.test";
|
|
5
|
-
import type { GetShortCustomEventsDef } from "../GetCustomEventDef";
|
|
6
|
-
import { type mock_shortCustomEvents } from "./normal.test";
|
|
7
|
-
|
|
8
|
-
type StrResult = GetShortCustomEventsDef<typeof mock_shortCustomEvents["str"]>;
|
|
9
|
-
|
|
10
|
-
export type StrExpected = string;
|
|
11
|
-
|
|
12
|
-
Checking<StrResult, StrExpected, Test.Pass>;
|
|
13
|
-
|
|
14
|
-
type NullResult = GetShortCustomEventsDef<typeof mock_shortCustomEvents["null"]>;
|
|
15
|
-
|
|
16
|
-
export type NullExpected = null;
|
|
17
|
-
|
|
18
|
-
Checking<NullResult, NullExpected, Test.Pass>;
|
|
19
|
-
|
|
20
|
-
type UnionStrResult = GetShortCustomEventsDef<typeof mock_shortCustomEvents["unionStr"]>;
|
|
21
|
-
|
|
22
|
-
export type UnionStrExpected = "male" | "female";
|
|
23
|
-
|
|
24
|
-
Checking<UnionStrResult, UnionStrExpected, Test.Pass>;
|
|
25
|
-
|
|
26
|
-
type ListResult = GetShortCustomEventsDef<typeof mock_shortCustomEvents["union"]>;
|
|
27
|
-
|
|
28
|
-
export type ListExpected = string | 0 | 1 | 2 | null;
|
|
29
|
-
|
|
30
|
-
Checking<ListResult, ListExpected, Test.Pass>;
|
|
31
|
-
|
|
32
|
-
type ObjResult = GetShortCustomEventsDef<typeof mock_shortCustomEvents["obj"]>;
|
|
33
|
-
|
|
34
|
-
export type ObjExpected = Mock_User;
|
|
35
|
-
|
|
36
|
-
Checking<ObjResult, ObjExpected, Test.Pass>;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { RootComponent } from "../..";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 1 错误的字段类型
|
|
5
|
-
*/
|
|
6
|
-
RootComponent()({
|
|
7
|
-
customEvents: {
|
|
8
|
-
// @ts-expect-error options 1.1 没有options字段时无需写对象形式,应简写`error1:Boolean`。
|
|
9
|
-
error1: {
|
|
10
|
-
detail: Boolean,
|
|
11
|
-
},
|
|
12
|
-
// @ts-expect-error options 1.2 不可以为空对象 无意义
|
|
13
|
-
error2: {
|
|
14
|
-
detail: Boolean,
|
|
15
|
-
options: {},
|
|
16
|
-
},
|
|
17
|
-
// @ts-expect-error 1.3 false字段不要写 默认就为false
|
|
18
|
-
error3: {
|
|
19
|
-
detail: Boolean,
|
|
20
|
-
options: { bubbles: false },
|
|
21
|
-
},
|
|
22
|
-
// @ts-expect-error 1.4 false 字段不要写 默认false
|
|
23
|
-
error4: {
|
|
24
|
-
detail: Boolean,
|
|
25
|
-
options: { capturePhase: false },
|
|
26
|
-
},
|
|
27
|
-
// @ts-expect-error 1.5 composed字段不可以单独开启,必须存在 bubbles或capturePhase字段为true时
|
|
28
|
-
error5: {
|
|
29
|
-
detail: Boolean,
|
|
30
|
-
options: { composed: true },
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* 2 重复字段
|
|
37
|
-
*/
|
|
38
|
-
RootComponent()({
|
|
39
|
-
events: {
|
|
40
|
-
aaa() {
|
|
41
|
-
void 0;
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
customEvents: {
|
|
45
|
-
// @ts-expect-error "⚠️与events字段重复⚠️"
|
|
46
|
-
aaa: String,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* 3.1 非法字段验证
|
|
52
|
-
*/
|
|
53
|
-
RootComponent()({
|
|
54
|
-
customEvents: {
|
|
55
|
-
error1: {
|
|
56
|
-
detail: String,
|
|
57
|
-
options: {
|
|
58
|
-
bubbles: true,
|
|
59
|
-
// @ts-expect-error 非法字段 composed 少了d
|
|
60
|
-
compose: true,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* 3.2 非法字段验证
|
|
68
|
-
*/
|
|
69
|
-
RootComponent()({
|
|
70
|
-
customEvents: {
|
|
71
|
-
error2: {
|
|
72
|
-
detail: String,
|
|
73
|
-
options: {
|
|
74
|
-
bubbles: true,
|
|
75
|
-
// @ts-expect-error 非法字段 capturePhases 多了 s
|
|
76
|
-
capturePhases: true,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* 4 重复字段与非法同时存在时 只报其一错误(非法),确保报错位置在字段而非customEvents位置。
|
|
84
|
-
*/
|
|
85
|
-
RootComponent()({
|
|
86
|
-
events: {
|
|
87
|
-
aaa() {
|
|
88
|
-
void 0;
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
customEvents: {
|
|
92
|
-
bbb: {
|
|
93
|
-
detail: null,
|
|
94
|
-
options: {
|
|
95
|
-
// @ts-expect-error 非法字段
|
|
96
|
-
bubbleds: false,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
aaa: String,
|
|
100
|
-
},
|
|
101
|
-
});
|