wevu 6.18.7 → 6.19.1
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/dist/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/defineProperty.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/toPrimitive.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/toPropertyKey.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/typeof.mjs +1 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/defineProperty.mjs +14 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/toPrimitive.mjs +16 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/toPropertyKey.mjs +11 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/typeof.mjs +12 -0
- package/dist/dev/index.mjs +48 -10
- package/dist/dev/internal-reactivity.mjs +15 -5
- package/dist/dev/internal-runtime.mjs +32 -4
- package/dist/dev/internal-template.mjs +1 -1
- package/dist/dev/package.mjs +6 -0
- package/dist/dev/package.mjs.map +1 -0
- package/dist/dev/reactivity/computed.mjs +49 -0
- package/dist/dev/reactivity/computed.mjs.map +1 -0
- package/dist/dev/reactivity/core.mjs +184 -0
- package/dist/dev/reactivity/core.mjs.map +1 -0
- package/dist/dev/reactivity/reactive/mutation.mjs +12 -0
- package/dist/dev/reactivity/reactive/mutation.mjs.map +1 -0
- package/dist/dev/{computed-BxRsUJgi.mjs → reactivity/reactive/patch.mjs} +8 -49
- package/dist/dev/reactivity/reactive/patch.mjs.map +1 -0
- package/dist/dev/reactivity/reactive/patchState.mjs +138 -0
- package/dist/dev/reactivity/reactive/patchState.mjs.map +1 -0
- package/dist/dev/reactivity/reactive/shallow.mjs +77 -0
- package/dist/dev/reactivity/reactive/shallow.mjs.map +1 -0
- package/dist/dev/reactivity/reactive/shared.mjs +40 -0
- package/dist/dev/reactivity/reactive/shared.mjs.map +1 -0
- package/dist/dev/reactivity/reactive/state.mjs +8 -0
- package/dist/dev/reactivity/reactive/state.mjs.map +1 -0
- package/dist/dev/reactivity/reactive.mjs +213 -0
- package/dist/dev/reactivity/reactive.mjs.map +1 -0
- package/dist/dev/reactivity/readonly.mjs +69 -0
- package/dist/dev/reactivity/readonly.mjs.map +1 -0
- package/dist/dev/reactivity/ref.mjs +97 -0
- package/dist/dev/reactivity/ref.mjs.map +1 -0
- package/dist/dev/reactivity/shallowRef.mjs +71 -0
- package/dist/dev/reactivity/shallowRef.mjs.map +1 -0
- package/dist/dev/{toRefs-D06VmFK2.mjs → reactivity/toRefs.mjs} +4 -3
- package/dist/dev/reactivity/toRefs.mjs.map +1 -0
- package/dist/dev/reactivity/traverse.mjs +40 -0
- package/dist/dev/reactivity/traverse.mjs.map +1 -0
- package/dist/dev/reactivity/watch/helpers.mjs +78 -0
- package/dist/dev/reactivity/watch/helpers.mjs.map +1 -0
- package/dist/dev/reactivity/watch/types.mjs +20 -0
- package/dist/dev/reactivity/watch/types.mjs.map +1 -0
- package/dist/dev/reactivity/watch.mjs +167 -0
- package/dist/dev/reactivity/watch.mjs.map +1 -0
- package/dist/dev/router/backNavigation.mjs +32 -0
- package/dist/dev/router/backNavigation.mjs.map +1 -0
- package/dist/dev/router/createRouter.mjs +179 -0
- package/dist/dev/router/createRouter.mjs.map +1 -0
- package/dist/dev/router/instance.mjs +17 -0
- package/dist/dev/router/instance.mjs.map +1 -0
- package/dist/dev/router/navigationApi.mjs +94 -0
- package/dist/dev/router/navigationApi.mjs.map +1 -0
- package/dist/dev/router/navigationCore.mjs +139 -0
- package/dist/dev/router/navigationCore.mjs.map +1 -0
- package/dist/dev/router/navigationResult.mjs +54 -0
- package/dist/dev/router/navigationResult.mjs.map +1 -0
- package/dist/dev/router/navigationTarget.mjs +122 -0
- package/dist/dev/router/navigationTarget.mjs.map +1 -0
- package/dist/dev/router/navigationTargetHelpers.mjs +38 -0
- package/dist/dev/router/navigationTargetHelpers.mjs.map +1 -0
- package/dist/dev/router/resolve.mjs +29 -0
- package/dist/dev/router/resolve.mjs.map +1 -0
- package/dist/dev/router/routeRegistry.mjs +78 -0
- package/dist/dev/router/routeRegistry.mjs.map +1 -0
- package/dist/dev/router/routeSync.mjs +72 -0
- package/dist/dev/router/routeSync.mjs.map +1 -0
- package/dist/dev/router/types.mjs +11 -0
- package/dist/dev/router/types.mjs.map +1 -0
- package/dist/dev/router/useRoute.mjs +106 -0
- package/dist/dev/router/useRoute.mjs.map +1 -0
- package/dist/dev/router/useRouter.mjs +15 -0
- package/dist/dev/router/useRouter.mjs.map +1 -0
- package/dist/dev/router.mjs +9 -1378
- package/dist/dev/routerInternal/location.mjs +68 -0
- package/dist/dev/routerInternal/location.mjs.map +1 -0
- package/dist/dev/routerInternal/matching.mjs +149 -0
- package/dist/dev/routerInternal/matching.mjs.map +1 -0
- package/dist/dev/routerInternal/params.mjs +95 -0
- package/dist/dev/routerInternal/params.mjs.map +1 -0
- package/dist/dev/routerInternal/path.mjs +42 -0
- package/dist/dev/routerInternal/path.mjs.map +1 -0
- package/dist/dev/routerInternal/query.mjs +113 -0
- package/dist/dev/routerInternal/query.mjs.map +1 -0
- package/dist/dev/routerInternal/records.mjs +173 -0
- package/dist/dev/routerInternal/records.mjs.map +1 -0
- package/dist/dev/routerInternal/recordsWarnings.mjs +49 -0
- package/dist/dev/routerInternal/recordsWarnings.mjs.map +1 -0
- package/dist/dev/routerInternal/snapshots.mjs +126 -0
- package/dist/dev/routerInternal/snapshots.mjs.map +1 -0
- package/dist/dev/runtime/app/computed.mjs +68 -0
- package/dist/dev/runtime/app/computed.mjs.map +1 -0
- package/dist/dev/runtime/app/context.mjs +275 -0
- package/dist/dev/runtime/app/context.mjs.map +1 -0
- package/dist/dev/runtime/app/diagnostics.mjs +34 -0
- package/dist/dev/runtime/app/diagnostics.mjs.map +1 -0
- package/dist/dev/runtime/app/mount.mjs +270 -0
- package/dist/dev/runtime/app/mount.mjs.map +1 -0
- package/dist/dev/runtime/app/pending.mjs +14 -0
- package/dist/dev/runtime/app/pending.mjs.map +1 -0
- package/dist/dev/runtime/app/setData/patchScheduler.mjs +158 -0
- package/dist/dev/runtime/app/setData/patchScheduler.mjs.map +1 -0
- package/dist/dev/runtime/app/setData/payload.mjs +161 -0
- package/dist/dev/runtime/app/setData/payload.mjs.map +1 -0
- package/dist/dev/runtime/app/setData/scheduler.mjs +313 -0
- package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -0
- package/dist/dev/runtime/app/setData/snapshot.mjs +129 -0
- package/dist/dev/runtime/app/setData/snapshot.mjs.map +1 -0
- package/dist/dev/runtime/app/setDataOptions.mjs +73 -0
- package/dist/dev/runtime/app/setDataOptions.mjs.map +1 -0
- package/dist/dev/runtime/app.mjs +93 -0
- package/dist/dev/runtime/app.mjs.map +1 -0
- package/dist/dev/runtime/bindModel.mjs +92 -0
- package/dist/dev/runtime/bindModel.mjs.map +1 -0
- package/dist/dev/runtime/defaults.mjs +61 -0
- package/dist/dev/runtime/defaults.mjs.map +1 -0
- package/dist/dev/runtime/define/initialComputed.mjs +125 -0
- package/dist/dev/runtime/define/initialComputed.mjs.map +1 -0
- package/dist/dev/runtime/define/options.mjs +169 -0
- package/dist/dev/runtime/define/options.mjs.map +1 -0
- package/dist/dev/runtime/define/optionsApi.mjs +48 -0
- package/dist/dev/runtime/define/optionsApi.mjs.map +1 -0
- package/dist/dev/runtime/define/props.mjs +194 -0
- package/dist/dev/runtime/define/props.mjs.map +1 -0
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +316 -0
- package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -0
- package/dist/dev/runtime/define/setupResult.mjs +78 -0
- package/dist/dev/runtime/define/setupResult.mjs.map +1 -0
- package/dist/dev/runtime/define.mjs +142 -0
- package/dist/dev/runtime/define.mjs.map +1 -0
- package/dist/dev/runtime/diff.mjs +193 -0
- package/dist/dev/runtime/diff.mjs.map +1 -0
- package/dist/dev/runtime/disposables.mjs +81 -0
- package/dist/dev/runtime/disposables.mjs.map +1 -0
- package/dist/dev/runtime/elementIntersectionObserver.mjs +80 -0
- package/dist/dev/runtime/elementIntersectionObserver.mjs.map +1 -0
- package/dist/dev/runtime/emit.mjs +36 -0
- package/dist/dev/runtime/emit.mjs.map +1 -0
- package/dist/dev/{base-CYkvI7w8.mjs → runtime/hooks/base.mjs} +3 -140
- package/dist/dev/runtime/hooks/base.mjs.map +1 -0
- package/dist/dev/runtime/hooks/register.mjs +92 -0
- package/dist/dev/runtime/hooks/register.mjs.map +1 -0
- package/dist/dev/runtime/hooks/vue.mjs +81 -0
- package/dist/dev/runtime/hooks/vue.mjs.map +1 -0
- package/dist/dev/runtime/internal.mjs +18 -0
- package/dist/dev/runtime/internal.mjs.map +1 -0
- package/dist/dev/runtime/intersectionObserver.mjs +46 -0
- package/dist/dev/runtime/intersectionObserver.mjs.map +1 -0
- package/dist/dev/runtime/layoutBridge.mjs +303 -0
- package/dist/dev/runtime/layoutBridge.mjs.map +1 -0
- package/dist/dev/runtime/layoutComponentMatcher.mjs +11 -0
- package/dist/dev/runtime/layoutComponentMatcher.mjs.map +1 -0
- package/dist/dev/runtime/nativeBridge.mjs +21 -0
- package/dist/dev/runtime/nativeBridge.mjs.map +1 -0
- package/dist/dev/runtime/noSetData.mjs +18 -0
- package/dist/dev/runtime/noSetData.mjs.map +1 -0
- package/dist/dev/runtime/pageEnvironment.mjs +100 -0
- package/dist/dev/runtime/pageEnvironment.mjs.map +1 -0
- package/dist/dev/runtime/pageLayout.mjs +71 -0
- package/dist/dev/runtime/pageLayout.mjs.map +1 -0
- package/dist/dev/runtime/pageScroll.mjs +110 -0
- package/dist/dev/runtime/pageScroll.mjs.map +1 -0
- package/dist/dev/runtime/platform.mjs +79 -0
- package/dist/dev/runtime/platform.mjs.map +1 -0
- package/dist/dev/runtime/provide.mjs +71 -0
- package/dist/dev/runtime/provide.mjs.map +1 -0
- package/dist/dev/runtime/provideContext.mjs +101 -0
- package/dist/dev/runtime/provideContext.mjs.map +1 -0
- package/dist/dev/runtime/provideStore.mjs +18 -0
- package/dist/dev/runtime/provideStore.mjs.map +1 -0
- package/dist/dev/runtime/pullDownRefresh.mjs +24 -0
- package/dist/dev/runtime/pullDownRefresh.mjs.map +1 -0
- package/dist/dev/runtime/register/app.mjs +161 -0
- package/dist/dev/runtime/register/app.mjs.map +1 -0
- package/dist/dev/runtime/register/component/features.mjs +43 -0
- package/dist/dev/runtime/register/component/features.mjs.map +1 -0
- package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs +64 -0
- package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs.map +1 -0
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs +96 -0
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs.map +1 -0
- package/dist/dev/runtime/register/component/lifecycle.mjs +122 -0
- package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -0
- package/dist/dev/runtime/register/component/methods.mjs +82 -0
- package/dist/dev/runtime/register/component/methods.mjs.map +1 -0
- package/dist/dev/runtime/register/component/options.mjs +204 -0
- package/dist/dev/runtime/register/component/options.mjs.map +1 -0
- package/dist/dev/runtime/register/component/props.mjs +218 -0
- package/dist/dev/runtime/register/component/props.mjs.map +1 -0
- package/dist/dev/runtime/register/component/registerDefinition.mjs +290 -0
- package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -0
- package/dist/dev/runtime/register/component.mjs +129 -0
- package/dist/dev/runtime/register/component.mjs.map +1 -0
- package/dist/dev/runtime/register/inline.mjs +145 -0
- package/dist/dev/runtime/register/inline.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +53 -0
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +34 -0
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +230 -0
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +166 -0
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs +122 -0
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance.mjs +441 -0
- package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -0
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +95 -0
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs.map +1 -0
- package/dist/dev/runtime/register/setup.mjs +22 -0
- package/dist/dev/runtime/register/setup.mjs.map +1 -0
- package/dist/dev/runtime/register/snapshot.mjs +18 -0
- package/dist/dev/runtime/register/snapshot.mjs.map +1 -0
- package/dist/dev/runtime/register/watch.mjs +57 -0
- package/dist/dev/runtime/register/watch.mjs.map +1 -0
- package/dist/dev/runtime/scopedSlots.mjs +115 -0
- package/dist/dev/runtime/scopedSlots.mjs.map +1 -0
- package/dist/dev/runtime/selectorQuery.mjs +49 -0
- package/dist/dev/runtime/selectorQuery.mjs.map +1 -0
- package/dist/dev/runtime/setupTracking.mjs +59 -0
- package/dist/dev/runtime/setupTracking.mjs.map +1 -0
- package/dist/dev/{template-n_iVr0ey.mjs → runtime/template.mjs} +7 -4
- package/dist/dev/runtime/template.mjs.map +1 -0
- package/dist/dev/runtime/templateRefs/helpers.mjs +259 -0
- package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -0
- package/dist/dev/runtime/templateRefs.mjs +162 -0
- package/dist/dev/runtime/templateRefs.mjs.map +1 -0
- package/dist/dev/runtime/uniAppHost.mjs +119 -0
- package/dist/dev/runtime/uniAppHost.mjs.map +1 -0
- package/dist/dev/runtime/updatePerformance.mjs +41 -0
- package/dist/dev/runtime/updatePerformance.mjs.map +1 -0
- package/dist/dev/runtime/use.mjs +25 -0
- package/dist/dev/runtime/use.mjs.map +1 -0
- package/dist/dev/runtime/vueCompat/context.mjs +25 -0
- package/dist/dev/runtime/vueCompat/context.mjs.map +1 -0
- package/dist/dev/runtime/vueCompat/model.mjs +119 -0
- package/dist/dev/runtime/vueCompat/model.mjs.map +1 -0
- package/dist/dev/runtime/vueCompat/router.mjs +124 -0
- package/dist/dev/runtime/vueCompat/router.mjs.map +1 -0
- package/dist/dev/runtime/vueCompat/templateRef.mjs +37 -0
- package/dist/dev/runtime/vueCompat/templateRef.mjs.map +1 -0
- package/dist/dev/scheduler.mjs +75 -0
- package/dist/dev/scheduler.mjs.map +1 -0
- package/dist/dev/store/actions.mjs +40 -0
- package/dist/dev/store/actions.mjs.map +1 -0
- package/dist/dev/store/base.mjs +56 -0
- package/dist/dev/store/base.mjs.map +1 -0
- package/dist/dev/store/define/optionsStyle.mjs +125 -0
- package/dist/dev/store/define/optionsStyle.mjs.map +1 -0
- package/dist/dev/store/define/setupStyle.mjs +145 -0
- package/dist/dev/store/define/setupStyle.mjs.map +1 -0
- package/dist/dev/store/define/shared.mjs +38 -0
- package/dist/dev/store/define/shared.mjs.map +1 -0
- package/dist/dev/store/define.mjs +23 -0
- package/dist/dev/store/define.mjs.map +1 -0
- package/dist/dev/store/manager.mjs +21 -0
- package/dist/dev/store/manager.mjs.map +1 -0
- package/dist/dev/store/storeToRefs.mjs +29 -0
- package/dist/dev/store/storeToRefs.mjs.map +1 -0
- package/dist/dev/store/utils.mjs +49 -0
- package/dist/dev/store/utils.mjs.map +1 -0
- package/dist/dev/store.mjs +3 -1
- package/dist/dev/utils.mjs +16 -0
- package/dist/dev/utils.mjs.map +1 -0
- package/dist/dev/version.mjs +8 -0
- package/dist/dev/version.mjs.map +1 -0
- package/dist/dev/vue-demi.mjs +48 -168
- package/dist/dev/vue-demi.mjs.map +1 -1
- package/dist/index.d.mts +71 -7
- package/dist/index.mjs +1 -1
- package/dist/internal-reactivity.d.mts +16 -2
- package/dist/internal-reactivity.mjs +1 -1
- package/dist/internal-runtime.d.mts +35 -2
- package/dist/internal-runtime.mjs +1 -1
- package/dist/internal-template.d.mts +1 -1
- package/dist/internal-template.mjs +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/macros/shared.d.mts +81 -0
- package/dist/macros.d.mts +70 -0
- package/dist/package.mjs +1 -0
- package/dist/reactivity/computed.d.mts +21 -0
- package/dist/reactivity/computed.mjs +1 -0
- package/dist/reactivity/core.d.mts +34 -0
- package/dist/reactivity/core.mjs +1 -0
- package/dist/reactivity/index.d.mts +15 -0
- package/dist/reactivity/reactive/mutation.d.mts +21 -0
- package/dist/reactivity/reactive/mutation.mjs +1 -0
- package/dist/reactivity/reactive/patch.d.mts +18 -0
- package/dist/reactivity/reactive/patch.mjs +1 -0
- package/dist/reactivity/reactive/patchState.mjs +1 -0
- package/dist/reactivity/reactive/shallow.d.mts +22 -0
- package/dist/reactivity/reactive/shallow.mjs +1 -0
- package/dist/reactivity/reactive/shared.d.mts +4 -0
- package/dist/reactivity/reactive/shared.mjs +1 -0
- package/dist/reactivity/reactive/state.mjs +1 -0
- package/dist/reactivity/reactive.d.mts +41 -0
- package/dist/reactivity/reactive.mjs +1 -0
- package/dist/reactivity/readonly.d.mts +27 -0
- package/dist/reactivity/readonly.mjs +1 -0
- package/dist/reactivity/ref.d.mts +27 -0
- package/dist/reactivity/ref.mjs +1 -0
- package/dist/reactivity/shallowRef.d.mts +19 -0
- package/dist/reactivity/shallowRef.mjs +1 -0
- package/dist/reactivity/toRefs.d.mts +43 -0
- package/dist/reactivity/toRefs.mjs +1 -0
- package/dist/reactivity/traverse.d.mts +8 -0
- package/dist/reactivity/traverse.mjs +1 -0
- package/dist/reactivity/watch/helpers.mjs +1 -0
- package/dist/reactivity/watch/types.d.mts +43 -0
- package/dist/reactivity/watch/types.mjs +1 -0
- package/dist/reactivity/watch.d.mts +21 -0
- package/dist/reactivity/watch.mjs +1 -0
- package/dist/router/backNavigation.mjs +1 -0
- package/dist/router/createRouter.d.mts +8 -0
- package/dist/router/createRouter.mjs +1 -0
- package/dist/router/instance.mjs +1 -0
- package/dist/router/navigationApi.mjs +1 -0
- package/dist/router/navigationCore.d.mts +6 -0
- package/dist/router/navigationCore.mjs +1 -0
- package/dist/router/navigationResult.mjs +1 -0
- package/dist/router/navigationTarget.mjs +1 -0
- package/dist/router/navigationTargetHelpers.mjs +1 -0
- package/dist/router/resolve.d.mts +6 -0
- package/dist/router/resolve.mjs +1 -0
- package/dist/router/routeRegistry.mjs +1 -0
- package/dist/router/routeSync.d.mts +1 -0
- package/dist/router/routeSync.mjs +1 -0
- package/dist/router/types.d.mts +163 -0
- package/dist/router/types.mjs +1 -0
- package/dist/router/useRoute.d.mts +19 -0
- package/dist/router/useRoute.mjs +1 -0
- package/dist/router/useRouter.d.mts +8 -0
- package/dist/router/useRouter.mjs +1 -0
- package/dist/router.d.mts +9 -204
- package/dist/router.mjs +1 -1
- package/dist/routerInternal/location.mjs +1 -0
- package/dist/routerInternal/matching.mjs +1 -0
- package/dist/routerInternal/params.mjs +1 -0
- package/dist/routerInternal/path.mjs +1 -0
- package/dist/routerInternal/query.d.mts +7 -0
- package/dist/routerInternal/query.mjs +1 -0
- package/dist/routerInternal/records.mjs +1 -0
- package/dist/routerInternal/recordsWarnings.mjs +1 -0
- package/dist/routerInternal/snapshots.mjs +1 -0
- package/dist/routerInternal/types.d.mts +9 -0
- package/dist/runtime/app/computed.mjs +1 -0
- package/dist/runtime/app/context.mjs +1 -0
- package/dist/runtime/app/diagnostics.mjs +1 -0
- package/dist/runtime/app/mount.mjs +1 -0
- package/dist/runtime/app/pending.d.mts +10 -0
- package/dist/runtime/app/pending.mjs +1 -0
- package/dist/runtime/app/setData/patchScheduler.mjs +1 -0
- package/dist/runtime/app/setData/payload.mjs +1 -0
- package/dist/runtime/app/setData/scheduler.mjs +1 -0
- package/dist/runtime/app/setData/snapshot.mjs +1 -0
- package/dist/runtime/app/setDataOptions.mjs +1 -0
- package/dist/runtime/app.d.mts +8 -0
- package/dist/runtime/app.mjs +1 -0
- package/dist/runtime/bindModel.mjs +1 -0
- package/dist/runtime/defaults.d.mts +11 -0
- package/dist/runtime/defaults.mjs +1 -0
- package/dist/runtime/define/initialComputed.mjs +1 -0
- package/dist/runtime/define/options.mjs +1 -0
- package/dist/runtime/define/optionsApi.mjs +1 -0
- package/dist/runtime/define/props.mjs +1 -0
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -0
- package/dist/runtime/define/setupResult.mjs +1 -0
- package/dist/runtime/define.d.mts +105 -0
- package/dist/runtime/define.mjs +1 -0
- package/dist/runtime/diff.mjs +1 -0
- package/dist/runtime/disposables.d.mts +31 -0
- package/dist/runtime/disposables.mjs +1 -0
- package/dist/runtime/elementIntersectionObserver.d.mts +26 -0
- package/dist/runtime/elementIntersectionObserver.mjs +1 -0
- package/dist/runtime/emit.mjs +1 -0
- package/dist/runtime/hooks/base.d.mts +27 -0
- package/dist/runtime/hooks/base.mjs +1 -0
- package/dist/runtime/hooks/register.d.mts +30 -0
- package/dist/runtime/hooks/register.mjs +1 -0
- package/dist/runtime/hooks/vue.d.mts +53 -0
- package/dist/runtime/hooks/vue.mjs +1 -0
- package/dist/runtime/hooks.d.mts +4 -0
- package/dist/runtime/index.d.mts +47 -0
- package/dist/runtime/internal.mjs +1 -0
- package/dist/runtime/intersectionObserver.d.mts +14 -0
- package/dist/runtime/intersectionObserver.mjs +1 -0
- package/dist/runtime/layoutBridge.d.mts +59 -0
- package/dist/runtime/layoutBridge.mjs +1 -0
- package/dist/runtime/layoutComponentMatcher.mjs +1 -0
- package/dist/runtime/nativeBridge.mjs +1 -0
- package/dist/runtime/noSetData.d.mts +5 -0
- package/dist/runtime/noSetData.mjs +1 -0
- package/dist/runtime/pageEnvironment.d.mts +50 -0
- package/dist/runtime/pageEnvironment.mjs +1 -0
- package/dist/runtime/pageLayout.d.mts +26 -0
- package/dist/runtime/pageLayout.mjs +1 -0
- package/dist/runtime/pageScroll.d.mts +29 -0
- package/dist/runtime/pageScroll.mjs +1 -0
- package/dist/runtime/platform.mjs +1 -0
- package/dist/runtime/provide.d.mts +59 -0
- package/dist/runtime/provide.mjs +1 -0
- package/dist/runtime/provideContext.mjs +1 -0
- package/dist/runtime/provideStore.d.mts +7 -0
- package/dist/runtime/provideStore.mjs +1 -0
- package/dist/runtime/pullDownRefresh.d.mts +12 -0
- package/dist/runtime/pullDownRefresh.mjs +1 -0
- package/dist/runtime/register/app.d.mts +14 -0
- package/dist/runtime/register/app.mjs +1 -0
- package/dist/runtime/register/component/features.mjs +1 -0
- package/dist/runtime/register/component/lifecycle/optionalHooks.mjs +1 -0
- package/dist/runtime/register/component/lifecycle/platform.mjs +1 -0
- package/dist/runtime/register/component/lifecycle.mjs +1 -0
- package/dist/runtime/register/component/methods.mjs +1 -0
- package/dist/runtime/register/component/options.mjs +1 -0
- package/dist/runtime/register/component/props.mjs +1 -0
- package/dist/runtime/register/component/registerDefinition.mjs +1 -0
- package/dist/runtime/register/component.d.mts +15 -0
- package/dist/runtime/register/component.mjs +1 -0
- package/dist/runtime/register/inline.d.mts +15 -0
- package/dist/runtime/register/inline.mjs +1 -0
- package/dist/runtime/register/runtimeInstance/methodBridge.mjs +1 -0
- package/dist/runtime/register/runtimeInstance/provideContext.mjs +1 -0
- package/dist/runtime/register/runtimeInstance/setupContext.mjs +1 -0
- package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -0
- package/dist/runtime/register/runtimeInstance/utils.mjs +1 -0
- package/dist/runtime/register/runtimeInstance.d.mts +26 -0
- package/dist/runtime/register/runtimeInstance.mjs +1 -0
- package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -0
- package/dist/runtime/register/setup.d.mts +11 -0
- package/dist/runtime/register/setup.mjs +1 -0
- package/dist/runtime/register/snapshot.mjs +1 -0
- package/dist/runtime/register/watch.d.mts +12 -0
- package/dist/runtime/register/watch.mjs +1 -0
- package/dist/runtime/register.d.mts +5 -0
- package/dist/runtime/scopedSlots.mjs +1 -0
- package/dist/runtime/selectorQuery.d.mts +54 -0
- package/dist/runtime/selectorQuery.mjs +1 -0
- package/dist/runtime/setupTracking.mjs +1 -0
- package/dist/{template-DE8e5dj_.d.mts → runtime/template.d.mts} +1 -1
- package/dist/runtime/template.mjs +1 -0
- package/dist/runtime/templateRefTypes.d.mts +7 -0
- package/dist/runtime/templateRefs/helpers.mjs +1 -0
- package/dist/runtime/templateRefs.d.mts +11 -0
- package/dist/runtime/templateRefs.mjs +1 -0
- package/dist/runtime/types/core.d.mts +35 -0
- package/dist/runtime/types/miniprogram.d.mts +80 -0
- package/dist/runtime/types/miniprogramHost.d.mts +44 -0
- package/dist/runtime/types/miniprogramHostSources.d.mts +112 -0
- package/dist/runtime/types/options.d.mts +136 -0
- package/dist/runtime/types/props/propTypes.d.mts +79 -0
- package/dist/runtime/types/props/router.d.mts +51 -0
- package/dist/runtime/types/props/setup.d.mts +96 -0
- package/dist/runtime/types/props.d.mts +4 -0
- package/dist/runtime/types/runtime.d.mts +59 -0
- package/dist/runtime/types/setData.d.mts +220 -0
- package/dist/runtime/types.d.mts +28 -0
- package/dist/runtime/uniAppHost.d.mts +8 -0
- package/dist/runtime/uniAppHost.mjs +1 -0
- package/dist/runtime/updatePerformance.d.mts +13 -0
- package/dist/runtime/updatePerformance.mjs +1 -0
- package/dist/runtime/use.d.mts +13 -0
- package/dist/runtime/use.mjs +1 -0
- package/dist/runtime/vueCompat/context.d.mts +8 -0
- package/dist/runtime/vueCompat/context.mjs +1 -0
- package/dist/runtime/vueCompat/model.d.mts +30 -0
- package/dist/runtime/vueCompat/model.mjs +1 -0
- package/dist/runtime/vueCompat/router.d.mts +28 -0
- package/dist/runtime/vueCompat/router.mjs +1 -0
- package/dist/runtime/vueCompat/templateRef.d.mts +9 -0
- package/dist/runtime/vueCompat/templateRef.mjs +1 -0
- package/dist/runtime/vueCompat.d.mts +5 -0
- package/dist/scheduler.d.mts +4 -0
- package/dist/scheduler.mjs +1 -0
- package/dist/store/actions.mjs +1 -0
- package/dist/store/base.mjs +1 -0
- package/dist/store/define/optionsStyle.mjs +1 -0
- package/dist/store/define/setupStyle.mjs +1 -0
- package/dist/store/define/shared.mjs +1 -0
- package/dist/store/define.d.mts +26 -0
- package/dist/store/define.mjs +1 -0
- package/dist/store/manager.d.mts +8 -0
- package/dist/store/manager.mjs +1 -0
- package/dist/store/storeToRefs.d.mts +13 -0
- package/dist/store/storeToRefs.mjs +1 -0
- package/dist/store/types.d.mts +70 -0
- package/dist/store/utils.mjs +1 -0
- package/dist/store.d.mts +4 -1
- package/dist/store.mjs +1 -1
- package/dist/utils.mjs +1 -0
- package/dist/version.d.mts +4 -0
- package/dist/version.mjs +1 -0
- package/dist/vue-augment.d.mts +6 -0
- package/dist/vue-demi.d.mts +68 -10
- package/dist/vue-demi.mjs +1 -1
- package/dist/vue-types.d.mts +18 -0
- package/dist/weappIntrinsicElements/base.d.mts +22 -0
- package/dist/weappIntrinsicElements/elements/ad-custom.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/ad.d.mts +16 -0
- package/dist/weappIntrinsicElements/elements/audio.d.mts +20 -0
- package/dist/weappIntrinsicElements/elements/block.d.mts +8 -0
- package/dist/weappIntrinsicElements/elements/button.d.mts +40 -0
- package/dist/weappIntrinsicElements/elements/camera.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/canvas.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/checkbox-group.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/checkbox.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/cover-image.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/cover-view.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/editor.d.mts +22 -0
- package/dist/weappIntrinsicElements/elements/form.d.mts +16 -0
- package/dist/weappIntrinsicElements/elements/functional-page-navigator.d.mts +15 -0
- package/dist/weappIntrinsicElements/elements/icon.d.mts +12 -0
- package/dist/weappIntrinsicElements/elements/image.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/import.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/include.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/input.d.mts +47 -0
- package/dist/weappIntrinsicElements/elements/keyboard-accessory.d.mts +8 -0
- package/dist/weappIntrinsicElements/elements/label.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/live-player.d.mts +35 -0
- package/dist/weappIntrinsicElements/elements/live-pusher.d.mts +57 -0
- package/dist/weappIntrinsicElements/elements/map.d.mts +105 -0
- package/dist/weappIntrinsicElements/elements/match-media.d.mts +16 -0
- package/dist/weappIntrinsicElements/elements/movable-area.d.mts +26 -0
- package/dist/weappIntrinsicElements/elements/movable-view.d.mts +26 -0
- package/dist/weappIntrinsicElements/elements/navigation-bar.d.mts +15 -0
- package/dist/weappIntrinsicElements/elements/navigator.d.mts +25 -0
- package/dist/weappIntrinsicElements/elements/official-account.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/open-data.d.mts +15 -0
- package/dist/weappIntrinsicElements/elements/page-container.d.mts +25 -0
- package/dist/weappIntrinsicElements/elements/page-meta.d.mts +23 -0
- package/dist/weappIntrinsicElements/elements/picker-view-column.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/picker-view.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/picker.d.mts +23 -0
- package/dist/weappIntrinsicElements/elements/progress.d.mts +21 -0
- package/dist/weappIntrinsicElements/elements/radio-group.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/radio.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/rich-text.d.mts +17 -0
- package/dist/weappIntrinsicElements/elements/scroll-view.d.mts +68 -0
- package/dist/weappIntrinsicElements/elements/share-element.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/slider.d.mts +23 -0
- package/dist/weappIntrinsicElements/elements/slot.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/swiper-item.d.mts +42 -0
- package/dist/weappIntrinsicElements/elements/swiper.d.mts +42 -0
- package/dist/weappIntrinsicElements/elements/switch.d.mts +14 -0
- package/dist/weappIntrinsicElements/elements/template.d.mts +12 -0
- package/dist/weappIntrinsicElements/elements/text.d.mts +15 -0
- package/dist/weappIntrinsicElements/elements/textarea.d.mts +40 -0
- package/dist/weappIntrinsicElements/elements/video.d.mts +71 -0
- package/dist/weappIntrinsicElements/elements/view.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/voip-room.d.mts +14 -0
- package/dist/weappIntrinsicElements/elements/web-view.d.mts +13 -0
- package/dist/weappIntrinsicElements.d.mts +153 -0
- package/package.json +6 -6
- package/dist/base-BxKbbKVO.mjs +0 -1
- package/dist/computed-Xoi9XEUx.mjs +0 -1
- package/dist/dev/base-CYkvI7w8.mjs.map +0 -1
- package/dist/dev/computed-BxRsUJgi.mjs.map +0 -1
- package/dist/dev/ref-DRZC3Kc5.mjs +0 -695
- package/dist/dev/ref-DRZC3Kc5.mjs.map +0 -1
- package/dist/dev/rolldown-runtime-BUUfjzRC.mjs +0 -36
- package/dist/dev/router-D0JQfgyN.mjs +0 -754
- package/dist/dev/router-D0JQfgyN.mjs.map +0 -1
- package/dist/dev/router.mjs.map +0 -1
- package/dist/dev/store-HNsiQJ4d.mjs +0 -479
- package/dist/dev/store-HNsiQJ4d.mjs.map +0 -1
- package/dist/dev/template-n_iVr0ey.mjs.map +0 -1
- package/dist/dev/templateRef-BLnYcEH0.mjs +0 -6439
- package/dist/dev/templateRef-BLnYcEH0.mjs.map +0 -1
- package/dist/dev/toRefs-D06VmFK2.mjs.map +0 -1
- package/dist/dev/watch-jrgL5ald.mjs +0 -445
- package/dist/dev/watch-jrgL5ald.mjs.map +0 -1
- package/dist/index-BiHILcmb.d.mts +0 -1215
- package/dist/index-CCET_bCY.d.mts +0 -111
- package/dist/ref-D37CknuD.mjs +0 -1
- package/dist/rolldown-runtime-CenpyGzJ.mjs +0 -1
- package/dist/router-D4W4lEXM.mjs +0 -1
- package/dist/store-eHrHBQiv.mjs +0 -1
- package/dist/template-CNzlwH-E.mjs +0 -1
- package/dist/templateRef-DOTHWzZ5.mjs +0 -1
- package/dist/toRefs-CoytPyo0.mjs +0 -1
- package/dist/traverse-B4Ez44Gd.d.mts +0 -108
- package/dist/vue-types-B3N60cGV.d.mts +0 -757
- package/dist/watch-Bbd-gmEg.mjs +0 -1
- package/dist/weappIntrinsicElements-BgDtC53_.d.mts +0 -1257
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
//#region src/runtime/types/setData.d.ts
|
|
2
|
+
interface SetDataSnapshotOptions {
|
|
3
|
+
/**
|
|
4
|
+
* 开发态高频 setData 告警。
|
|
5
|
+
*
|
|
6
|
+
* - `undefined`:默认关闭(可通过 `weapp.wevu.preset: 'performance'` 自动开启)
|
|
7
|
+
* - `false`:关闭告警
|
|
8
|
+
* - `true`:启用默认阈值(默认仅开发态生效)
|
|
9
|
+
* - `object`:自定义阈值与开关
|
|
10
|
+
*/
|
|
11
|
+
highFrequencyWarning?: boolean | {
|
|
12
|
+
/**
|
|
13
|
+
* 是否启用告警。
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 是否仅在开发态生效。
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
devOnly?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 统计窗口(毫秒)。
|
|
24
|
+
* @default 1000
|
|
25
|
+
*/
|
|
26
|
+
sampleWindowMs?: number;
|
|
27
|
+
/**
|
|
28
|
+
* 窗口内超过该次数触发告警。
|
|
29
|
+
* @default 30
|
|
30
|
+
*/
|
|
31
|
+
maxCalls?: number;
|
|
32
|
+
/**
|
|
33
|
+
* 告警冷却时间(毫秒),避免刷屏。
|
|
34
|
+
* @default 5000
|
|
35
|
+
*/
|
|
36
|
+
coolDownMs?: number;
|
|
37
|
+
/**
|
|
38
|
+
* 是否在检测到 `onPageScroll` 回调内调用 setData 时输出专项告警。
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
warnOnPageScroll?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* `onPageScroll` 专项告警冷却时间(毫秒)。
|
|
44
|
+
* @default 2000
|
|
45
|
+
*/
|
|
46
|
+
pageScrollCoolDownMs?: number;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* setData 策略:
|
|
50
|
+
* - diff:全量快照 + diff(默认,兼容性最好)
|
|
51
|
+
* - patch:按变更路径增量产出 payload(性能更好;在共享引用等场景会自动回退 diff)
|
|
52
|
+
*/
|
|
53
|
+
strategy?: 'diff' | 'patch';
|
|
54
|
+
/**
|
|
55
|
+
* 仅下发指定的顶层字段(包含 data/setup 返回值与 computed)。
|
|
56
|
+
* 若为空则默认下发所有字段。
|
|
57
|
+
*/
|
|
58
|
+
pick?: string[];
|
|
59
|
+
/**
|
|
60
|
+
* 排除指定的顶层字段(包含 data/setup 返回值与 computed)。
|
|
61
|
+
*/
|
|
62
|
+
omit?: string[];
|
|
63
|
+
/**
|
|
64
|
+
* 是否将 computed 的结果参与 setData(默认 true)。
|
|
65
|
+
*/
|
|
66
|
+
includeComputed?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* 页面/组件处于后台态(onHide 之后)时,是否挂起 setData 下发。
|
|
69
|
+
*
|
|
70
|
+
* - true:后台态仅合并最新 payload,待 onShow 后一次性 flush
|
|
71
|
+
* - false:保持默认行为,后台态也继续 setData
|
|
72
|
+
*
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
suspendWhenHidden?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* patch 模式阈值:当本轮变更路径数量超过该值时,自动回退到 diff。
|
|
78
|
+
* 说明:大量路径变更时,全量快照 diff 往往更快/更小。
|
|
79
|
+
*/
|
|
80
|
+
maxPatchKeys?: number;
|
|
81
|
+
/**
|
|
82
|
+
* patch 模式阈值:当本轮 payload 估算字节数超过该值时,自动回退到 diff。
|
|
83
|
+
* 说明:该估算基于 `JSON.stringify(payload).length`,仅用于启发式降级。
|
|
84
|
+
*/
|
|
85
|
+
maxPayloadBytes?: number;
|
|
86
|
+
/**
|
|
87
|
+
* patch 模式优化:当同一父路径下存在多个子路径变更时,合并为父路径整体下发。
|
|
88
|
+
*
|
|
89
|
+
* 例如:`a.b` 与 `a.c` 同时变更,且 `mergeSiblingThreshold = 2` 时,会下发 `a`。
|
|
90
|
+
*
|
|
91
|
+
* 注意:当子路径包含删除(null)时,为避免删除语义不一致,将不会触发合并。
|
|
92
|
+
*/
|
|
93
|
+
mergeSiblingThreshold?: number;
|
|
94
|
+
/**
|
|
95
|
+
* 同级合并的“负优化”防护:若合并后的父路径估算体积大于子路径体积之和 * ratio,则不合并。
|
|
96
|
+
*/
|
|
97
|
+
mergeSiblingMaxInflationRatio?: number;
|
|
98
|
+
/**
|
|
99
|
+
* 同级合并的“负优化”防护:若父路径估算体积超过该值,则不合并。
|
|
100
|
+
*/
|
|
101
|
+
mergeSiblingMaxParentBytes?: number;
|
|
102
|
+
/**
|
|
103
|
+
* 是否在父值为数组时跳过同级合并(默认 true)。
|
|
104
|
+
*/
|
|
105
|
+
mergeSiblingSkipArray?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* patch 模式优化:computed 变更对比策略。
|
|
108
|
+
*
|
|
109
|
+
* - reference:仅 `Object.is` 比较(最快,可能会多下发)
|
|
110
|
+
* - shallow:仅比较数组/对象第一层(折中)
|
|
111
|
+
* - deep:深比较(可能较慢,适合小对象);会受 `computedCompareMaxDepth/maxKeys` 限制
|
|
112
|
+
*/
|
|
113
|
+
computedCompare?: 'reference' | 'shallow' | 'deep';
|
|
114
|
+
/**
|
|
115
|
+
* computed 深比较最大深度(仅在 `computedCompare = "deep"` 时生效)。
|
|
116
|
+
*/
|
|
117
|
+
computedCompareMaxDepth?: number;
|
|
118
|
+
/**
|
|
119
|
+
* computed 深比较最多比较 key 数(仅在 `computedCompare = "deep"` 时生效)。
|
|
120
|
+
*/
|
|
121
|
+
computedCompareMaxKeys?: number;
|
|
122
|
+
/**
|
|
123
|
+
* 限制 patch 模式的预链接(prelinkReactiveTree)开销:最多向下遍历的深度(root 为 0)。
|
|
124
|
+
*/
|
|
125
|
+
prelinkMaxDepth?: number;
|
|
126
|
+
/**
|
|
127
|
+
* 限制 patch 模式的预链接(prelinkReactiveTree)开销:最多索引的节点数。
|
|
128
|
+
*/
|
|
129
|
+
prelinkMaxKeys?: number;
|
|
130
|
+
/**
|
|
131
|
+
* setData 调试信息回调(用于观测 patch 命中率/回退原因/payload 大小)。
|
|
132
|
+
*/
|
|
133
|
+
debug?: (info: SetDataDebugInfo) => void;
|
|
134
|
+
/**
|
|
135
|
+
* 内建诊断日志开关(默认 off)。
|
|
136
|
+
*
|
|
137
|
+
* - off:关闭内建日志
|
|
138
|
+
* - fallback:仅在回退 diff / 超阈值时输出
|
|
139
|
+
* - always:每次 flush 都输出
|
|
140
|
+
*/
|
|
141
|
+
diagnostics?: 'off' | 'fallback' | 'always';
|
|
142
|
+
/**
|
|
143
|
+
* 疑似运行时更新循环诊断。
|
|
144
|
+
*
|
|
145
|
+
* 在短时间内连续触发 setData flush 时输出告警,帮助定位页面/组件、
|
|
146
|
+
* 调度模式、patch 信号和 computed dirty 状态。
|
|
147
|
+
*/
|
|
148
|
+
loopWarning?: boolean | {
|
|
149
|
+
/**
|
|
150
|
+
* 是否启用告警。
|
|
151
|
+
* @default true
|
|
152
|
+
*/
|
|
153
|
+
enabled?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* 统计窗口(毫秒)。
|
|
156
|
+
* @default 1000
|
|
157
|
+
*/
|
|
158
|
+
sampleWindowMs?: number;
|
|
159
|
+
/**
|
|
160
|
+
* 窗口内超过该次数触发告警。
|
|
161
|
+
* @default 50
|
|
162
|
+
*/
|
|
163
|
+
maxFlushes?: number;
|
|
164
|
+
/**
|
|
165
|
+
* 告警冷却时间(毫秒),避免刷屏。
|
|
166
|
+
* @default 5000
|
|
167
|
+
*/
|
|
168
|
+
coolDownMs?: number;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* debug 触发时机:
|
|
172
|
+
* - fallback:仅在回退 diff / 超阈值时触发(默认)
|
|
173
|
+
* - always:每次 flush 都触发
|
|
174
|
+
*/
|
|
175
|
+
debugWhen?: 'fallback' | 'always';
|
|
176
|
+
/**
|
|
177
|
+
* debug 采样率(0-1),用于降低 debug 频率与开销(默认 1)。
|
|
178
|
+
*/
|
|
179
|
+
debugSampleRate?: number;
|
|
180
|
+
/**
|
|
181
|
+
* patch 模式优化:当某个顶层字段下的变更路径数量过多时,直接提升为顶层字段整体替换。
|
|
182
|
+
*/
|
|
183
|
+
elevateTopKeyThreshold?: number;
|
|
184
|
+
/**
|
|
185
|
+
* setData 序列化上限:最大递归深度(root 为 0)。超过时将停止深拷贝,保留更浅层结构。
|
|
186
|
+
*/
|
|
187
|
+
toPlainMaxDepth?: number;
|
|
188
|
+
/**
|
|
189
|
+
* setData 序列化上限:最多处理的对象 key 数(累计)。超过时将停止深拷贝,保留更浅层结构。
|
|
190
|
+
*/
|
|
191
|
+
toPlainMaxKeys?: number;
|
|
192
|
+
/**
|
|
193
|
+
* 是否允许函数进入 setData 快照。
|
|
194
|
+
*
|
|
195
|
+
* @internal
|
|
196
|
+
*/
|
|
197
|
+
includeFunctions?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* 允许函数进入 setData 快照的状态路径。
|
|
200
|
+
*
|
|
201
|
+
* @internal
|
|
202
|
+
*/
|
|
203
|
+
functionPaths?: string[];
|
|
204
|
+
}
|
|
205
|
+
interface SetDataDebugInfo {
|
|
206
|
+
mode: 'patch' | 'diff';
|
|
207
|
+
reason: 'patch' | 'diff' | 'needsFullSnapshot' | 'maxPatchKeys' | 'maxPayloadBytes' | 'loopWarning';
|
|
208
|
+
pendingPatchKeys: number;
|
|
209
|
+
payloadKeys: number;
|
|
210
|
+
estimatedBytes?: number;
|
|
211
|
+
bytes?: number;
|
|
212
|
+
mergedSiblingParents?: number;
|
|
213
|
+
computedDirtyKeys?: number;
|
|
214
|
+
flushCount?: number;
|
|
215
|
+
windowMs?: number;
|
|
216
|
+
targetLabel?: string;
|
|
217
|
+
message?: string;
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
220
|
+
export { SetDataDebugInfo, SetDataSnapshotOptions };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract } from "./types/miniprogramHostSources.mjs";
|
|
2
|
+
import { HostMiniProgramAddToFavoritesOption, HostMiniProgramAppOptions, HostMiniProgramAppTrivialInstance, HostMiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray, HostMiniProgramComponentInstance, HostMiniProgramComponentMethodOption, HostMiniProgramComponentPropertyOption, HostMiniProgramComponentPropertyValue, HostMiniProgramComponentShortProperty, HostMiniProgramComponentTrivialInstance, HostMiniProgramComponentTrivialOption, HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption, HostMiniProgramNodesRef, HostMiniProgramNodesRefFields, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramPageTrivialInstance, HostMiniProgramReLaunchOption, HostMiniProgramRedirectToOption, HostMiniProgramRouter, HostMiniProgramSaveExitState, HostMiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramTriggerEventOptions, HostMiniProgramUnhandledRejectionResult } from "./types/miniprogramHost.mjs";
|
|
3
|
+
import { MiniProgramAdapter, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, MiniProgramComponentInstance, MiniProgramComponentOptions, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, MiniProgramInstance, MiniProgramPageLifetimes } from "./types/miniprogram.mjs";
|
|
4
|
+
import { ComponentPropsOptions, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InferNativePropType, InferNativeProps, InferPropType, InferProps, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, PropConstructor, PropOptions, PropType } from "./types/props/propTypes.mjs";
|
|
5
|
+
import { MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, SetupContextRouter, WevuTypedRouterRouteMap } from "./types/props/router.mjs";
|
|
6
|
+
import { ComponentPublicInstance, ComputedDefinitions, ExtractComputed, ExtractMethods, MethodDefinitions, ModelBinding, ModelBindingOptions, ModelBindingPayload } from "./types/core.mjs";
|
|
7
|
+
import { AppConfig, InternalRuntimeState, InternalRuntimeStateFields, RuntimeApp, RuntimeInstance, WevuPlugin } from "./types/runtime.mjs";
|
|
8
|
+
import { SetupContext, SetupContextNativeInstance, SetupFunction } from "./types/props/setup.mjs";
|
|
9
|
+
import "./types/props.mjs";
|
|
10
|
+
import { AllowedComponentProps, ComponentCustomProps, ComponentOptionsMixin, DefineComponent, NativeComponent, ObjectDirective, PublicProps, ShallowUnwrapRef, VNode, VNodeProps } from "../vue-types.mjs";
|
|
11
|
+
import { SetDataDebugInfo, SetDataSnapshotOptions } from "./types/setData.mjs";
|
|
12
|
+
import { CreateAppOptions, DataOption, DefineAppOptions, DefineComponentOptions, PageFeatures } from "./types/options.mjs";
|
|
13
|
+
//#region src/runtime/types.d.ts
|
|
14
|
+
interface WevuGlobalComponents {}
|
|
15
|
+
interface WevuGlobalDirectives {}
|
|
16
|
+
interface GlobalComponents extends WevuGlobalComponents {}
|
|
17
|
+
interface GlobalDirectives extends WevuGlobalDirectives {}
|
|
18
|
+
interface TemplateRefs {}
|
|
19
|
+
interface TemplateRefValue {
|
|
20
|
+
selector: string;
|
|
21
|
+
boundingClientRect: (cb?: (value: HostMiniProgramBoundingClientRectResult | null) => void) => Promise<HostMiniProgramBoundingClientRectResult | null>;
|
|
22
|
+
scrollOffset: (cb?: (value: HostMiniProgramScrollOffsetResult | null) => void) => Promise<HostMiniProgramScrollOffsetResult | null>;
|
|
23
|
+
fields: (fields: HostMiniProgramNodesRefFields, cb?: (value: any) => void) => Promise<any | null>;
|
|
24
|
+
node: (cb?: (value: any) => void) => Promise<any | null>;
|
|
25
|
+
}
|
|
26
|
+
type MiniProgramTemplateRefValue = TemplateRefValue;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type ComponentCustomProps, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComputedDefinitions, type CreateAppOptions, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, type ObjectDirective, type PageFeatures, type PropConstructor, type PropOptions, type PropType, type PublicProps, type RuntimeApp, type RuntimeInstance, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextNativeInstance, type SetupContextRouter, type SetupFunction, type ShallowUnwrapRef, TemplateRefValue, TemplateRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, type VNode, type VNodeProps, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, WevuGlobalComponents, WevuGlobalDirectives, type WevuPlugin, type WevuTypedRouterRouteMap };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=new Map,t=new WeakMap;function n(e,t=0){let n=Number(e);return Number.isFinite(n)&&n>=0?n:t}function r(e){let t=String(e||`en`).trim().replace(`_`,`-`).toLowerCase();return t===`zh-tw`||t===`zh-hk`||t===`zh-mo`||t.startsWith(`zh-hant`)?`zh-Hant`:t.startsWith(`zh`)?`zh-Hans`:t.split(`-`)[0]||`en`}function i(e={}){var t;if(e.safeAreaInsets)return e;let r=n(e.windowWidth,n(e.screenWidth)),i=n(e.windowHeight,n(e.screenHeight)),a=n(e.screenWidth,r),o=n(e.screenHeight,i),s=(t=e.safeArea)==null?{bottom:i,left:0,right:r,top:0}:t;return{...e,safeArea:s,safeAreaInsets:{bottom:Math.max(0,o-n(s.bottom,i)),left:n(s.left),right:Math.max(0,a-n(s.right,r)),top:n(s.top)}}}function a(t,n){var r;if(typeof t!=`string`||typeof n!=`function`)return;let i=(r=e.get(t))==null?new Set:r;i.add({handler:n,original:n}),e.set(t,i)}function o(t,n){if(t===void 0){e.clear();return}if(typeof t!=`string`)return;if(typeof n!=`function`){e.delete(t);return}let r=e.get(t);if(r){for(let e of r)(e.original===n||e.handler===n)&&r.delete(e);r.size===0&&e.delete(t)}}function s(t,n){var r;if(typeof t!=`string`||typeof n!=`function`)return;let i=(...e)=>{o(t,n),n(...e)},a=(r=e.get(t))==null?new Set:r;a.add({handler:i,original:n}),e.set(t,a)}function c(t,...n){let r=e.get(t);if(r)for(let{handler:e}of[...r])e(...n)}function l(e){let l=t.get(e);if(l)return l;let u=Object.create(e);t.set(e,u);let d=()=>{var t,n;return i((t=(n=e.getSystemInfoSync)==null?void 0:n.call(e))==null?{}:t)};return Object.assign(u,{$emit:c,$off:o,$on:a,$once:s,getLocale(){var t,n;return typeof e.getLocale==`function`?r(e.getLocale()):r((t=(n=e.getAppBaseInfo)==null?void 0:n.call(e).language)==null?d().language:t)},getSystemInfoSync:d,getWindowInfo(){var t,n;return i((t=(n=e.getWindowInfo)==null?void 0:n.call(e))==null?d():t)},rpx2px(e){let t=n(d().windowWidth);return Number.isFinite(e)&&t>0?e*t/750:0}}),u}export{l as createUniAppHost};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/runtime/updatePerformance.d.ts
|
|
2
|
+
type UpdatePerformanceListenerResult = Record<string, any>;
|
|
3
|
+
type UpdatePerformanceListener = (result: UpdatePerformanceListenerResult) => void;
|
|
4
|
+
type UseUpdatePerformanceListenerStopHandle = () => void;
|
|
5
|
+
/**
|
|
6
|
+
* 在 setup 中注册更新性能监听,并在卸载时自动清理。
|
|
7
|
+
*
|
|
8
|
+
* - 底层能力:`instance.setUpdatePerformanceListener(listener)`。
|
|
9
|
+
* - 清理策略:卸载时回传 `undefined` 作为监听器,平台不支持时静默降级。
|
|
10
|
+
*/
|
|
11
|
+
declare function useUpdatePerformanceListener(listener: UpdatePerformanceListener): UseUpdatePerformanceListenerStopHandle;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { UpdatePerformanceListener, UpdatePerformanceListenerResult, UseUpdatePerformanceListenerStopHandle, useUpdatePerformanceListener };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentInstance as e}from"./hooks/base.mjs";import{onDetached as t,onUnload as n}from"./hooks/register.mjs";function r(e){let t=e,n=t.setUpdatePerformanceListener;if(typeof n==`function`)return e=>{n.call(t,e)}}function i(i){let a=e();if(!a)throw Error(`useUpdatePerformanceListener() 必须在 setup() 的同步阶段调用`);if(typeof i!=`function`)throw TypeError(`useUpdatePerformanceListener() 需要传入监听函数`);let o=r(a);if(!o)throw Error(`当前实例不支持 setUpdatePerformanceListener,请检查基础库版本或组件上下文`);o(i);let s=!1,c=()=>{if(!s){s=!0;try{o(void 0)}catch(e){}}};return n(c),t(c),c}export{i as useUpdatePerformanceListener};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RuntimeApp, WevuPlugin } from "./types/runtime.mjs";
|
|
2
|
+
import "./types.mjs";
|
|
3
|
+
//#region src/runtime/use.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* 在 `app` 级 `setup()` 中显式获取运行时 app,提供与 `app.use()` / `app.provide()` 对齐的 SFC 写法。
|
|
6
|
+
*/
|
|
7
|
+
declare function defineAppSetup<T>(setup: (app: RuntimeApp<any, any, any>) => T): T;
|
|
8
|
+
/**
|
|
9
|
+
* 在 `app` 级 `setup()` 中安装插件,提供与 `app.use()` 对齐的 SFC 调用方式。
|
|
10
|
+
*/
|
|
11
|
+
declare function use(plugin: WevuPlugin, ...options: any[]): RuntimeApp<any, any, any>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { defineAppSetup, use };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentInstance as e}from"./hooks/base.mjs";import{WEVU_IS_APP_INSTANCE_KEY as t,WEVU_RUNTIME_APP_KEY as n}from"@weapp-core/constants";function r(){let r=e();if(r!=null&&r[t]&&r[n])return r[n];throw Error(`defineAppSetup() / use() 只能在 app setup 上下文中调用`)}function i(e){return e(r())}function a(e,...t){return r().use(e,...t)}export{i as defineAppSetup,a as use};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SetupContextNativeInstance } from "../types/props/setup.mjs";
|
|
2
|
+
import "../types.mjs";
|
|
3
|
+
//#region src/runtime/vueCompat/context.d.ts
|
|
4
|
+
declare function useAttrs(): Record<string, any>;
|
|
5
|
+
declare function useSlots(): Record<string, any>;
|
|
6
|
+
declare function useNativeInstance(): SetupContextNativeInstance;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { useAttrs, useNativeInstance, useSlots };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentSetupContext as e}from"../hooks/base.mjs";const t=Object.freeze(Object.create(null));function n(){var t;let n=e();if(!n)throw Error(`useAttrs() 必须在 setup() 的同步阶段调用`);return(t=n.attrs)==null?{}:t}function r(){var n;let r=e();if(!r)throw Error(`useSlots() 必须在 setup() 的同步阶段调用`);return(n=r.slots)==null?t:n}function i(){let t=e();if(!(t!=null&&t.instance))throw Error(`useNativeInstance() 必须在 setup() 的同步阶段调用`);return t.instance}export{n as useAttrs,i as useNativeInstance,r as useSlots};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Ref } from "../../reactivity/ref.mjs";
|
|
2
|
+
import "../../reactivity/index.mjs";
|
|
3
|
+
import { ModelBinding, ModelBindingOptions, ModelBindingPayload } from "../types/core.mjs";
|
|
4
|
+
import "../types.mjs";
|
|
5
|
+
//#region src/runtime/vueCompat/model.d.ts
|
|
6
|
+
type ModelModifiers<M extends PropertyKey = string> = Record<M, true | undefined>;
|
|
7
|
+
type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [ModelRef<T, M, G, S>, ModelModifiers<M>];
|
|
8
|
+
interface UseModelOptions<T, M extends PropertyKey = string, G = T, S = T> {
|
|
9
|
+
get?: (value: T, modifiers: ModelModifiers<M>) => G;
|
|
10
|
+
set?: (value: S, modifiers: ModelModifiers<M>) => T;
|
|
11
|
+
}
|
|
12
|
+
declare function useModel<T = any, M extends PropertyKey = string>(props: Record<string, any>, name: string): ModelRef<T, M, T, T>;
|
|
13
|
+
declare function useModel<T = any, M extends PropertyKey = string, G = T, S = T>(props: Record<string, any>, name: string, options: UseModelOptions<T, M, G, S>): ModelRef<T, M, G, S>;
|
|
14
|
+
/**
|
|
15
|
+
* useBindModel 返回绑定到当前运行时实例的 bindModel。
|
|
16
|
+
* 该方法必须在 setup() 的同步阶段调用。
|
|
17
|
+
*/
|
|
18
|
+
type BindModelWithHelper<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'> = (<T = any>(path: string, options?: ModelBindingOptions<T>) => ModelBinding<T>) & {
|
|
19
|
+
model: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => ModelBindingPayload<T, Event, ValueProp, Formatted>;
|
|
20
|
+
value: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => Formatted;
|
|
21
|
+
on: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => (event: any) => void;
|
|
22
|
+
};
|
|
23
|
+
declare function useBindModel<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'>(defaultOptions?: ModelBindingOptions<any, DefaultEvent, DefaultValueProp, any>): BindModelWithHelper<DefaultEvent, DefaultValueProp>;
|
|
24
|
+
/**
|
|
25
|
+
* useChangeModel 返回以 change 事件为默认更新事件的 model 绑定助手。
|
|
26
|
+
*/
|
|
27
|
+
declare function useChangeModel(): <T = any, ValueProp extends string = "value", Formatted = T>(path: string, options?: ModelBindingOptions<T, "change", ValueProp, Formatted>) => ModelBindingPayload<T, "change", ValueProp, Formatted>;
|
|
28
|
+
declare function mergeModels<T>(a: T, b: T): T;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ModelModifiers, ModelRef, UseModelOptions, mergeModels, useBindModel, useChangeModel, useModel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{customRef as e}from"../../reactivity/ref.mjs";import{getCurrentInstance as t,getCurrentSetupContext as n}from"../hooks/base.mjs";import{capitalize as r}from"../../utils.mjs";const i=Object.freeze(Object.create(null));function a(e,t){let n=t===`modelValue`?`modelModifiers`:`${t}Modifiers`,r=e==null?void 0:e[n];return!r||typeof r!=`object`?i:r}function o(e,t){let n=e;try{Object.defineProperty(n,Symbol.iterator,{configurable:!0,value:()=>{let e=0;return{next:()=>e===0?(e+=1,{value:n,done:!1}):e===1?(e+=1,{value:t(),done:!1}):{value:void 0,done:!0}}}})}catch(e){}return n}function s(t,r,i={}){let s=n();if(!s)throw Error(`useModel() 必须在 setup() 的同步阶段调用`);let c=s.emit,l=`update:${r}`,u=()=>a(t,r);return o(e({get:()=>{let e=t==null?void 0:t[r];return i.get?i.get(e,u()):e},set:e=>{let t=i.set?i.set(e,u()):e;c==null||c(l,t)}}),u)}function c(e){let n=t();if(!(n!=null&&n.__wevu)||typeof n.__wevu.bindModel!=`function`)throw Error(`useBindModel() 必须在 setup() 的同步阶段调用`);let i=n.__wevu.bindModel.bind(n.__wevu),a=((t,n)=>{if(!e)return i(t,n);let r={...e,...n};return i(t,r)});return a.model=(e,t)=>a(e).model(t),a.value=(t,n)=>{var r;let i={...e,...n},o=(r=i==null?void 0:i.valueProp)==null?`value`:r;return a.model(t,n)[o]},a.on=(t,n)=>{var i;let o={...e,...n},s=(i=o==null?void 0:o.event)==null?`input`:i,c=`on${r(s)}`;return a.model(t,n)[c]},a}function l(){let e=c({event:`change`});return function(t,n){return e.model(t,n)}}function u(e,t){return e==null?t:t==null?e:Array.isArray(e)&&Array.isArray(t)?[...new Set([...e,...t])]:typeof e==`object`&&typeof t==`object`?{...e,...t}:t}export{u as mergeModels,c as useBindModel,l as useChangeModel,s as useModel};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SetupContextRouter } from "../types/props/router.mjs";
|
|
2
|
+
import "../types.mjs";
|
|
3
|
+
//#region src/runtime/vueCompat/router.d.ts
|
|
4
|
+
type RuntimeRouter = SetupContextRouter;
|
|
5
|
+
/**
|
|
6
|
+
* 在 setup 中获取与当前组件路径语义一致的原生 Router 对象。
|
|
7
|
+
*
|
|
8
|
+
* - 优先使用实例上的 `this.router`(组件路径语义)。
|
|
9
|
+
* - 不可用时回退到 `this.pageRouter`。
|
|
10
|
+
* - 低版本基础库再回退到宿主全局路由方法。
|
|
11
|
+
*
|
|
12
|
+
* 如需更贴近 Vue Router 的高阶能力(导航守卫、失败类型、统一解析),
|
|
13
|
+
* 推荐改用 `wevu/router` 子入口的 `useRouter()`。
|
|
14
|
+
*/
|
|
15
|
+
declare function useNativeRouter(): RuntimeRouter;
|
|
16
|
+
/**
|
|
17
|
+
* 在 setup 中获取与当前页面路径语义一致的原生 Router 对象。
|
|
18
|
+
*
|
|
19
|
+
* - 优先使用实例上的 `this.pageRouter`(页面路径语义)。
|
|
20
|
+
* - 不可用时回退到 `this.router`。
|
|
21
|
+
* - 低版本基础库再回退到宿主全局路由方法。
|
|
22
|
+
*
|
|
23
|
+
* 如需更贴近 Vue Router 的高阶能力(导航守卫、失败类型、统一解析),
|
|
24
|
+
* 推荐改用 `wevu/router` 子入口的 `useRouter()`。
|
|
25
|
+
*/
|
|
26
|
+
declare function useNativePageRouter(): RuntimeRouter;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { useNativePageRouter, useNativeRouter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentMiniProgramGlobalRouter as e}from"../platform.mjs";import{getCurrentSetupContext as t}from"../hooks/base.mjs";import{notifyRouteStateSync as n}from"../../router/routeSync.mjs";import{createAbsoluteRoutePath as r,resolvePath as i}from"../../routerInternal/path.mjs";import{stringifyQuery as a}from"../../routerInternal/query.mjs";import{parsePathInput as o}from"../../routerInternal/location.mjs";const s=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],c=new WeakMap;function l(e){return!e||typeof e!=`object`?!1:s.every(t=>typeof e[t]==`function`)}function u(){return e()}function d(e){if(!(typeof e!=`string`||!e))return i(e,``)||void 0}function f(e,t){let n=t===`pageRouter`?[e.route,e.__route__,e.is]:[e.is,e.route,e.__route__];for(let e of n){let t=d(e);if(t)return t}}function p(e,t){if(!t||!e.startsWith(`./`)&&!e.startsWith(`../`))return e;let{path:n,query:s,hash:c}=o(e),l=r(i(n,t)),u=a(s);return`${l}${u?`?${u}`:``}${c}`}function m(e,t){let r=t==null?``:t,i=c.get(e),a=i==null?void 0:i.get(r);if(a)return a;let o=Object.create(null);for(let r of s)o[r]=i=>{let a=e[r];if(r===`navigateBack`||!i||typeof i!=`object`)return a.call(e,i);let o=typeof i.url==`string`?p(i.url,t):i.url,s=i.success,c={...i,url:o,success:(...e)=>(typeof o==`string`&&n({method:r,source:`native`,url:o}),typeof s==`function`?s(...e):void 0)};return a.call(e,c)};let l=i==null?new Map:i;return l.set(r,o),c.set(e,l),o}function h(e,n,r){let i=t();if(!(i!=null&&i.instance))throw Error(`${r}() 必须在 setup() 的同步阶段调用`);let a=i.instance,o=f(a,e),s=a[e];if(l(s))return m(s,o);let c=a[n];if(l(c))return m(c,o);let d=u();if(d)return m(d,o);throw Error(`当前运行环境不支持 Router,请升级宿主基础库或检查平台路由能力`)}function g(){return h(`router`,`pageRouter`,`useNativeRouter`)}function _(){return h(`pageRouter`,`router`,`useNativePageRouter`)}export{_ as useNativePageRouter,g as useNativeRouter};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ShallowRef } from "../../reactivity/ref.mjs";
|
|
2
|
+
import "../../reactivity/index.mjs";
|
|
3
|
+
import { TemplateRefs } from "../types.mjs";
|
|
4
|
+
//#region src/runtime/vueCompat/templateRef.d.ts
|
|
5
|
+
type TemplateRef<T = unknown> = Readonly<ShallowRef<T | null>>;
|
|
6
|
+
declare function useTemplateRef<K extends keyof TemplateRefs>(name: K): TemplateRef<TemplateRefs[K]>;
|
|
7
|
+
declare function useTemplateRef<T = unknown>(name: string): TemplateRef<T>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { TemplateRef, useTemplateRef };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{shallowRef as e}from"../../reactivity/shallowRef.mjs";import{getCurrentInstance as t}from"../hooks/base.mjs";import{WEVU_TEMPLATE_REF_MAP_KEY as n}from"@weapp-core/constants";function r(e){let t=e[n];if(t)return t;let r=new Map;try{Object.defineProperty(e,n,{value:r,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[n]=r}return r}function i(n){let i=t();if(!i)throw Error(`useTemplateRef() 必须在 setup() 的同步阶段调用`);let a=typeof n==`string`?n.trim():``;if(!a)throw Error(`useTemplateRef() 需要传入有效的模板 ref 名称`);let o=r(i),s=o.get(a);if(s)return s;let c=e(null);return o.set(a,c),c}export{i as useTemplateRef};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { useAttrs, useNativeInstance, useSlots } from "./vueCompat/context.mjs";
|
|
2
|
+
import { ModelModifiers, ModelRef, UseModelOptions, mergeModels, useBindModel, useChangeModel, useModel } from "./vueCompat/model.mjs";
|
|
3
|
+
import { useNativePageRouter, useNativeRouter } from "./vueCompat/router.mjs";
|
|
4
|
+
import { TemplateRef, useTemplateRef } from "./vueCompat/templateRef.mjs";
|
|
5
|
+
export { type ModelModifiers, type TemplateRef, type UseModelOptions, mergeModels, useAttrs, useBindModel, useChangeModel, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useSlots, useTemplateRef };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=Promise.resolve(),t=new Set,n=new Set;let r=!1,i=!1,a,o;function s(){i=!1,r=!0,a=new Set;let e=!1,o=!1,c,l=[];try{t.forEach(e=>{a==null||a.add(e);try{let t=e();t&&typeof t.then==`function`&&l.push(t)}catch(e){o||(o=!0,c=e)}})}finally{t.clear(),a=void 0,r=!1,n.size&&(n.forEach(e=>t.add(e)),n.clear(),i=!0,e=!0)}if(l.length||e)return Promise.all(l).then(()=>e?s():void 0).then(()=>{if(o)throw c},e=>{throw o?c:e});if(o)throw c}function c(){let t=e.then(s);o=t;let n=()=>{o===t&&(o=void 0)};t.then(n,n)}function l(e){if(r&&a!=null&&a.has(e)){n.add(e);return}t.add(e),!r&&!i&&(i=!0,c())}function u(t){var n;let r=(n=o)==null?e:n;return t?r.then(t):r}export{u as nextTick,l as queueJob};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,n,r){return function(...i){let a=[],o=[],s=e=>a.push(e),c=e=>o.push(e);r.forEach(n=>{try{n({name:t,store:e,args:i,after:s,onError:c})}catch(e){}});let l;try{l=n.apply(e,i)}catch(e){throw o.forEach(t=>t(e)),e}let u=e=>(a.forEach(t=>t(e)),e);return l&&typeof l.then==`function`?l.then(e=>u(e),e=>(o.forEach(t=>t(e)),Promise.reject(e))):u(l)}}export{e as wrapAction};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isObject as e,mergeShallow as t}from"./utils.mjs";function n(n,r,i,a){let o={$id:n};Object.defineProperty(o,"$state",{get(){return r},set(n){r&&e(n)&&(t(r,n),i(`patch object`))}}),o.$patch=e=>{if(!r){typeof e==`function`?(e(o),i(`patch function`)):(t(o,e),i(`patch object`));return}typeof e==`function`?(e(r),i(`patch function`)):(t(r,e),i(`patch object`))},a&&(o.$reset=()=>a());let s=new Set;o.$subscribe=(e,t)=>(s.add(e),()=>s.delete(e));let c=new Set;return o.$onAction=e=>(c.add(e),()=>c.delete(e)),{api:o,subs:s,actionSubs:c}}export{n as createBaseApi};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{effect as e}from"../../reactivity/core.mjs";import{toRaw as t}from"../../reactivity/reactive/shared.mjs";import{touchReactive as n}from"../../reactivity/reactive/patch.mjs";import{reactive as r}from"../../reactivity/reactive.mjs";import{computed as i}from"../../reactivity/computed.mjs";import{wrapAction as a}from"../actions.mjs";import{cloneDeep as o,resetObject as s}from"../utils.mjs";import{createBaseApi as c}from"../base.mjs";import{createSafeNotifier as l}from"./shared.mjs";function u(u,d,f){var p,m,h;let g=d.state?d.state():{},_=r(g),v=o(t(g)),y=()=>{},b=c(u,_,e=>y(e),()=>{s(_,v),y(`patch object`)}),x=!1,S=b.api.$patch;if(b.api.$patch=e=>{x=!0;try{S(e)}finally{x=!1}},typeof b.api.$reset==`function`){let e=b.api.$reset;b.api.$reset=()=>{x=!0;try{e()}finally{x=!1}}}y=l(u,b.subs,()=>_);let C={};for(let e of Object.getOwnPropertyNames(b.api)){let t=Object.getOwnPropertyDescriptor(b.api,e);t&&(e===`$state`?Object.defineProperty(C,e,{enumerable:t.enumerable,configurable:t.configurable,get(){return b.api.$state},set(e){x=!0;try{b.api.$state=e}finally{x=!1}}}):Object.defineProperty(C,e,t))}let w=(p=d.getters)==null?{}:p;Object.keys(w).forEach(e=>{let t=w[e];if(typeof t==`function`){let n=i(()=>t.call(C,_));Object.defineProperty(C,e,{enumerable:!0,configurable:!0,get(){return n.value}})}});let T=(m=d.actions)==null?{}:m;Object.keys(T).forEach(e=>{let t=T[e];if(typeof t==`function`){let n=a(C,e,(...e)=>t.apply(C,e),b.actionSubs);C[e]=n}}),Object.keys(_).forEach(e=>{Object.defineProperty(C,e,{enumerable:!0,configurable:!0,get(){return _[e]},set(t){_[e]=t}})});let E=!1,D=!1;e(()=>{if(n(_),!E){E=!0;return}if(!(x||D)){D=!0;try{y(`direct`)}finally{D=!1}}});let O=(h=f==null?void 0:f._plugins)==null?[]:h;for(let e of O)try{e({store:C})}catch(e){}return C}export{u as createOptionsStyleStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{effect as e}from"../../reactivity/core.mjs";import{touchReactive as t}from"../../reactivity/reactive/patch.mjs";import{isReactive as n}from"../../reactivity/reactive.mjs";import{isRef as r}from"../../reactivity/ref.mjs";import{wrapAction as i}from"../actions.mjs";import{cloneDeep as a,resetObject as o}from"../utils.mjs";import{createBaseApi as s}from"../base.mjs";import{createSafeNotifier as c,isTrackableRef as l,snapshotValue as u}from"./shared.mjs";function d(d,f,p){var m;let h=f(),g=()=>{},_=new Map;Object.keys(h).forEach(e=>{let t=h[e];typeof t==`function`||e.startsWith(`$`)||r(t)&&!l(t)||_.set(e,u(t))});let v={},y=s(d,void 0,e=>g(e),()=>{_.forEach((e,t)=>{let i=v[t];if(l(i)){try{i.value=a(e)}catch(e){}return}if(n(i)){o(i,e);return}r(i)||(v[t]=a(e))}),g(`patch object`)}),b=!1,x=y.api.$patch;if(y.api.$patch=e=>{b=!0;try{x(e)}finally{b=!1}},typeof y.api.$reset==`function`){let e=y.api.$reset;y.api.$reset=()=>{b=!0;try{e()}finally{b=!1}}}v={...h},g=c(d,y.subs,()=>v);for(let e of Object.getOwnPropertyNames(y.api)){let t=Object.getOwnPropertyDescriptor(y.api,e);t&&(e===`$state`?Object.defineProperty(v,e,{enumerable:t.enumerable,configurable:t.configurable,get(){return y.api.$state},set(e){b=!0;try{y.api.$state=e}finally{b=!1}}}):Object.defineProperty(v,e,t))}let S=[];Object.keys(h).forEach(e=>{let t=h[e];if(typeof t==`function`&&!e.startsWith(`$`)){v[e]=i(v,e,t,y.actionSubs);return}if(l(t)){S.push(t);return}if(n(t)){S.push(t);return}if(!r(t)&&!e.startsWith(`$`)){let n=t;Object.defineProperty(v,e,{enumerable:!0,configurable:!0,get(){return n},set(e){n=e,b||g(`direct`)}})}});let C=!1;if(S.length>0){let n=!1;e(()=>{if(S.forEach(e=>{l(e)?e.value:t(e)}),!n){n=!0;return}if(!(b||C)){C=!0;try{g(`direct`)}finally{C=!1}}})}let w=(m=p==null?void 0:p._plugins)==null?[]:m;for(let e of w)try{e({store:v})}catch(e){}return v}export{d as createSetupStyleStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toRaw as e}from"../../reactivity/reactive/shared.mjs";import{isReactive as t}from"../../reactivity/reactive.mjs";import{isRef as n}from"../../reactivity/ref.mjs";import{cloneDeep as r}from"../utils.mjs";function i(e){return n(e)}function a(n){return t(n)?r(e(n)):i(n)?r(n.value):r(n)}function o(e,t,n){let r=!1;return i=>{if(!r){r=!0;try{let r=n();t.forEach(t=>{try{t({type:i,storeId:e},r)}catch(e){}})}finally{r=!1}}}}export{o as createSafeNotifier,i as isTrackableRef,a as snapshotValue};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ActionSubscriber, DefineStoreOptions, StoreGetters, StoreSubscribeOptions, SubscriptionCallback } from "./types.mjs";
|
|
2
|
+
//#region src/store/define.d.ts
|
|
3
|
+
type SetupDefinition<T> = () => T;
|
|
4
|
+
/**
|
|
5
|
+
* @description 定义一个 setup 风格的 store
|
|
6
|
+
*/
|
|
7
|
+
declare function defineStore<T extends Record<string, any>>(id: string, setup: SetupDefinition<T>): () => T & {
|
|
8
|
+
$id: string;
|
|
9
|
+
$patch: (patch: Record<string, any> | ((state: any) => void)) => void;
|
|
10
|
+
$reset: () => void;
|
|
11
|
+
$subscribe: (cb: SubscriptionCallback<any>, opts?: StoreSubscribeOptions) => () => void;
|
|
12
|
+
$onAction: (cb: ActionSubscriber<any>) => () => void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @description 定义一个 options 风格的 store
|
|
16
|
+
*/
|
|
17
|
+
declare function defineStore<S extends Record<string, any>, G extends Record<string, any>, A extends Record<string, any>>(id: string, options: DefineStoreOptions<S, G, A>): () => S & StoreGetters<G> & A & {
|
|
18
|
+
$id: string;
|
|
19
|
+
$state: S;
|
|
20
|
+
$patch: (patch: Partial<S> | ((state: S) => void)) => void;
|
|
21
|
+
$reset: () => void;
|
|
22
|
+
$subscribe: (cb: SubscriptionCallback<S>, opts?: StoreSubscribeOptions) => () => void;
|
|
23
|
+
$onAction: (cb: ActionSubscriber<S & StoreGetters<G> & A>) => () => void;
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { defineStore };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{effectScope as e}from"../reactivity/core.mjs";import{createOptionsStyleStore as t}from"./define/optionsStyle.mjs";import{createSetupStyleStore as n}from"./define/setupStyle.mjs";import{createStore as r}from"./manager.mjs";function i(i,a){let o,s=!1,c=r._instance;return function(){return s&&o?o:(s=!0,o=e(!0).run(()=>typeof a==`function`?n(i,a,c):t(i,a,c)),o)}}export{i as defineStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){let t={_stores:new Map,_plugins:[],install(e){},use(e){return typeof e==`function`&&t._plugins.push(e),t}};return e._instance=t,t}export{e as createStore};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ref } from "../reactivity/ref.mjs";
|
|
2
|
+
import "../reactivity/index.mjs";
|
|
3
|
+
//#region src/store/storeToRefs.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @description storeToRefs 返回类型推导
|
|
6
|
+
*/
|
|
7
|
+
type StoreToRefsResult<T extends Record<string, any>> = { [K in keyof T]: T[K] extends ((...args: any[]) => any) ? T[K] : T[K] extends Ref<infer V> ? Ref<V> : Ref<T[K]>; };
|
|
8
|
+
/**
|
|
9
|
+
* @description 将 store 状态转换为 Ref
|
|
10
|
+
*/
|
|
11
|
+
declare function storeToRefs<T extends Record<string, any>>(store: T): StoreToRefsResult<T>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { StoreToRefsResult, storeToRefs };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isRef as e}from"../reactivity/ref.mjs";import{computed as t}from"../reactivity/computed.mjs";function n(n){let r={};for(let i in n){let a=n[i];if(typeof a==`function`){r[i]=a;continue}r[i]=e(a)?a:t({get:()=>n[i],set:e=>{n[i]=e}})}return r}export{n as storeToRefs};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/store/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* @description Store 变更类型
|
|
4
|
+
*/
|
|
5
|
+
type MutationType = 'patch object' | 'patch function' | 'direct';
|
|
6
|
+
/**
|
|
7
|
+
* @description Store 订阅回调签名
|
|
8
|
+
*/
|
|
9
|
+
interface SubscriptionCallback<S = any> {
|
|
10
|
+
(mutation: {
|
|
11
|
+
type: MutationType;
|
|
12
|
+
storeId: string;
|
|
13
|
+
}, state: S): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @description Store 订阅选项
|
|
17
|
+
*/
|
|
18
|
+
interface StoreSubscribeOptions {
|
|
19
|
+
/**
|
|
20
|
+
* @description 是否在卸载后仍保留订阅(适用于跨页面生命周期的订阅)
|
|
21
|
+
*/
|
|
22
|
+
detached?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @description Action 订阅回调上下文
|
|
26
|
+
*/
|
|
27
|
+
interface ActionContext<TStore = any> {
|
|
28
|
+
name: string;
|
|
29
|
+
store: TStore;
|
|
30
|
+
args: any[];
|
|
31
|
+
after: (cb: (result: any) => void) => void;
|
|
32
|
+
onError: (cb: (error: any) => void) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @description Action 订阅回调类型
|
|
36
|
+
*/
|
|
37
|
+
interface ActionSubscriber<TStore = any> {
|
|
38
|
+
(context: ActionContext<TStore>): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @description Store 管理器(插件与共享实例)
|
|
42
|
+
*/
|
|
43
|
+
interface StoreManager {
|
|
44
|
+
install: (app: any) => void;
|
|
45
|
+
_stores: Map<string, any>;
|
|
46
|
+
use: (plugin: (context: {
|
|
47
|
+
store: any;
|
|
48
|
+
}) => void) => StoreManager;
|
|
49
|
+
_plugins: Array<(context: {
|
|
50
|
+
store: any;
|
|
51
|
+
}) => void>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @description Getter 定义集合
|
|
55
|
+
*/
|
|
56
|
+
type GetterTree<S extends Record<string, any>> = Record<string, (state: S) => any>;
|
|
57
|
+
/**
|
|
58
|
+
* @description 从 Getter 定义中推导返回类型
|
|
59
|
+
*/
|
|
60
|
+
type StoreGetters<G extends GetterTree<any>> = { [K in keyof G]: G[K] extends ((...args: any[]) => infer R) ? R : never; };
|
|
61
|
+
/**
|
|
62
|
+
* @description defineStore(options) 的配置类型
|
|
63
|
+
*/
|
|
64
|
+
interface DefineStoreOptions<S extends Record<string, any>, G extends GetterTree<S>, A extends Record<string, any>> {
|
|
65
|
+
state: () => S;
|
|
66
|
+
getters?: G & Record<string, (state: S) => any> & ThisType<S & StoreGetters<G> & A>;
|
|
67
|
+
actions?: A & ThisType<S & StoreGetters<G> & A>;
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { ActionContext, ActionSubscriber, DefineStoreOptions, GetterTree, MutationType, StoreGetters, StoreManager, StoreSubscribeOptions, SubscriptionCallback };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return typeof e==`object`&&!!e}function t(t){if(!e(t))return!1;let n=Object.getPrototypeOf(t);return n===Object.prototype||n===null}function n(e,t){for(let n in t)e[n]=t[n]}function r(e){if(Array.isArray(e))return e.map(e=>r(e));if(t(e)){let t={};for(let n in e)t[n]=r(e[n]);return t}return e}function i(n,a){if(Array.isArray(n)&&Array.isArray(a)){n.length=0,a.forEach((e,t)=>{n[t]=r(e)});return}if(e(a)){for(let e in n)e in a||delete n[e];for(let e in a){let o=a[e],s=n[e];if(Array.isArray(o)&&Array.isArray(s)){i(s,o);continue}if(t(o)&&t(s)){i(s,o);continue}n[e]=r(o)}}}export{r as cloneDeep,e as isObject,t as isPlainObject,n as mergeShallow,i as resetObject};
|
package/dist/store.d.mts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActionContext, ActionSubscriber, DefineStoreOptions, MutationType, StoreManager, StoreSubscribeOptions, SubscriptionCallback } from "./store/types.mjs";
|
|
2
|
+
import { defineStore } from "./store/define.mjs";
|
|
3
|
+
import { createStore } from "./store/manager.mjs";
|
|
4
|
+
import { StoreToRefsResult, storeToRefs } from "./store/storeToRefs.mjs";
|
|
2
5
|
export { type ActionContext, type ActionSubscriber, type DefineStoreOptions, type MutationType, type StoreManager, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, createStore, defineStore, storeToRefs };
|
package/dist/store.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createStore as e}from"./store/manager.mjs";import{defineStore as t}from"./store/define.mjs";import{storeToRefs as n}from"./store/storeToRefs.mjs";export{e as createStore,t as defineStore,n as storeToRefs};
|
package/dist/utils.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e?e.charAt(0).toUpperCase()+e.slice(1):``}function t(e){return e?e.split(`.`).map(e=>e.trim()).filter(Boolean):[]}function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}export{e as capitalize,n as hasOwn,t as toPathSegments};
|
package/dist/version.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{version as e}from"./package.mjs";const t=e;export{t as version};
|