annil 1.7.3 → 1.7.5-beta-3
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 +19 -7
- 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 +16 -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 +6 -4
- 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 -1
- 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/SubComputed/GetSubComputedDoc.d.ts +0 -1
- 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 -1
- 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/index.js +1 -2
- package/dist/thirdLib/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 -13
- 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 +7 -7
- 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 +12 -17
- 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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Func } from "hry-types/src/Misc/_api";
|
|
2
|
+
import { isEmptyObject } from "../../../utils/isEmptyObject";
|
|
3
|
+
import type { FinalOptionsOfComponent, SameFuncOptions } from ".";
|
|
4
|
+
/**
|
|
5
|
+
* 把函数配置放入一个配置中依次运行
|
|
6
|
+
*/
|
|
7
|
+
function _sameFuncOptionsHandle(config: object, configList: Record<string, Func[]>) {
|
|
8
|
+
for (const key in configList) {
|
|
9
|
+
// @ts-ignore 隐式索引
|
|
10
|
+
config[key] = function(...args: unknown[]) {
|
|
11
|
+
configList[key].forEach(ele => ele.call(this, ...args));
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 把函数列表配置放入一个配置中循环依次运行
|
|
17
|
+
*/
|
|
18
|
+
export function sameFuncOptionsHandle(
|
|
19
|
+
finalOptionsForComponent: FinalOptionsOfComponent,
|
|
20
|
+
isPage: boolean | undefined,
|
|
21
|
+
funcOptions: SameFuncOptions,
|
|
22
|
+
) {
|
|
23
|
+
if (isPage) {
|
|
24
|
+
// 页面时 生命周期方法(即 on 开头的方法),(https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/component.html)
|
|
25
|
+
if (!isEmptyObject(funcOptions.pageLifetimes)) {
|
|
26
|
+
_sameFuncOptionsHandle(finalOptionsForComponent.methods, funcOptions.pageLifetimes);
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
// 组件时
|
|
30
|
+
if (!isEmptyObject(funcOptions.pageLifetimes)) {
|
|
31
|
+
_sameFuncOptionsHandle(finalOptionsForComponent.pageLifetimes, funcOptions.pageLifetimes);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (funcOptions.lifetimes) _sameFuncOptionsHandle(finalOptionsForComponent.lifetimes ||= {}, funcOptions.lifetimes);
|
|
35
|
+
|
|
36
|
+
if (funcOptions.watch) _sameFuncOptionsHandle(finalOptionsForComponent.watch ||= {}, funcOptions.watch);
|
|
37
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SubComponentTrueOptions } from "../../SubComponent";
|
|
2
|
+
import type { FinalOptionsOfComponent, SameFuncOptions } from ".";
|
|
3
|
+
import { otherFieldsHandle } from "./otherFieldsHandle";
|
|
4
|
+
import { sameFuncFieldsCollect } from "./sameFuncFieldsCollect";
|
|
5
|
+
|
|
6
|
+
export function subComponentsOptionHandle(
|
|
7
|
+
componentOptions: FinalOptionsOfComponent,
|
|
8
|
+
subComponents: SubComponentTrueOptions[],
|
|
9
|
+
funcOptions: SameFuncOptions,
|
|
10
|
+
) {
|
|
11
|
+
subComponents.forEach((subOption) => {
|
|
12
|
+
if (subOption.events) Object.assign(componentOptions.methods, subOption.events);
|
|
13
|
+
|
|
14
|
+
sameFuncFieldsCollect(subOption, funcOptions);
|
|
15
|
+
|
|
16
|
+
otherFieldsHandle(componentOptions, subOption);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1
2
|
import { observable, runInAction } from "mobx";
|
|
2
3
|
|
|
3
4
|
// 注入的响应式数据;
|
|
@@ -27,6 +28,7 @@ const store = {
|
|
|
27
28
|
// 声明注入类型 js开发可以忽略
|
|
28
29
|
declare module "../.." {
|
|
29
30
|
interface IInjectInfo {
|
|
31
|
+
[key: string]: unknown;
|
|
30
32
|
data: typeof data;
|
|
31
33
|
store: typeof store;
|
|
32
34
|
methods: typeof methods;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
|
2
|
-
|
|
3
1
|
import type { IfEquals } from "hry-types/src/Any/IfEquals";
|
|
4
2
|
import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
|
|
5
3
|
import type { ReturnTypeInObject } from "hry-types/src/Object/ReturnTypeInObject";
|
|
@@ -10,6 +8,7 @@ import type { StoreConstraint } from "../RootComponent/Store/StoreConstraint";
|
|
|
10
8
|
|
|
11
9
|
// 利用继承的多态性 使得IInjectInfo类型可由使用者外部定义
|
|
12
10
|
interface BaseInjectInfo {
|
|
11
|
+
[key: string]: unknown;
|
|
13
12
|
options?: WMComponentOption;
|
|
14
13
|
methods?: MethodsConstraint;
|
|
15
14
|
data?: DataConstraint;
|
|
@@ -17,7 +16,6 @@ interface BaseInjectInfo {
|
|
|
17
16
|
behaviors?: string[];
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
21
19
|
export interface IInjectInfo extends BaseInjectInfo {
|
|
22
20
|
}
|
|
23
21
|
|
|
@@ -44,7 +42,7 @@ class InstanceConfig {
|
|
|
44
42
|
return this.info.injectInfo;
|
|
45
43
|
}
|
|
46
44
|
public setInjectInfo(info: IInjectInfo | undefined) {
|
|
47
|
-
info
|
|
45
|
+
if (info) this.info.injectInfo = info;
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1
3
|
import { Checking, type Test } from "hry-types";
|
|
2
4
|
import type { ComputeIntersection } from "hry-types/src/Object/_api";
|
|
3
5
|
import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
type StrExpected,
|
|
17
17
|
type UnionStrExpected,
|
|
18
18
|
} from "./GetShortEventDoc.test";
|
|
19
|
-
import { mock_customEvents } from "./normal.test";
|
|
19
|
+
import { type mock_customEvents } from "./normal.test";
|
|
20
20
|
|
|
21
21
|
type Mock_CustomEventsDoc = GetCustomEventDoc<typeof mock_customEvents>;
|
|
22
22
|
|
|
@@ -35,4 +35,4 @@ export type Mock_CustomEventsDocExpected = {
|
|
|
35
35
|
bubbles_capturePhase_composed: BubblesCapturePhaseComposedExpected;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
Checking<Mock_CustomEventsDoc, Mock_CustomEventsDocExpected, Test.Pass>;
|
|
38
|
+
void Checking<Mock_CustomEventsDoc, Mock_CustomEventsDocExpected, Test.Pass>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
1
2
|
import { Checking, type Test } from "hry-types";
|
|
2
3
|
import type {
|
|
3
4
|
Bubbles,
|
|
@@ -9,7 +10,7 @@ import type {
|
|
|
9
10
|
} from "../CustomEventsTag";
|
|
10
11
|
|
|
11
12
|
import type { GetFullCustomEventsDoc } from "../GetCustomEventDoc";
|
|
12
|
-
import { mock_fullCustomEvents } from "./normal.test";
|
|
13
|
+
import { type mock_fullCustomEvents } from "./normal.test";
|
|
13
14
|
|
|
14
15
|
// bubbles
|
|
15
16
|
type bubblesResult = GetFullCustomEventsDoc<typeof mock_fullCustomEvents["bubbles"]>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
1
2
|
import { Checking, type Test } from "hry-types";
|
|
2
3
|
|
|
3
4
|
import type { Mock_User } from "../../Properties/test/normalRequired.test";
|
|
4
5
|
import type { GetShortCustomEventsDoc } from "../GetCustomEventDoc";
|
|
5
|
-
import { mock_shortCustomEvents } from "./normal.test";
|
|
6
|
+
import { type mock_shortCustomEvents } from "./normal.test";
|
|
6
7
|
|
|
7
8
|
type StrResult = GetShortCustomEventsDoc<typeof mock_shortCustomEvents["str"]>;
|
|
8
9
|
|
|
@@ -38,7 +38,7 @@ RootComponent()({
|
|
|
38
38
|
RootComponent()({
|
|
39
39
|
events: {
|
|
40
40
|
aaa() {
|
|
41
|
-
|
|
41
|
+
void 0;
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
customEvents: {
|
|
@@ -85,7 +85,7 @@ RootComponent()({
|
|
|
85
85
|
RootComponent()({
|
|
86
86
|
events: {
|
|
87
87
|
aaa() {
|
|
88
|
-
|
|
88
|
+
void 0;
|
|
89
89
|
},
|
|
90
90
|
},
|
|
91
91
|
customEvents: {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
1
3
|
import { Checking, type Test } from "hry-types";
|
|
2
4
|
import { type DetailedType, RootComponent } from "../../../..";
|
|
3
5
|
import type { Mock_User } from "../../Properties/test/normalRequired.test";
|
|
@@ -22,11 +22,11 @@ type Test1Expected = {
|
|
|
22
22
|
str: string;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
Checking<Test1, Test1Expected, Test.Pass>;
|
|
25
|
+
void Checking<Test1, Test1Expected, Test.Pass>;
|
|
26
26
|
|
|
27
27
|
// 测试空对象
|
|
28
28
|
type Test4 = GetDataDoc<{}>;
|
|
29
29
|
|
|
30
30
|
type Test4Expected = {};
|
|
31
31
|
|
|
32
|
-
Checking<Test4, Test4Expected, Test.Pass>;
|
|
32
|
+
void Checking<Test4, Test4Expected, Test.Pass>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
1
2
|
import { Checking, type Test } from "hry-types";
|
|
2
3
|
import type { IInjectAllData } from "../../../InstanceInject/instanceConfig";
|
|
3
4
|
import { RootComponent } from "../..";
|
|
@@ -12,7 +13,7 @@ const EmptyDataRootDoc = RootComponent()({
|
|
|
12
13
|
},
|
|
13
14
|
},
|
|
14
15
|
});
|
|
15
|
-
|
|
16
|
+
void EmptyDataRootDoc;
|
|
16
17
|
// 3.2 data为空对象时 返回文档中无data字段
|
|
17
18
|
Checking<typeof EmptyDataRootDoc, { methods: { M1: () => void } }, Test.Pass>;
|
|
18
19
|
|
|
@@ -27,6 +28,6 @@ const noDataRootDoc = RootComponent()({
|
|
|
27
28
|
},
|
|
28
29
|
},
|
|
29
30
|
});
|
|
30
|
-
|
|
31
|
+
void noDataRootDoc;
|
|
31
32
|
// 4.2 data为空对象时 返回文档中无data字段
|
|
32
33
|
Checking<typeof noDataRootDoc, { methods: { M1: () => void } }, Test.Pass>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
1
3
|
import { Checking, type Test } from "hry-types";
|
|
2
4
|
import type {
|
|
3
5
|
CurrentTargetDataset,
|
|
@@ -8,6 +10,7 @@ import type {
|
|
|
8
10
|
WMBaseEvent,
|
|
9
11
|
WMCustomEvent,
|
|
10
12
|
} from "../../../../types/OfficialTypeAlias";
|
|
13
|
+
import { assertNonNullable } from "../../../../utils/assertNonNullable";
|
|
11
14
|
import type { ComponentDoc } from "../../../DefineComponent/ReturnType/ComponentDoc";
|
|
12
15
|
import { RootComponent } from "../..";
|
|
13
16
|
import type { Bubbles, Capture } from "../../CustomEvents/CustomEventsTag";
|
|
@@ -39,7 +42,7 @@ RootComponent()({
|
|
|
39
42
|
) {
|
|
40
43
|
Checking<typeof e.detail.detailData, string, Test.Pass>;
|
|
41
44
|
|
|
42
|
-
const markData = e.mark
|
|
45
|
+
const markData = assertNonNullable(e.mark).markData;
|
|
43
46
|
|
|
44
47
|
Checking<typeof markData, { id: string }, Test.Pass>;
|
|
45
48
|
|
|
@@ -53,7 +56,7 @@ RootComponent()({
|
|
|
53
56
|
},
|
|
54
57
|
// 2.3 通过Mark定义mark类型
|
|
55
58
|
ccc(e: Mark<{ id: string }>) {
|
|
56
|
-
const markId = e.mark
|
|
59
|
+
const markId = e.mark.id;
|
|
57
60
|
|
|
58
61
|
Checking<typeof markId, string, Test.Pass>;
|
|
59
62
|
},
|
|
@@ -2,9 +2,11 @@ import type { IfExtends } from "hry-types/src/Any/IfExtends";
|
|
|
2
2
|
import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
|
|
3
3
|
import type { IReactionDisposer } from "mobx";
|
|
4
4
|
|
|
5
|
+
import type { Func } from "hry-types/src/Misc/Func";
|
|
5
6
|
import type { Assign } from "../../../types/Assign";
|
|
6
7
|
import type { ComputeObject } from "../../../types/ComputeObj";
|
|
7
8
|
import type { WMComponentInstance, WMInstanceMethods, WMPageInstance } from "../../../types/OfficialTypeAlias";
|
|
9
|
+
import type { OptionsInnerFields } from "../../DefineComponent/normalizeOptions";
|
|
8
10
|
import type { IInjectAllData, IInjectMethods } from "../../InstanceInject/instanceConfig";
|
|
9
11
|
import type { CustomEventMethods } from "./CustomEventMethods";
|
|
10
12
|
import type { CustomSetData } from "./CustomSetData";
|
|
@@ -33,3 +35,10 @@ export type RootComponentInstance<
|
|
|
33
35
|
export type ComponentInstance = RootComponentInstance<false, {}, {}, {}, {}, {}>;
|
|
34
36
|
|
|
35
37
|
export type PageInstance = RootComponentInstance<true, {}, {}, {}, {}, {}>;
|
|
38
|
+
|
|
39
|
+
type InstanceInnerFields = {
|
|
40
|
+
data: OptionsInnerFields["data"];
|
|
41
|
+
disposer: Record<string, Func>;
|
|
42
|
+
cloneData: OptionsInnerFields["data"];
|
|
43
|
+
} & OptionsInnerFields["methods"];
|
|
44
|
+
export type Instance = (ComponentInstance | PageInstance) & InstanceInnerFields;
|
|
@@ -8,9 +8,9 @@ RootComponent()({
|
|
|
8
8
|
},
|
|
9
9
|
|
|
10
10
|
M2(str: string) {
|
|
11
|
-
Checking<typeof this.M1, () => 1, Test.Pass>;
|
|
11
|
+
void Checking<typeof this.M1, () => 1, Test.Pass>;
|
|
12
12
|
|
|
13
|
-
Checking<typeof this.M2, (str: string) => string, Test.Pass>;
|
|
13
|
+
void Checking<typeof this.M2, (str: string) => string, Test.Pass>;
|
|
14
14
|
|
|
15
15
|
return str;
|
|
16
16
|
},
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
1
3
|
import { Checking, type Test } from "hry-types";
|
|
2
4
|
import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
|
|
3
5
|
import { type DetailedType, RootComponent } from "../../../../..";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
|
|
2
2
|
import type { WMCompLifetimes } from "../../../types/OfficialTypeAlias";
|
|
3
|
-
import type { FinalOptionsOfComponent } from "../../DefineComponent/
|
|
3
|
+
import type { FinalOptionsOfComponent } from "../../DefineComponent/normalizeOptions";
|
|
4
4
|
|
|
5
5
|
export type LifetimesConstraint = // 官方组件生命周期
|
|
6
6
|
ComputeIntersection<
|
|
@@ -9,6 +9,6 @@ export type LifetimesConstraint = // 官方组件生命周期
|
|
|
9
9
|
/**
|
|
10
10
|
* 建立组件时的真正配置对象
|
|
11
11
|
*/
|
|
12
|
-
beforeCreate?: (this:
|
|
12
|
+
beforeCreate?: (this: undefined, options: FinalOptionsOfComponent) => void;
|
|
13
13
|
}
|
|
14
14
|
>;
|
|
@@ -2,16 +2,30 @@ import { RootComponent } from "../..";
|
|
|
2
2
|
|
|
3
3
|
RootComponent()({
|
|
4
4
|
lifetimes: {
|
|
5
|
-
beforeCreate() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
beforeCreate() {
|
|
6
|
+
void 0;
|
|
7
|
+
},
|
|
8
|
+
created() {
|
|
9
|
+
void 0;
|
|
10
|
+
},
|
|
11
|
+
attached() {
|
|
12
|
+
void 0;
|
|
13
|
+
},
|
|
14
|
+
ready() {
|
|
15
|
+
void 0;
|
|
16
|
+
},
|
|
17
|
+
detached() {
|
|
18
|
+
void 0;
|
|
19
|
+
},
|
|
10
20
|
error(err) {
|
|
11
|
-
err.message;
|
|
21
|
+
void err.message;
|
|
22
|
+
},
|
|
23
|
+
moved() {
|
|
24
|
+
void 0;
|
|
12
25
|
},
|
|
13
|
-
moved() {},
|
|
14
26
|
// @ts-expect-error 1 错误的生命周期字段报错
|
|
15
|
-
xxx() {
|
|
27
|
+
xxx() {
|
|
28
|
+
void 0;
|
|
29
|
+
},
|
|
16
30
|
},
|
|
17
31
|
});
|
|
@@ -8,22 +8,27 @@ RootComponent()({
|
|
|
8
8
|
lifetimes: {
|
|
9
9
|
// 新增声明周期可用于查看或拓展配置文件
|
|
10
10
|
beforeCreate(opitons) {
|
|
11
|
-
Checking<typeof this,
|
|
11
|
+
void Checking<typeof this, undefined, Test.Pass>;
|
|
12
12
|
|
|
13
|
-
opitons;
|
|
13
|
+
void opitons;
|
|
14
14
|
},
|
|
15
15
|
created() {
|
|
16
|
+
void 0;
|
|
16
17
|
},
|
|
17
18
|
attached() {
|
|
19
|
+
void 0;
|
|
18
20
|
},
|
|
19
21
|
ready() {
|
|
22
|
+
void 0;
|
|
20
23
|
},
|
|
21
24
|
detached() {
|
|
25
|
+
void 0;
|
|
22
26
|
},
|
|
23
27
|
error(err) {
|
|
24
|
-
err.message;
|
|
28
|
+
void err.message;
|
|
25
29
|
},
|
|
26
30
|
moved() {
|
|
31
|
+
void 0;
|
|
27
32
|
},
|
|
28
33
|
},
|
|
29
34
|
});
|
|
@@ -6,7 +6,7 @@ import { RootComponent } from "../..";
|
|
|
6
6
|
RootComponent()({
|
|
7
7
|
events: {
|
|
8
8
|
eventField() {
|
|
9
|
-
|
|
9
|
+
void 0;
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
12
|
customEvents: {
|
|
@@ -15,11 +15,11 @@ RootComponent()({
|
|
|
15
15
|
methods: {
|
|
16
16
|
// @ts-expect-error "⚠️与events字段重复⚠️"
|
|
17
17
|
eventField() {
|
|
18
|
-
|
|
18
|
+
void 0;
|
|
19
19
|
},
|
|
20
20
|
// @ts-expect-error "⚠️与customEvents字段重复⚠️"
|
|
21
21
|
customField() {
|
|
22
|
-
|
|
22
|
+
void 0;
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
});
|
|
@@ -30,7 +30,7 @@ RootComponent()({
|
|
|
30
30
|
RootComponent()({
|
|
31
31
|
methods: {
|
|
32
32
|
M1() {
|
|
33
|
-
|
|
33
|
+
void 0;
|
|
34
34
|
},
|
|
35
35
|
|
|
36
36
|
M2() {
|
|
@@ -14,7 +14,7 @@ const RootDoc = RootComponent()({
|
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
void RootDoc;
|
|
18
18
|
type RootDocExpected = {
|
|
19
19
|
methods: {
|
|
20
20
|
num: () => 1;
|
|
@@ -22,4 +22,4 @@ type RootDocExpected = {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
Checking<typeof RootDoc, RootDocExpected, Test.Pass>;
|
|
25
|
+
void Checking<typeof RootDoc, RootDocExpected, Test.Pass>;
|
|
@@ -9,16 +9,20 @@ RootComponent()({
|
|
|
9
9
|
},
|
|
10
10
|
observers: {
|
|
11
11
|
obj(a) {
|
|
12
|
-
|
|
12
|
+
void a;
|
|
13
|
+
void Checking<typeof a, User | null, Test.Pass>;
|
|
13
14
|
},
|
|
14
15
|
"obj.**"(a) {
|
|
15
|
-
|
|
16
|
+
void a;
|
|
17
|
+
void Checking<typeof a, User | null, Test.Pass>;
|
|
16
18
|
},
|
|
17
19
|
"obj.age"(a) {
|
|
18
|
-
|
|
20
|
+
void a;
|
|
21
|
+
void Checking<typeof a, number, Test.Pass>;
|
|
19
22
|
},
|
|
20
23
|
"obj.name"(a) {
|
|
21
|
-
|
|
24
|
+
void a;
|
|
25
|
+
void Checking<typeof a, string, Test.Pass>;
|
|
22
26
|
},
|
|
23
27
|
},
|
|
24
28
|
});
|
|
@@ -4,14 +4,22 @@ import { RootComponent } from "../..";
|
|
|
4
4
|
*/
|
|
5
5
|
RootComponent()({
|
|
6
6
|
pageLifetimes: {
|
|
7
|
-
show() {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
show() {
|
|
8
|
+
void 0;
|
|
9
|
+
},
|
|
10
|
+
hide() {
|
|
11
|
+
void 0;
|
|
12
|
+
},
|
|
13
|
+
resize() {
|
|
14
|
+
void 0;
|
|
15
|
+
},
|
|
10
16
|
load(props) {
|
|
11
|
-
props;
|
|
17
|
+
void props;
|
|
12
18
|
},
|
|
13
19
|
// @ts-expect-error 1 错误的声明周期
|
|
14
|
-
xxx() {
|
|
20
|
+
xxx() {
|
|
21
|
+
void 0;
|
|
22
|
+
},
|
|
15
23
|
},
|
|
16
24
|
});
|
|
17
25
|
|
|
@@ -22,9 +30,11 @@ RootComponent()({
|
|
|
22
30
|
isPage: true,
|
|
23
31
|
pageLifetimes: {
|
|
24
32
|
onLoad(props) {
|
|
25
|
-
props;
|
|
33
|
+
void props;
|
|
26
34
|
},
|
|
27
35
|
// @ts-expect-error 2 错误的声明周期
|
|
28
|
-
xxx() {
|
|
36
|
+
xxx() {
|
|
37
|
+
void 0;
|
|
38
|
+
},
|
|
29
39
|
},
|
|
30
40
|
});
|
|
@@ -8,14 +8,20 @@ import type { Mock_User } from "../../Properties/test/normalRequired.test";
|
|
|
8
8
|
*/
|
|
9
9
|
RootComponent()({
|
|
10
10
|
pageLifetimes: {
|
|
11
|
-
hide() {
|
|
11
|
+
hide() {
|
|
12
|
+
void 0;
|
|
13
|
+
},
|
|
12
14
|
resize(size) {
|
|
13
|
-
|
|
15
|
+
void size;
|
|
16
|
+
void Checking<typeof size, WechatMiniprogram.Page.IResizeOption, Test.Pass>;
|
|
17
|
+
},
|
|
18
|
+
show() {
|
|
19
|
+
void 0;
|
|
14
20
|
},
|
|
15
|
-
show() {},
|
|
16
21
|
// 1 glass-easel(最低版本库3.0.2)支持的周期函数
|
|
17
22
|
load(obj) {
|
|
18
|
-
|
|
23
|
+
void obj;
|
|
24
|
+
void Checking<typeof obj, object | undefined, Test.Pass>;
|
|
19
25
|
},
|
|
20
26
|
},
|
|
21
27
|
});
|
|
@@ -41,7 +47,8 @@ RootComponent()({
|
|
|
41
47
|
pageLifetimes: {
|
|
42
48
|
// 3 重写onLoad周期参数props的类型(同页面properties定义类型).
|
|
43
49
|
onLoad(props) {
|
|
44
|
-
|
|
50
|
+
void props;
|
|
51
|
+
void Checking<
|
|
45
52
|
typeof props,
|
|
46
53
|
{
|
|
47
54
|
union?: Mock_User;
|
|
@@ -10,13 +10,13 @@ const emptyObj = RootComponent()({
|
|
|
10
10
|
methods: {
|
|
11
11
|
foo() {
|
|
12
12
|
// 1 this.data 为注入数据类型
|
|
13
|
-
Checking<typeof this.data, IInjectAllData, Test.Pass>;
|
|
13
|
+
void Checking<typeof this.data, IInjectAllData, Test.Pass>;
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
void emptyObj;
|
|
18
18
|
// 2 返回文档类型无properties字段
|
|
19
|
-
Checking<typeof emptyObj, {
|
|
19
|
+
void Checking<typeof emptyObj, {
|
|
20
20
|
methods: {
|
|
21
21
|
foo(): void;
|
|
22
22
|
};
|
|
@@ -29,13 +29,13 @@ const noProperties = RootComponent()({
|
|
|
29
29
|
methods: {
|
|
30
30
|
foo() {
|
|
31
31
|
// 3 this.data 为注入数据类型
|
|
32
|
-
Checking<typeof this.data, IInjectAllData, Test.Pass>;
|
|
32
|
+
void Checking<typeof this.data, IInjectAllData, Test.Pass>;
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
|
-
|
|
36
|
+
void noProperties;
|
|
37
37
|
// 4 返回文档类型无properties字段
|
|
38
|
-
Checking<typeof noProperties, {
|
|
38
|
+
void Checking<typeof noProperties, {
|
|
39
39
|
methods: {
|
|
40
40
|
foo(): void;
|
|
41
41
|
};
|