annil 1.7.4 → 1.7.5-beta.4
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/CHANGELOG.md +30 -0
- package/README.md +11 -7
- package/dist/api/DefineComponent/NameOrPage/NameOrPathOption.d.ts +9 -0
- package/dist/api/DefineComponent/ReturnType/ComponentDoc.d.ts +9 -0
- package/dist/api/DefineComponent/ReturnType/GetCustomEventDocOfSubDoc.d.ts +8 -0
- package/dist/api/DefineComponent/ReturnType/PageDoc.d.ts +9 -0
- package/dist/api/DefineComponent/RootComponent/RootComponentOption.d.ts +6 -0
- package/dist/api/DefineComponent/SubComponents/SubComponentsOption.d.ts +6 -0
- package/dist/api/DefineComponent/index.d.ts +5 -4
- package/dist/api/DefineComponent/index.js +8 -2
- package/dist/api/DefineComponent/index.js.map +1 -1
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/computedUpdater.d.ts +1 -1
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/computedUpdater.js +5 -0
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/computedUpdater.js.map +1 -0
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/data-tracer.d.ts +3 -1
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/data-tracer.js +4 -1
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/data-tracer.js.map +1 -0
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/dependencesOptimize.js +5 -0
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/dependencesOptimize.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/getPathsValue.d.ts +7 -0
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/getPathsValue.js +30 -0
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/getPathsValue.js.map +1 -0
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/getPropertiesValue.js +3 -0
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/getPropertiesValue.js.map +1 -0
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/index.js +13 -3
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/index.js.map +1 -0
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/initComputedAndGetCache.d.ts +9 -0
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/initComputedAndGetCache.js +21 -0
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/initComputedAndGetCache.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/isEqual.d.ts +7 -0
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/isEqual.js +69 -0
- package/dist/api/DefineComponent/normalizeOptions/computedWatchHandle/isEqual.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/customEventsHandle.d.ts +6 -0
- package/dist/api/DefineComponent/normalizeOptions/customEventsHandle.js +23 -0
- package/dist/api/DefineComponent/normalizeOptions/customEventsHandle.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/index.d.ts +6 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/index.js +16 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/index.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/isPageCheck.d.ts +5 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/isPageCheck.js +17 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/isPageCheck.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/loadReceivedDataHandle.d.ts +7 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/loadReceivedDataHandle.js +20 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/loadReceivedDataHandle.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/onLoadReceivedDataHandle.d.ts +10 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/onLoadReceivedDataHandle.js +26 -0
- package/dist/api/DefineComponent/normalizeOptions/hijackHandle/onLoadReceivedDataHandle.js.map +1 -0
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/index.d.ts +20 -18
- package/dist/api/DefineComponent/normalizeOptions/index.js +77 -0
- package/dist/api/DefineComponent/normalizeOptions/index.js.map +1 -0
- package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/initStore/index.js +2 -0
- package/dist/api/DefineComponent/normalizeOptions/initStore/index.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/injectInfoHandler.d.ts +3 -0
- package/dist/api/DefineComponent/normalizeOptions/injectInfoHandler.js +43 -0
- package/dist/api/DefineComponent/normalizeOptions/injectInfoHandler.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/internalFieldProtection.d.ts +5 -0
- package/dist/api/DefineComponent/normalizeOptions/internalFieldProtection.js +23 -0
- package/dist/api/DefineComponent/normalizeOptions/internalFieldProtection.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/otherFieldsHandle.d.ts +6 -0
- package/dist/api/DefineComponent/normalizeOptions/otherFieldsHandle.js +24 -0
- package/dist/api/DefineComponent/normalizeOptions/otherFieldsHandle.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/rootComponentOptionHandle.d.ts +9 -0
- package/dist/api/DefineComponent/normalizeOptions/rootComponentOptionHandle.js +18 -0
- package/dist/api/DefineComponent/normalizeOptions/rootComponentOptionHandle.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.d.ts +7 -0
- package/dist/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.js +17 -0
- package/dist/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/sameFuncOptionsHandle.d.ts +5 -0
- package/dist/api/DefineComponent/normalizeOptions/sameFuncOptionsHandle.js +34 -0
- package/dist/api/DefineComponent/normalizeOptions/sameFuncOptionsHandle.js.map +1 -0
- package/dist/api/DefineComponent/normalizeOptions/subComponentsOptionHandle.d.ts +3 -0
- package/dist/api/DefineComponent/normalizeOptions/subComponentsOptionHandle.js +11 -0
- package/dist/api/DefineComponent/normalizeOptions/subComponentsOptionHandle.js.map +1 -0
- package/dist/api/InstanceInject/instanceConfig.d.ts +4 -0
- package/dist/api/InstanceInject/instanceConfig.js +5 -1
- package/dist/api/InstanceInject/instanceConfig.js.map +1 -1
- package/dist/api/RootComponent/Computed/ComputedConstraint.d.ts +4 -1
- package/dist/api/RootComponent/Computed/ComputedOption.d.ts +23 -0
- package/dist/api/RootComponent/Computed/GetComputedDoc.d.ts +5 -0
- package/dist/api/RootComponent/CustomEvents/CustomEventConstraint.d.ts +3 -0
- package/dist/api/RootComponent/CustomEvents/CustomEventsOption.d.ts +29 -0
- package/dist/api/RootComponent/CustomEvents/GetCustomEventDoc.d.ts +13 -0
- package/dist/api/RootComponent/Data/DataOption.d.ts +14 -0
- package/dist/api/RootComponent/Events/EventsConstraint.d.ts +4 -1
- package/dist/api/RootComponent/Events/EventsOption.d.ts +52 -0
- package/dist/api/RootComponent/Instance/CustomSetData.d.ts +6 -0
- package/dist/api/RootComponent/Instance/RootComponentInstance.d.ts +9 -0
- package/dist/api/RootComponent/IsPage/IsPageOption.d.ts +3 -0
- package/dist/api/RootComponent/Lifetimes/LifetimesConstraint.d.ts +5 -2
- package/dist/api/RootComponent/Lifetimes/LifetimesOption.d.ts +26 -0
- package/dist/api/RootComponent/Methods/MethodsOption.d.ts +3 -0
- package/dist/api/RootComponent/Observers/ObserversOption.d.ts +4 -0
- package/dist/api/RootComponent/PageLifetimes/PageLifetimesOption.d.ts +11 -0
- package/dist/api/RootComponent/Properties/GetOptionalDoc.d.ts +3 -0
- package/dist/api/RootComponent/Properties/GetPropertiesDoc.d.ts +3 -0
- package/dist/api/RootComponent/Properties/GetRequiredDoc.d.ts +4 -0
- package/dist/api/RootComponent/Properties/PropertiesConstraint.d.ts +18 -0
- package/dist/api/RootComponent/Properties/PropertiesOption.d.ts +10 -0
- package/dist/api/RootComponent/Properties/PropertiesValueValidator.d.ts +4 -0
- package/dist/api/RootComponent/RootComponentDoc.d.ts +19 -0
- package/dist/api/RootComponent/Store/StoreOption.d.ts +12 -0
- package/dist/api/RootComponent/Watch/WatchOption.d.ts +4 -0
- package/dist/api/RootComponent/index.d.ts +17 -19
- package/dist/api/RootComponent/index.js +1 -0
- package/dist/api/RootComponent/index.js.map +1 -1
- package/dist/api/SubComponent/SubComponentDoc.d.ts +9 -0
- package/dist/api/SubComponent/SubData/SubDataConstraint.d.ts +4 -0
- package/dist/api/SubComponent/SubData/SubDataOption.d.ts +4 -0
- package/dist/api/SubComponent/SubEvents/SubEventsConstraint.d.ts +3 -0
- package/dist/api/SubComponent/SubEvents/SubEventsOptions.d.ts +5 -0
- package/dist/api/SubComponent/SubInherit/SubInheritConstraint.d.ts +4 -0
- package/dist/api/SubComponent/SubInherit/SubInheritOption.d.ts +6 -1
- package/dist/api/SubComponent/SubMethods/SubMethodsConstraint.d.ts +1 -3
- package/dist/api/SubComponent/SubMethods/SubMethodsOption.d.ts +3 -0
- package/dist/api/SubComponent/SubStore/SubStoreConstraint.d.ts +4 -0
- package/dist/api/SubComponent/SubStore/SubStoreOption.d.ts +14 -0
- package/dist/api/SubComponent/index.d.ts +10 -8
- package/dist/api/SubComponent/index.js +5 -0
- package/dist/api/SubComponent/index.js.map +1 -1
- package/dist/api/navigateTo.d.ts +5 -0
- package/dist/api/navigateTo.js +10 -1
- package/dist/api/navigateTo.js.map +1 -1
- package/dist/behaviors/BStore.d.ts +4 -0
- package/dist/behaviors/BStore.js +9 -0
- package/dist/behaviors/BStore.js.map +1 -1
- package/dist/behaviors/BbeforeCreated.d.ts +3 -0
- package/dist/behaviors/BbeforeCreated.js +8 -1
- package/dist/behaviors/BbeforeCreated.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/thirdLib/vant/Button.d.ts +14 -2
- package/dist/thirdLib/vant/NoticeBar.d.ts +2 -2
- package/dist/thirdLib/vant/Popup.d.ts +42 -2
- package/dist/thirdLib/wm/Textarea.d.ts +11 -2
- package/dist/thirdLib/wm/baseEvents.d.ts +39 -2
- package/dist/thirdLib/wm/scrollView.d.ts +4 -2
- package/dist/thirdLib/wm/scrollView.js +6 -0
- package/dist/thirdLib/wm/scrollView.js.map +1 -1
- package/dist/thirdLib/wm/swiper.d.ts +75 -5
- package/dist/thirdLib/wm/view.d.ts +20 -2
- package/dist/types/AddNullForObject.d.ts +3 -0
- package/dist/types/AddPrefix.d.ts +7 -0
- package/dist/types/{GenerateDoc.d.ts → CreateComponentType.d.ts} +3 -3
- package/dist/types/CreateComponentType.js +2 -0
- package/dist/types/CreateComponentType.js.map +1 -0
- package/dist/types/DetailedType.d.ts +15 -5
- package/dist/types/DocAssign.d.ts +3 -0
- package/dist/types/DocAssign.js +4 -0
- package/dist/types/DocAssign.js.map +1 -1
- package/dist/types/GetComponentPrefix.d.ts +3 -0
- package/dist/types/GetComponentPrefix.js +10 -0
- package/dist/types/GetComponentPrefix.js.map +1 -1
- package/dist/types/InferDetailedType.d.ts +3 -0
- package/dist/types/OfficialTypeAlias.d.ts +15 -9
- package/dist/types/OfficialTypeAlias.js +30 -0
- package/dist/types/OfficialTypeAlias.js.map +1 -1
- package/dist/types/RemoveInnerData.d.ts +3 -0
- package/dist/types/Replace.d.ts +11 -0
- package/dist/types/ReplacePrefix.d.ts +5 -0
- package/dist/types/ReplacePrefix.js +9 -0
- package/dist/types/ReplacePrefix.js.map +1 -1
- package/dist/types/RequiredKeys.d.ts +4 -0
- package/dist/types/Validators.js +7 -0
- package/dist/types/Validators.js.map +1 -1
- package/dist/utils/InnerMarker.js +1 -1
- package/dist/utils/InnerMarker.js.map +1 -1
- package/dist/utils/assertNonNullable.d.ts +2 -0
- package/dist/utils/assertNonNullable.js +7 -0
- package/dist/utils/assertNonNullable.js.map +1 -0
- package/dist/utils/deepClone.d.ts +3 -0
- package/dist/utils/deepClone.js +3 -0
- package/dist/utils/deepClone.js.map +1 -1
- package/dist/utils/isEmptyObject.d.ts +3 -0
- package/dist/utils/isEmptyObject.js +3 -0
- package/dist/utils/isEmptyObject.js.map +1 -1
- package/package.json +6 -6
- package/src/api/DefineComponent/ReturnType/ComponentDoc.ts +1 -0
- package/src/api/DefineComponent/ReturnType/test/normalComponentDoc.test.ts +2 -0
- package/src/api/DefineComponent/ReturnType/test/normalPageDoc.test.ts +3 -2
- package/src/api/DefineComponent/SubComponents/SubComponentsOption.ts +0 -5
- package/src/api/DefineComponent/SubComponents/test/normal.test.ts +2 -2
- package/src/api/DefineComponent/index.ts +21 -23
- package/src/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/computedUpdater.ts +1 -1
- package/src/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/data-tracer.ts +2 -3
- package/src/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/getPathsValue.ts +2 -1
- package/src/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/index.ts +7 -9
- package/src/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/isEqual.ts +2 -2
- package/src/api/DefineComponent/normalizeOptions/customEventsHandle.ts +34 -0
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/index.ts +26 -0
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/isPageCheck.ts +22 -0
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/loadReceivedDataHandle.ts +25 -0
- package/src/api/DefineComponent/normalizeOptions/hijackHandle/onLoadReceivedDataHandle.ts +33 -0
- package/src/api/DefineComponent/normalizeOptions/index.ts +142 -0
- package/src/api/DefineComponent/{assignOptions → normalizeOptions}/initStore/index.ts +1 -0
- package/src/api/DefineComponent/normalizeOptions/injectInfoHandler.ts +51 -0
- package/src/api/DefineComponent/normalizeOptions/internalFieldProtection.ts +26 -0
- package/src/api/DefineComponent/normalizeOptions/otherFieldsHandle.ts +27 -0
- package/src/api/DefineComponent/normalizeOptions/rootComponentOptionHandle.ts +25 -0
- package/src/api/DefineComponent/normalizeOptions/sameFuncFieldsCollect.ts +22 -0
- package/src/api/DefineComponent/normalizeOptions/sameFuncOptionsHandle.ts +37 -0
- package/src/api/DefineComponent/normalizeOptions/subComponentsOptionHandle.ts +18 -0
- package/src/api/InstanceInject/inject.ts +2 -0
- package/src/api/InstanceInject/instanceConfig.ts +2 -4
- package/src/api/InstanceInject/test/normal.test.ts +1 -0
- package/src/api/RootComponent/Computed/ComputedConstraint.ts +1 -1
- package/src/api/RootComponent/Computed/test/GetComputedDoc.test.ts +1 -0
- package/src/api/RootComponent/Computed/test/normal.test.ts +2 -0
- package/src/api/RootComponent/CustomEvents/test/GetCustomEventDoc.test.ts +2 -2
- package/src/api/RootComponent/CustomEvents/test/GetFullEventDoc.test.ts +2 -1
- package/src/api/RootComponent/CustomEvents/test/GetShortEventDoc.test.ts +2 -1
- package/src/api/RootComponent/CustomEvents/test/error.test.ts +2 -2
- package/src/api/RootComponent/CustomEvents/test/normal.test.ts +2 -0
- package/src/api/RootComponent/Data/test/GetDataDoc.test.ts +2 -2
- package/src/api/RootComponent/Data/test/normal.test.ts +3 -2
- package/src/api/RootComponent/Events/EventsConstraint.ts +1 -1
- package/src/api/RootComponent/Events/test/normal.test.ts +5 -2
- package/src/api/RootComponent/Instance/RootComponentInstance.ts +9 -0
- package/src/api/RootComponent/Instance/test/CustomEventsDoc.test.ts +1 -0
- package/src/api/RootComponent/Instance/test/customEvents/normal.test.ts +1 -0
- package/src/api/RootComponent/Instance/test/methods/mormal.test.ts +2 -2
- package/src/api/RootComponent/Instance/test/properties/mormal.test.ts +2 -0
- package/src/api/RootComponent/Instance/test/setData/error.test.ts +1 -1
- package/src/api/RootComponent/Instance/test/setData/normal.test.ts +1 -1
- package/src/api/RootComponent/IsPage/test/normal.test.ts +2 -0
- package/src/api/RootComponent/Lifetimes/LifetimesConstraint.ts +2 -2
- package/src/api/RootComponent/Lifetimes/test/error.test.ts +22 -8
- package/src/api/RootComponent/Lifetimes/test/normal.test.ts +8 -3
- package/src/api/RootComponent/Methods/test/error.test.ts +4 -4
- package/src/api/RootComponent/Methods/test/mormal.test.ts +2 -2
- package/src/api/RootComponent/Observers/test/normal.test.ts +8 -4
- package/src/api/RootComponent/PageLifetimes/test/error.test.ts +17 -7
- package/src/api/RootComponent/PageLifetimes/test/normal.test.ts +12 -5
- package/src/api/RootComponent/Properties/test/normalEmpty.test.ts +6 -6
- package/src/api/RootComponent/Properties/test/normalOptional.test.ts +4 -4
- package/src/api/RootComponent/Properties/test/normalRequired.test.ts +3 -3
- package/src/api/RootComponent/Store/test/normal.test.ts +4 -4
- package/src/api/RootComponent/Watch/test/WatchComputed.test.ts +6 -4
- package/src/api/RootComponent/Watch/test/WatchData.test.ts +16 -12
- package/src/api/RootComponent/Watch/test/WatchProperties.test.ts +58 -40
- package/src/api/RootComponent/Watch/test/WtachInject.test.ts +3 -2
- package/src/api/RootComponent/Watch/test/error.test.ts +4 -2
- package/src/api/RootComponent/index.ts +47 -48
- package/src/api/SubComponent/SubComputed/test/error.test.ts +6 -2
- package/src/api/SubComponent/SubComputed/test/normal.test.ts +8 -7
- package/src/api/SubComponent/SubData/test/normal.test.ts +2 -2
- package/src/api/SubComponent/SubEvents/test/error.test.ts +4 -2
- package/src/api/SubComponent/SubEvents/test/normal.test.ts +4 -2
- package/src/api/SubComponent/SubInherit/SubInheritOption.ts +1 -3
- package/src/api/SubComponent/SubInherit/test/error.test.ts +2 -2
- package/src/api/SubComponent/SubInstance/test/error.test.ts +1 -1
- package/src/api/SubComponent/SubInstance/test/normal.test.ts +10 -6
- package/src/api/SubComponent/SubMethods/SubMethodsConstraint.ts +1 -3
- package/src/api/SubComponent/SubMethods/test/error.test.ts +8 -2
- package/src/api/SubComponent/SubMethods/test/normarl.test.ts +6 -2
- package/src/api/SubComponent/SubReturnType/test/error.test.ts +2 -2
- package/src/api/SubComponent/SubReturnType/test/normal.test.ts +2 -2
- package/src/api/SubComponent/SubWatch/test/WatchComputed.test.ts +21 -14
- package/src/api/SubComponent/SubWatch/test/WatchProperties.test.ts +58 -58
- package/src/api/SubComponent/SubWatch/test/WatchRootData.test.ts +43 -31
- package/src/api/SubComponent/SubWatch/test/WatchSubData.test.ts +9 -6
- package/src/api/SubComponent/SubWatch/test/WtachInject.test.ts +3 -2
- package/src/api/SubComponent/SubWatch/test/error.test.ts +5 -4
- package/src/api/SubComponent/index.ts +92 -95
- package/src/api/navigateTo.ts +1 -1
- package/src/behaviors/BStore.ts +7 -3
- package/src/behaviors/BbeforeCreated.ts +8 -3
- package/src/index.ts +2 -2
- package/src/thirdLib/vant/Button.ts +2 -2
- package/src/thirdLib/vant/NoticeBar.ts +2 -2
- package/src/thirdLib/vant/Popup.ts +2 -2
- package/src/thirdLib/wm/Textarea.ts +2 -2
- package/src/thirdLib/wm/baseEvents.ts +3 -2
- package/src/thirdLib/wm/scrollView.ts +4 -2
- package/src/thirdLib/wm/swiper.ts +10 -5
- package/src/thirdLib/wm/view.ts +4 -2
- package/src/types/{GenerateDoc.ts → CreateComponentType.ts} +3 -6
- package/src/types/DetailedType.ts +1 -1
- package/src/types/InferDetailedType.test.ts +8 -13
- package/src/types/OfficialTypeAlias.ts +31 -31
- package/src/utils/assertNonNullable.ts +11 -0
- package/src/utils/isEmptyObject.ts +1 -1
- package/tsconfig.json +11 -16
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/computedUpdater.js.map +0 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/data-tracer.js.map +0 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/dependencesOptimize.js.map +0 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/getPathsValue.d.ts +0 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/getPathsValue.js +0 -19
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/getPathsValue.js.map +0 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/getPropertiesValue.js.map +0 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/index.js.map +0 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/initComputedAndGetCache.js.map +0 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/isEqual.d.ts +0 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/isEqual.js +0 -48
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/isEqual.js.map +0 -1
- package/dist/api/DefineComponent/assignOptions/index.js +0 -203
- package/dist/api/DefineComponent/assignOptions/index.js.map +0 -1
- package/dist/api/DefineComponent/assignOptions/initStore/index.js.map +0 -1
- package/dist/types/CreateComponentDoc.d.ts +0 -10
- package/dist/types/CreateComponentDoc.js +0 -2
- package/dist/types/CreateComponentDoc.js.map +0 -1
- package/dist/types/GenerateDoc.js +0 -2
- package/dist/types/GenerateDoc.js.map +0 -1
- package/src/api/DefineComponent/assignOptions/index.ts +0 -469
- package/src/types/CreateComponentDoc.ts +0 -17
- /package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/dependencesOptimize.d.ts +0 -0
- /package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/getPropertiesValue.d.ts +0 -0
- /package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/index.d.ts +0 -0
- /package/dist/api/DefineComponent/{assignOptions → normalizeOptions}/initStore/index.d.ts +0 -0
- /package/src/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/dependencesOptimize.ts +0 -0
- /package/src/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/getPropertiesValue.ts +0 -0
- /package/src/api/DefineComponent/{assignOptions → normalizeOptions}/computedWatchHandle/initComputedAndGetCache.ts +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Checking, type Test } from "hry-types";
|
|
2
|
-
|
|
3
2
|
import { type DetailedType, RootComponent, SubComponent } from "../../../..";
|
|
4
3
|
import type { OptionalType } from "../../../RootComponent/Properties/PropertiesConstraint";
|
|
5
4
|
import {
|
|
@@ -41,6 +40,7 @@ const rootComponent = RootComponent()({
|
|
|
41
40
|
});
|
|
42
41
|
|
|
43
42
|
type Root = typeof rootComponent;
|
|
43
|
+
void rootComponent;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* watch properties字段 深度只读, 必传对象字段newValue去除null
|
|
@@ -49,103 +49,103 @@ SubComponent<Root, { properties: { aaa_num: number } }>()({
|
|
|
49
49
|
watch: {
|
|
50
50
|
// 必传单一字段
|
|
51
51
|
str(newValue, oldValue) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Checking<string, typeof oldValue, Test.Pass>;
|
|
52
|
+
void oldValue;
|
|
53
|
+
void Checking<string, typeof newValue, Test.Pass>;
|
|
54
|
+
void Checking<string, typeof oldValue, Test.Pass>;
|
|
55
55
|
},
|
|
56
56
|
num(newValue, oldValue) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Checking<number, typeof oldValue, Test.Pass>;
|
|
57
|
+
void oldValue;
|
|
58
|
+
void Checking<number, typeof newValue, Test.Pass>;
|
|
59
|
+
void Checking<number, typeof oldValue, Test.Pass>;
|
|
60
60
|
},
|
|
61
61
|
bool(newValue, oldValue) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Checking<boolean, typeof oldValue, Test.Pass>;
|
|
62
|
+
void oldValue;
|
|
63
|
+
void Checking<boolean, typeof newValue, Test.Pass>;
|
|
64
|
+
void Checking<boolean, typeof oldValue, Test.Pass>;
|
|
65
65
|
},
|
|
66
66
|
|
|
67
67
|
obj(newValue, oldValue) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
Checking<object | null, typeof oldValue, Test.Pass>;
|
|
68
|
+
void oldValue;
|
|
69
|
+
void Checking<object, typeof newValue, Test.Pass>;
|
|
70
|
+
void Checking<object | null, typeof oldValue, Test.Pass>;
|
|
71
71
|
},
|
|
72
72
|
tuple(newValue, oldValue) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Checking<[string, number, boolean], typeof oldValue, Test.Pass>;
|
|
73
|
+
void oldValue;
|
|
74
|
+
void Checking<[string, number, boolean], typeof newValue, Test.Pass>;
|
|
75
|
+
void Checking<[string, number, boolean], typeof oldValue, Test.Pass>;
|
|
76
76
|
},
|
|
77
77
|
union_str(newValue, oldValue) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
Checking<"male" | "female", typeof oldValue, Test.Pass>;
|
|
78
|
+
void oldValue;
|
|
79
|
+
void Checking<"male" | "female", typeof newValue, Test.Pass>;
|
|
80
|
+
void Checking<"male" | "female", typeof oldValue, Test.Pass>;
|
|
81
81
|
},
|
|
82
82
|
union_num(newValue, oldValue) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Checking<0 | 1 | 2, typeof oldValue, Test.Pass>;
|
|
83
|
+
void oldValue;
|
|
84
|
+
void Checking<0 | 1 | 2, typeof newValue, Test.Pass>;
|
|
85
|
+
void Checking<0 | 1 | 2, typeof oldValue, Test.Pass>;
|
|
86
86
|
},
|
|
87
87
|
union_bool(newValue, oldValue) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
Checking<false | true, typeof oldValue, Test.Pass>;
|
|
88
|
+
void oldValue;
|
|
89
|
+
void Checking<false | true, typeof newValue, Test.Pass>;
|
|
90
|
+
void Checking<false | true, typeof oldValue, Test.Pass>;
|
|
91
91
|
},
|
|
92
92
|
union_arr(newValue, oldValue) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
Checking<number[] | string[], typeof oldValue, Test.Pass>;
|
|
93
|
+
void oldValue;
|
|
94
|
+
void Checking<number[] | string[], typeof newValue, Test.Pass>;
|
|
95
|
+
void Checking<number[] | string[], typeof oldValue, Test.Pass>;
|
|
96
96
|
},
|
|
97
97
|
union_obj(newValue, oldValue) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Checking<Mock_User | Mock_Cart | null, typeof oldValue, Test.Pass>;
|
|
98
|
+
void oldValue;
|
|
99
|
+
void Checking<Mock_User | Mock_Cart, typeof newValue, Test.Pass>;
|
|
100
|
+
void Checking<Mock_User | Mock_Cart | null, typeof oldValue, Test.Pass>;
|
|
101
101
|
},
|
|
102
102
|
// 必传多类型联合
|
|
103
103
|
union_str_num_bool(newValue, oldValue) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
Checking<string | number | boolean, typeof oldValue, Test.Pass>;
|
|
104
|
+
void oldValue;
|
|
105
|
+
void Checking<string | number | boolean, typeof newValue, Test.Pass>;
|
|
106
|
+
void Checking<string | number | boolean, typeof oldValue, Test.Pass>;
|
|
107
107
|
},
|
|
108
108
|
union_literalStr_Literalnum(newValue, oldValue) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
Checking<0 | 1 | 2 | "male" | "female", typeof oldValue, Test.Pass>;
|
|
109
|
+
void oldValue;
|
|
110
|
+
void Checking<0 | 1 | 2 | "male" | "female", typeof newValue, Test.Pass>;
|
|
111
|
+
void Checking<0 | 1 | 2 | "male" | "female", typeof oldValue, Test.Pass>;
|
|
112
112
|
},
|
|
113
113
|
union_mockUser_num(newValue, oldValue) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
Checking<number | Mock_User | null, typeof oldValue, Test.Pass>;
|
|
114
|
+
void oldValue;
|
|
115
|
+
void Checking<number | Mock_User, typeof newValue, Test.Pass>;
|
|
116
|
+
void Checking<number | Mock_User | null, typeof oldValue, Test.Pass>;
|
|
117
117
|
},
|
|
118
118
|
// 可选字段
|
|
119
119
|
optional_gender(newValue, oldValue) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Checking<"male" | "female", typeof oldValue, Test.Pass>;
|
|
120
|
+
void oldValue;
|
|
121
|
+
void Checking<"male" | "female", typeof newValue, Test.Pass>;
|
|
122
|
+
void Checking<"male" | "female", typeof oldValue, Test.Pass>;
|
|
123
123
|
},
|
|
124
124
|
optional_num(newValue, oldValue) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Checking<number, typeof oldValue, Test.Pass>;
|
|
125
|
+
void oldValue;
|
|
126
|
+
void Checking<number, typeof newValue, Test.Pass>;
|
|
127
|
+
void Checking<number, typeof oldValue, Test.Pass>;
|
|
128
128
|
},
|
|
129
129
|
optional_obj(newValue, oldValue) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
Checking<Mock_User | null, typeof oldValue, Test.Pass>;
|
|
130
|
+
void oldValue;
|
|
131
|
+
void Checking<Mock_User, typeof newValue, Test.Pass>;
|
|
132
|
+
void Checking<Mock_User | null, typeof oldValue, Test.Pass>;
|
|
133
133
|
},
|
|
134
134
|
// 对象的二段key
|
|
135
135
|
"optional_obj.age"(newValue, oldValue) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
Checking<number | undefined, typeof oldValue, Test.Pass>;
|
|
136
|
+
void oldValue;
|
|
137
|
+
void Checking<number, typeof newValue, Test.Pass>;
|
|
138
|
+
void Checking<number | undefined, typeof oldValue, Test.Pass>;
|
|
139
139
|
},
|
|
140
140
|
"optional_obj.**"(newValue, oldValue) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
Checking<Mock_User | null, typeof oldValue, Test.Pass>;
|
|
141
|
+
void oldValue;
|
|
142
|
+
void Checking<Mock_User, typeof newValue, Test.Pass>;
|
|
143
|
+
void Checking<Mock_User | null, typeof oldValue, Test.Pass>;
|
|
144
144
|
},
|
|
145
145
|
"optional_obj.id"(newValue, oldValue) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
Checking<string, typeof oldValue, Test.Pass>;
|
|
146
|
+
void oldValue;
|
|
147
|
+
void Checking<string, typeof newValue, Test.Pass>;
|
|
148
|
+
void Checking<string, typeof oldValue, Test.Pass>;
|
|
149
149
|
},
|
|
150
150
|
},
|
|
151
151
|
});
|
|
@@ -5,9 +5,9 @@ import type { ComponentDoc } from "../../../DefineComponent/ReturnType/Component
|
|
|
5
5
|
import type { Mock_User } from "../../../RootComponent/Properties/test/normalRequired.test";
|
|
6
6
|
import { SubComponent } from "../..";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface TestObj {
|
|
9
9
|
subObj: Mock_User;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
|
|
12
12
|
type CompDoc = ComponentDoc<{
|
|
13
13
|
properties: {
|
|
@@ -16,7 +16,7 @@ type CompDoc = ComponentDoc<{
|
|
|
16
16
|
};
|
|
17
17
|
}>;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
interface RootDoc {
|
|
20
20
|
properties: {
|
|
21
21
|
num: number;
|
|
22
22
|
literal_num: 123 | 456;
|
|
@@ -32,7 +32,7 @@ type RootDoc = {
|
|
|
32
32
|
computed: {
|
|
33
33
|
Cuinon: string | boolean;
|
|
34
34
|
};
|
|
35
|
-
}
|
|
35
|
+
}
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* watch RootDoc中的数据字段
|
|
@@ -50,74 +50,86 @@ SubComponent<RootDoc, CompDoc>()({
|
|
|
50
50
|
// properties 字段
|
|
51
51
|
|
|
52
52
|
num(newValue, oldValue) {
|
|
53
|
-
|
|
53
|
+
void oldValue;
|
|
54
|
+
void Checking<number, typeof newValue, Test.Pass>;
|
|
54
55
|
|
|
55
|
-
Checking<number, typeof oldValue, Test.Pass>;
|
|
56
|
+
void Checking<number, typeof oldValue, Test.Pass>;
|
|
56
57
|
},
|
|
57
58
|
literal_num(newValue, oldValue) {
|
|
58
|
-
|
|
59
|
+
void oldValue;
|
|
60
|
+
void Checking<123 | 456, typeof newValue, Test.Pass>;
|
|
59
61
|
|
|
60
|
-
Checking<123 | 456, typeof oldValue, Test.Pass>;
|
|
62
|
+
void Checking<123 | 456, typeof oldValue, Test.Pass>;
|
|
61
63
|
},
|
|
62
64
|
unionStrNum(newValue, oldValue) {
|
|
63
|
-
|
|
65
|
+
void oldValue;
|
|
66
|
+
void Checking<string | number, typeof newValue, Test.Pass>;
|
|
64
67
|
|
|
65
|
-
Checking<string | number, typeof oldValue, Test.Pass>;
|
|
68
|
+
void Checking<string | number, typeof oldValue, Test.Pass>;
|
|
66
69
|
},
|
|
67
70
|
required_obj(newValue, oldValue) {
|
|
68
|
-
|
|
71
|
+
void oldValue;
|
|
72
|
+
void Checking<Mock_User, typeof newValue, Test.Pass>;
|
|
69
73
|
|
|
70
|
-
Checking<Mock_User | null, typeof oldValue, Test.Pass>;
|
|
74
|
+
void Checking<Mock_User | null, typeof oldValue, Test.Pass>;
|
|
71
75
|
},
|
|
72
76
|
optional_obj(newValue, oldValue) {
|
|
73
|
-
|
|
77
|
+
void oldValue;
|
|
78
|
+
void Checking<TestObj, typeof newValue, Test.Pass>;
|
|
74
79
|
|
|
75
|
-
Checking<TestObj, typeof oldValue, Test.Pass>;
|
|
80
|
+
void Checking<TestObj, typeof oldValue, Test.Pass>;
|
|
76
81
|
},
|
|
77
82
|
"optional_obj.**"(newValue, oldValue) {
|
|
78
|
-
|
|
83
|
+
void oldValue;
|
|
84
|
+
void Checking<TestObj, typeof newValue, Test.Pass>;
|
|
79
85
|
|
|
80
|
-
Checking<TestObj, typeof oldValue, Test.Pass>;
|
|
86
|
+
void Checking<TestObj, typeof oldValue, Test.Pass>;
|
|
81
87
|
},
|
|
82
88
|
"optional_obj.subObj"(newValue, oldValue) {
|
|
83
|
-
|
|
89
|
+
void oldValue;
|
|
90
|
+
void Checking<Mock_User, typeof newValue, Test.Pass>;
|
|
84
91
|
|
|
85
|
-
Checking<Mock_User, typeof oldValue, Test.Pass>;
|
|
92
|
+
void Checking<Mock_User, typeof oldValue, Test.Pass>;
|
|
86
93
|
},
|
|
87
94
|
"required_obj.age"(newValue, oldValue) {
|
|
88
|
-
|
|
95
|
+
void oldValue;
|
|
96
|
+
void Checking<number, typeof newValue, Test.Pass>;
|
|
89
97
|
|
|
90
|
-
Checking<number | undefined, typeof oldValue, Test.Pass>;
|
|
98
|
+
void Checking<number | undefined, typeof oldValue, Test.Pass>;
|
|
91
99
|
},
|
|
92
100
|
|
|
93
101
|
"required_obj.id"(newValue, oldValue) {
|
|
94
|
-
|
|
102
|
+
void oldValue;
|
|
103
|
+
void Checking<string, typeof newValue, Test.Pass>;
|
|
95
104
|
|
|
96
|
-
Checking<string, typeof oldValue, Test.Pass>;
|
|
105
|
+
void Checking<string, typeof oldValue, Test.Pass>;
|
|
97
106
|
},
|
|
98
107
|
|
|
99
108
|
// data 字段
|
|
100
109
|
str(newValue, oldValue) {
|
|
101
|
-
|
|
110
|
+
void oldValue;
|
|
111
|
+
void Checking<string, typeof newValue, Test.Pass>;
|
|
102
112
|
|
|
103
|
-
Checking<string, typeof oldValue, Test.Pass>;
|
|
113
|
+
void Checking<string, typeof oldValue, Test.Pass>;
|
|
104
114
|
},
|
|
105
115
|
arr(newValue, oldValue) {
|
|
106
|
-
|
|
116
|
+
void oldValue;
|
|
117
|
+
void Checking<string[], typeof newValue, Test.Pass>;
|
|
107
118
|
|
|
108
|
-
Checking<string[], typeof oldValue, Test.Pass>;
|
|
119
|
+
void Checking<string[], typeof oldValue, Test.Pass>;
|
|
109
120
|
},
|
|
110
121
|
|
|
111
122
|
literal_str(newValue, oldValue) {
|
|
112
|
-
|
|
123
|
+
void oldValue;
|
|
124
|
+
void Checking<"a" | "b", typeof newValue, Test.Pass>;
|
|
113
125
|
|
|
114
|
-
Checking<"a" | "b", typeof oldValue, Test.Pass>;
|
|
126
|
+
void Checking<"a" | "b", typeof oldValue, Test.Pass>;
|
|
115
127
|
},
|
|
116
128
|
// 计算字段
|
|
117
129
|
Cuinon(newValue, oldValue) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
Checking<string | boolean, typeof oldValue, Test.Pass>;
|
|
130
|
+
void oldValue;
|
|
131
|
+
void Checking<string | boolean, typeof newValue, Test.Pass>;
|
|
132
|
+
void Checking<string | boolean, typeof oldValue, Test.Pass>;
|
|
121
133
|
},
|
|
122
134
|
},
|
|
123
135
|
});
|
|
@@ -28,19 +28,22 @@ SubComponent<{}, CompDoc>()({
|
|
|
28
28
|
},
|
|
29
29
|
watch: {
|
|
30
30
|
aaa_str(newValue, oldValue) {
|
|
31
|
-
|
|
31
|
+
void oldValue;
|
|
32
|
+
void Checking<"123", typeof newValue, Test.Pass>;
|
|
32
33
|
|
|
33
|
-
Checking<"123", typeof oldValue, Test.Pass>;
|
|
34
|
+
void Checking<"123", typeof oldValue, Test.Pass>;
|
|
34
35
|
},
|
|
35
36
|
aaa_num(newValue, oldValue) {
|
|
36
|
-
|
|
37
|
+
void oldValue;
|
|
38
|
+
void Checking<number, typeof newValue, Test.Pass>;
|
|
37
39
|
|
|
38
|
-
Checking<number, typeof oldValue, Test.Pass>;
|
|
40
|
+
void Checking<number, typeof oldValue, Test.Pass>;
|
|
39
41
|
},
|
|
40
42
|
_aaa_other(newValue, oldValue) {
|
|
41
|
-
|
|
43
|
+
void oldValue;
|
|
44
|
+
void Checking<number, typeof newValue, Test.Pass>;
|
|
42
45
|
|
|
43
|
-
Checking<number, typeof oldValue, Test.Pass>;
|
|
46
|
+
void Checking<number, typeof oldValue, Test.Pass>;
|
|
44
47
|
},
|
|
45
48
|
},
|
|
46
49
|
});
|
|
@@ -7,9 +7,10 @@ import { SubComponent } from "../..";
|
|
|
7
7
|
SubComponent<{}, { properties: { aaa_num: number } }>()({
|
|
8
8
|
watch: {
|
|
9
9
|
injectTheme(newValue, oldValue) {
|
|
10
|
-
Checking<"dark" | "light" | undefined, typeof newValue, Test.Pass>;
|
|
10
|
+
void Checking<"dark" | "light" | undefined, typeof newValue, Test.Pass>;
|
|
11
11
|
|
|
12
|
-
Checking<"dark" | "light" | undefined, typeof oldValue, Test.Pass>;
|
|
12
|
+
void Checking<"dark" | "light" | undefined, typeof oldValue, Test.Pass>;
|
|
13
|
+
void oldValue;
|
|
13
14
|
},
|
|
14
15
|
},
|
|
15
16
|
});
|
|
@@ -5,7 +5,9 @@ import { SubComponent } from "../..";
|
|
|
5
5
|
SubComponent<{ events: { a: string } }, Wm.View>()({
|
|
6
6
|
watch: {
|
|
7
7
|
// @ts-expect-error 无可监控字段时,约束为EmptyObject,不可写任何字段
|
|
8
|
-
nothing() {
|
|
8
|
+
nothing() {
|
|
9
|
+
void 0;
|
|
10
|
+
},
|
|
9
11
|
},
|
|
10
12
|
});
|
|
11
13
|
|
|
@@ -18,12 +20,11 @@ SubComponent<{ events: { a: string } }, Wm.View>()({
|
|
|
18
20
|
},
|
|
19
21
|
watch: {
|
|
20
22
|
view_hoverClass(newValue, oldValue) { // ok
|
|
21
|
-
newValue;
|
|
22
|
-
|
|
23
|
-
oldValue;
|
|
23
|
+
console.log(newValue, oldValue);
|
|
24
24
|
},
|
|
25
25
|
// @ts-expect-error 超出约束字段错误
|
|
26
26
|
view_xxxhoverClass() {
|
|
27
|
+
// do something
|
|
27
28
|
},
|
|
28
29
|
},
|
|
29
30
|
});
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
2
2
|
import type { EmptyObject } from "hry-types/src/Misc/EmptyObject";
|
|
3
|
+
import type { Func } from "hry-types/src/Misc/Func";
|
|
3
4
|
import type { RequiredKeys } from "hry-types/src/Object/RequiredKeys";
|
|
4
5
|
import type { GetComponentPrefix } from "../../types/GetComponentPrefix";
|
|
5
|
-
import type { ReplacePrefix } from "../../types/ReplacePrefix";
|
|
6
|
-
import type { ComponentDoc } from "../DefineComponent/ReturnType/ComponentDoc";
|
|
7
|
-
|
|
8
|
-
import type { Func } from "hry-types/src/Misc/Func";
|
|
9
|
-
|
|
10
6
|
import type { InnerFields } from "../../types/InnerData";
|
|
11
7
|
import type { WMCompOtherOption } from "../../types/OfficialTypeAlias";
|
|
12
8
|
import type { Replace } from "../../types/Replace";
|
|
9
|
+
import type { ReplacePrefix } from "../../types/ReplacePrefix";
|
|
10
|
+
import type { ComponentDoc } from "../DefineComponent/ReturnType/ComponentDoc";
|
|
13
11
|
import type { IInjectStore } from "../InstanceInject/instanceConfig";
|
|
14
12
|
import type { ComputedConstraint } from "../RootComponent/Computed/ComputedConstraint";
|
|
15
13
|
import type { DataConstraint } from "../RootComponent/Data/DataConstraint";
|
|
@@ -126,106 +124,104 @@ type SubComponentConstructor<
|
|
|
126
124
|
& TRootDoc["data"]
|
|
127
125
|
& TRootDoc["computed"]
|
|
128
126
|
& TRootDoc["store"],
|
|
129
|
-
> =
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
> = <
|
|
128
|
+
TInherit extends InheritConstraint<AllRootDataDoc, CurrentCompDoc>,
|
|
129
|
+
TSubData extends SubDataConstraint<
|
|
130
|
+
& Omit<Required<CurrentCompDoc["properties"]>, keyof InheritDoc>
|
|
131
|
+
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
132
|
+
>,
|
|
133
|
+
TSubStore extends SubStoreConstraint<
|
|
134
|
+
& Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc)>
|
|
135
|
+
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
136
|
+
>,
|
|
137
|
+
TEvents extends SubEventsConstraint<CurrentCompDoc>,
|
|
138
|
+
// 加默认值计算字段无提示且需要手写返回类型,不加watch无法对computed监控
|
|
139
|
+
TSubComputed extends SubComputedConstraint<
|
|
140
|
+
& Omit<
|
|
141
|
+
Required<CurrentCompDoc["properties"]>,
|
|
142
|
+
keyof (InheritDoc & SubDataDoc & SubStoreDoc)
|
|
143
|
+
>
|
|
144
|
+
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
145
|
+
>,
|
|
146
|
+
TSubMethods extends SubMethodsConstraint = {},
|
|
147
|
+
InheritDoc extends object = IfExtends<InheritConstraint<AllRootDataDoc, CurrentCompDoc>, TInherit, {}, TInherit>,
|
|
148
|
+
SubDataDoc extends object = IfExtends<
|
|
149
|
+
SubDataConstraint<
|
|
133
150
|
& Omit<Required<CurrentCompDoc["properties"]>, keyof InheritDoc>
|
|
134
|
-
& Record<InnerFields<CurrentPrefix>, unknown>
|
|
151
|
+
& Record<InnerFields<CurrentPrefix>, unknown>
|
|
135
152
|
>,
|
|
136
|
-
|
|
153
|
+
TSubData,
|
|
154
|
+
{},
|
|
155
|
+
TSubData
|
|
156
|
+
>,
|
|
157
|
+
SubStoreDoc extends object = IfExtends<
|
|
158
|
+
SubStoreConstraint<
|
|
137
159
|
& Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc)>
|
|
138
|
-
& Record<InnerFields<CurrentPrefix>, unknown>
|
|
160
|
+
& Record<InnerFields<CurrentPrefix>, unknown>
|
|
139
161
|
>,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
162
|
+
TSubStore,
|
|
163
|
+
{},
|
|
164
|
+
{ [k in keyof TSubStore]: ReturnType<NonNullable<TSubStore[k]>> }
|
|
165
|
+
>,
|
|
166
|
+
// 无效的计算
|
|
167
|
+
SubComputedDoc extends object = IfExtends<
|
|
168
|
+
SubComputedConstraint<
|
|
143
169
|
& Omit<
|
|
144
170
|
Required<CurrentCompDoc["properties"]>,
|
|
145
171
|
keyof (InheritDoc & SubDataDoc & SubStoreDoc)
|
|
146
172
|
>
|
|
147
173
|
& Record<InnerFields<CurrentPrefix>, unknown> // 内部字段
|
|
148
174
|
>,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc & SubStoreDoc)>
|
|
200
|
-
>,
|
|
201
|
-
TSubComputed,
|
|
202
|
-
{},
|
|
203
|
-
GetSubComputedDoc<TSubComputed>
|
|
204
|
-
>
|
|
205
|
-
)
|
|
206
|
-
>,
|
|
207
|
-
>(
|
|
208
|
-
options: Options<
|
|
209
|
-
TRootDoc,
|
|
210
|
-
IsPage,
|
|
211
|
-
CurrentCompDoc,
|
|
212
|
-
CurrentPrefix,
|
|
213
|
-
AllRootDataDoc,
|
|
214
|
-
TInherit,
|
|
215
|
-
TSubData,
|
|
216
|
-
TSubStore,
|
|
217
|
-
TSubComputed,
|
|
218
|
-
TEvents,
|
|
219
|
-
TSubMethods,
|
|
220
|
-
InheritDoc,
|
|
221
|
-
SubDataDoc,
|
|
222
|
-
SubStoreDoc,
|
|
223
|
-
SubComputedDoc,
|
|
224
|
-
SubEventsDoc,
|
|
225
|
-
SubMethodsDoc
|
|
226
|
-
>,
|
|
227
|
-
): CreateSubComponentDoc<NonNullable<TOriginalCompDoc["customEvents"]>, SubEventsDoc, MissingRequiredField>;
|
|
228
|
-
};
|
|
175
|
+
TSubComputed,
|
|
176
|
+
{},
|
|
177
|
+
GetSubComputedDoc<TSubComputed>
|
|
178
|
+
>,
|
|
179
|
+
SubEventsDoc extends object = IfExtends<
|
|
180
|
+
SubEventsConstraint<CurrentCompDoc>,
|
|
181
|
+
TEvents,
|
|
182
|
+
{},
|
|
183
|
+
TEvents
|
|
184
|
+
>,
|
|
185
|
+
SubMethodsDoc extends object = TSubMethods,
|
|
186
|
+
// 缺失的必传字段(配置中inhrit,data,computed的字段不包含的必传字段)
|
|
187
|
+
MissingRequiredField extends PropertyKey = Exclude<
|
|
188
|
+
RequiredKeys<NonNullable<CurrentCompDoc["properties"]>>,
|
|
189
|
+
keyof (
|
|
190
|
+
& InheritDoc
|
|
191
|
+
& SubDataDoc
|
|
192
|
+
& SubStoreDoc
|
|
193
|
+
// 改用SubComputedDoc是会报错的
|
|
194
|
+
& IfExtends<
|
|
195
|
+
SubComputedConstraint<
|
|
196
|
+
Omit<Required<CurrentCompDoc["properties"]>, keyof (InheritDoc & SubDataDoc & SubStoreDoc)>
|
|
197
|
+
>,
|
|
198
|
+
TSubComputed,
|
|
199
|
+
{},
|
|
200
|
+
GetSubComputedDoc<TSubComputed>
|
|
201
|
+
>
|
|
202
|
+
)
|
|
203
|
+
>,
|
|
204
|
+
>(
|
|
205
|
+
options: Options<
|
|
206
|
+
TRootDoc,
|
|
207
|
+
IsPage,
|
|
208
|
+
CurrentCompDoc,
|
|
209
|
+
CurrentPrefix,
|
|
210
|
+
AllRootDataDoc,
|
|
211
|
+
TInherit,
|
|
212
|
+
TSubData,
|
|
213
|
+
TSubStore,
|
|
214
|
+
TSubComputed,
|
|
215
|
+
TEvents,
|
|
216
|
+
TSubMethods,
|
|
217
|
+
InheritDoc,
|
|
218
|
+
SubDataDoc,
|
|
219
|
+
SubStoreDoc,
|
|
220
|
+
SubComputedDoc,
|
|
221
|
+
SubEventsDoc,
|
|
222
|
+
SubMethodsDoc
|
|
223
|
+
>,
|
|
224
|
+
) => CreateSubComponentDoc<NonNullable<TOriginalCompDoc["customEvents"]>, SubEventsDoc, MissingRequiredField>;
|
|
229
225
|
|
|
230
226
|
/**
|
|
231
227
|
* 子组件构建函数
|
|
@@ -236,6 +232,7 @@ export function SubComponent<
|
|
|
236
232
|
CompDoc extends ComponentDoc,
|
|
237
233
|
Prefix extends string = "",
|
|
238
234
|
>(): IfExtends<EmptyObject, CompDoc, (opt: EmptyObject) => never, SubComponentConstructor<RootDoc, CompDoc, Prefix>> {
|
|
235
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
239
236
|
return ((options: any) => options as SubComponentTrueOptions) as any;
|
|
240
237
|
}
|
|
241
238
|
|
package/src/api/navigateTo.ts
CHANGED
package/src/behaviors/BStore.ts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import type mobx from "mobx";
|
|
2
|
-
import type { Instance } from "../api/
|
|
2
|
+
import type { Instance } from "../api/RootComponent/Instance/RootComponentInstance";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* 在created生命周期中,初始化 store数据(__storeConfig__)到data中
|
|
6
|
+
* 在detached生命周期中,清除store数据
|
|
7
|
+
*/
|
|
4
8
|
export const BStore = Behavior({
|
|
5
9
|
lifetimes: {
|
|
6
10
|
created(this: Instance) {
|
|
7
11
|
const storeConfig = this.data.__storeConfig__;
|
|
8
12
|
if (!storeConfig) return;
|
|
9
13
|
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
10
15
|
const { comparer, reaction, toJS } = require("mobx") as typeof mobx;
|
|
11
|
-
|
|
16
|
+
// 存储reaction的disposer 需要冲突字段验证
|
|
12
17
|
this.disposer = {};
|
|
13
|
-
|
|
14
18
|
for (const key in storeConfig) {
|
|
15
19
|
// 添加响应式逻辑
|
|
16
20
|
this.disposer[key] = reaction(
|