wevu 7.6.0 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alipay/jsx-runtime.d.mts +0 -2
- package/dist/config/defaults.d.mts +1 -3
- package/dist/config/pageFeatures.d.mts +1 -3
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/defineProperty.mjs +1 -2
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPrimitive.mjs +1 -2
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPropertyKey.mjs +1 -2
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/typeof.mjs +1 -2
- package/dist/dev/api/vitest/setup.mjs +1 -2
- package/dist/dev/package.mjs +2 -3
- package/dist/dev/reactivity/asyncDerivation.mjs +1 -2
- package/dist/dev/reactivity/computed.mjs +1 -2
- package/dist/dev/reactivity/core.mjs +2 -3
- package/dist/dev/reactivity/reactive/mutation.mjs +1 -2
- package/dist/dev/reactivity/reactive/patch.mjs +1 -2
- package/dist/dev/reactivity/reactive/patchState.mjs +1 -2
- package/dist/dev/reactivity/reactive/shallow.mjs +1 -2
- package/dist/dev/reactivity/reactive/shared.mjs +1 -2
- package/dist/dev/reactivity/reactive/state.mjs +1 -2
- package/dist/dev/reactivity/reactive.mjs +1 -2
- package/dist/dev/reactivity/readonly.mjs +1 -2
- package/dist/dev/reactivity/ref.mjs +2 -3
- package/dist/dev/reactivity/shallowRef.mjs +1 -2
- package/dist/dev/reactivity/toRefs.mjs +1 -2
- package/dist/dev/reactivity/traverse.mjs +1 -2
- package/dist/dev/reactivity/watch/helpers.mjs +1 -2
- package/dist/dev/reactivity/watch/types.mjs +1 -2
- package/dist/dev/reactivity/watch.mjs +1 -2
- package/dist/dev/router/auto-routes.mjs +1 -2
- package/dist/dev/router/backNavigation.mjs +1 -2
- package/dist/dev/router/createRouter.mjs +1 -2
- package/dist/dev/router/initialNavigation.mjs +1 -2
- package/dist/dev/router/instance.mjs +1 -2
- package/dist/dev/router/navigationApi.mjs +1 -2
- package/dist/dev/router/navigationCore.mjs +1 -2
- package/dist/dev/router/navigationResult.mjs +1 -2
- package/dist/dev/router/navigationTarget.mjs +1 -2
- package/dist/dev/router/navigationTargetHelpers.mjs +1 -2
- package/dist/dev/router/resolve.mjs +1 -2
- package/dist/dev/router/routeRegistry.mjs +1 -2
- package/dist/dev/router/routeSync.mjs +1 -2
- package/dist/dev/router/scrollRestoration/adapters.mjs +1 -2
- package/dist/dev/router/scrollRestoration/controller.mjs +1 -2
- package/dist/dev/router/scrollRestoration/host.mjs +1 -2
- package/dist/dev/router/scrollRestoration/index.mjs +1 -2
- package/dist/dev/router/types.mjs +1 -2
- package/dist/dev/router/useRoute.mjs +1 -2
- package/dist/dev/router/useRouter.mjs +1 -2
- package/dist/dev/routerInternal/location.mjs +1 -2
- package/dist/dev/routerInternal/matching.mjs +1 -2
- package/dist/dev/routerInternal/params.mjs +1 -2
- package/dist/dev/routerInternal/path.mjs +1 -2
- package/dist/dev/routerInternal/query.mjs +1 -2
- package/dist/dev/routerInternal/records.mjs +1 -2
- package/dist/dev/routerInternal/recordsWarnings.mjs +1 -2
- package/dist/dev/routerInternal/snapshots.mjs +1 -2
- package/dist/dev/runtime/app/computed.mjs +1 -2
- package/dist/dev/runtime/app/context.mjs +1 -2
- package/dist/dev/runtime/app/diagnostics.mjs +1 -2
- package/dist/dev/runtime/app/mount.mjs +1 -2
- package/dist/dev/runtime/app/pending.mjs +1 -2
- package/dist/dev/runtime/app/setData/commitTracker.mjs +1 -2
- package/dist/dev/runtime/app/setData/observation.mjs +1 -2
- package/dist/dev/runtime/app/setData/patchScheduler.mjs +1 -2
- package/dist/dev/runtime/app/setData/payload.mjs +1 -2
- package/dist/dev/runtime/app/setData/scheduler.mjs +1 -2
- package/dist/dev/runtime/app/setData/snapshot.mjs +1 -2
- package/dist/dev/runtime/app/setDataOptions.mjs +1 -2
- package/dist/dev/runtime/app.mjs +1 -2
- package/dist/dev/runtime/bindModel.mjs +1 -2
- package/dist/dev/runtime/bindingManifest.mjs +1 -2
- package/dist/dev/runtime/capabilities.mjs +1 -2
- package/dist/dev/runtime/css.mjs +1 -2
- package/dist/dev/runtime/defaults.mjs +1 -2
- package/dist/dev/runtime/define/componentDefinition.mjs +1 -2
- package/dist/dev/runtime/define/initialComputed.mjs +1 -2
- package/dist/dev/runtime/define/options.mjs +1 -2
- package/dist/dev/runtime/define/optionsApi.mjs +1 -2
- package/dist/dev/runtime/define/props.mjs +1 -2
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +1 -2
- package/dist/dev/runtime/define/setupResult.mjs +1 -2
- package/dist/dev/runtime/define.mjs +1 -2
- package/dist/dev/runtime/diff.mjs +1 -2
- package/dist/dev/runtime/disposables.mjs +1 -2
- package/dist/dev/runtime/elementIntersectionObserver.mjs +1 -2
- package/dist/dev/runtime/emit.mjs +1 -2
- package/dist/dev/runtime/features/inlineEvents.mjs +1 -2
- package/dist/dev/runtime/features/jsxIslands.mjs +1 -2
- package/dist/dev/runtime/features/layout.mjs +1 -2
- package/dist/dev/runtime/features/patchStrategy.mjs +1 -2
- package/dist/dev/runtime/features/publicLayout.mjs +1 -2
- package/dist/dev/runtime/features/scopedSlots.mjs +1 -2
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.mjs +1 -2
- package/dist/dev/runtime/features/templateRefs.mjs +1 -2
- package/dist/dev/runtime/hooks/base.mjs +1 -2
- package/dist/dev/runtime/hooks/pageScroll.mjs +1 -2
- package/dist/dev/runtime/hooks/register.mjs +1 -2
- package/dist/dev/runtime/hooks/vue.mjs +1 -2
- package/dist/dev/runtime/inlineDataset.mjs +1 -2
- package/dist/dev/runtime/internal.mjs +1 -2
- package/dist/dev/runtime/intersectionObserver.mjs +1 -2
- package/dist/dev/runtime/jsxIsland.mjs +1 -2
- package/dist/dev/runtime/layoutBridge.mjs +1 -2
- package/dist/dev/runtime/layoutComponentMatcher.mjs +1 -2
- package/dist/dev/runtime/nativeBridge.mjs +1 -2
- package/dist/dev/runtime/navigationLifecycle.mjs +1 -2
- package/dist/dev/runtime/noSetData.mjs +1 -2
- package/dist/dev/runtime/pageEnvironment.mjs +1 -2
- package/dist/dev/runtime/pageLayout.mjs +1 -2
- package/dist/dev/runtime/pageScroll.mjs +1 -2
- package/dist/dev/runtime/platform/current.mjs +1 -2
- package/dist/dev/runtime/platform/generic.mjs +1 -2
- package/dist/dev/runtime/platform/globals.mjs +1 -2
- package/dist/dev/runtime/platform.mjs +1 -2
- package/dist/dev/runtime/provide.mjs +1 -2
- package/dist/dev/runtime/provideContext.mjs +1 -2
- package/dist/dev/runtime/provideStore.mjs +1 -2
- package/dist/dev/runtime/publicRuntime.mjs +1 -2
- package/dist/dev/runtime/pullDownRefresh.mjs +1 -2
- package/dist/dev/runtime/register/app.mjs +1 -2
- package/dist/dev/runtime/register/component/alipay.mjs +1 -2
- package/dist/dev/runtime/register/component/alipayRegistration.mjs +1 -2
- package/dist/dev/runtime/register/component/features.mjs +1 -2
- package/dist/dev/runtime/register/component/hmrRegistration.mjs +1 -2
- package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs +1 -2
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs +1 -2
- package/dist/dev/runtime/register/component/lifecycle.mjs +1 -2
- package/dist/dev/runtime/register/component/methods.mjs +1 -2
- package/dist/dev/runtime/register/component/options.mjs +1 -2
- package/dist/dev/runtime/register/component/props.mjs +1 -2
- package/dist/dev/runtime/register/component/registerDefinition.mjs +1 -2
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +1 -2
- package/dist/dev/runtime/register/component.mjs +1 -2
- package/dist/dev/runtime/register/inline.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/nativeDeclaration.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance.mjs +1 -2
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +1 -2
- package/dist/dev/runtime/register/setup.mjs +1 -2
- package/dist/dev/runtime/register/snapshot.mjs +1 -2
- package/dist/dev/runtime/register/watch.mjs +1 -2
- package/dist/dev/runtime/scopedSlots.mjs +1 -2
- package/dist/dev/runtime/selectorQuery.mjs +1 -2
- package/dist/dev/runtime/setupTracking.mjs +1 -2
- package/dist/dev/runtime/teardown.mjs +1 -2
- package/dist/dev/runtime/template.mjs +1 -2
- package/dist/dev/runtime/templateRefs/helpers.mjs +1 -2
- package/dist/dev/runtime/templateRefs.mjs +1 -2
- package/dist/dev/runtime/uniAppHost.mjs +1 -2
- package/dist/dev/runtime/updatePerformance.mjs +1 -2
- package/dist/dev/runtime/use.mjs +1 -2
- package/dist/dev/runtime/vueCompat/context.mjs +1 -2
- package/dist/dev/runtime/vueCompat/model.mjs +1 -2
- package/dist/dev/runtime/vueCompat/router.mjs +1 -2
- package/dist/dev/runtime/vueCompat/templateRef.mjs +1 -2
- package/dist/dev/scheduler.mjs +1 -2
- package/dist/dev/store/actions.mjs +1 -2
- package/dist/dev/store/base.mjs +1 -2
- package/dist/dev/store/define/create.mjs +1 -2
- package/dist/dev/store/define.mjs +1 -2
- package/dist/dev/store/manager.mjs +1 -2
- package/dist/dev/store/storeToRefs.mjs +1 -2
- package/dist/dev/store/subscriptions.mjs +1 -2
- package/dist/dev/store/types.mjs +1 -2
- package/dist/dev/store/utils.mjs +1 -2
- package/dist/dev/store/view.mjs +1 -2
- package/dist/dev/utils.mjs +1 -2
- package/dist/dev/version.mjs +1 -2
- package/dist/dev/vue-demi.mjs +1 -2
- package/dist/fetch.d.mts +0 -2
- package/dist/jsx-runtime.d.mts +0 -2
- package/dist/jsxTypes.d.mts +1 -3
- package/dist/macros/shared.d.mts +0 -2
- package/dist/macros.d.mts +0 -2
- package/dist/miniprogram/jsx-runtime.d.mts +0 -2
- package/dist/package.mjs +1 -1
- package/dist/reactivity/asyncDerivation.d.mts +0 -2
- package/dist/reactivity/computed.d.mts +0 -2
- package/dist/reactivity/core.d.mts +1 -3
- package/dist/reactivity/core.mjs +1 -1
- package/dist/reactivity/reactive/mutation.d.mts +0 -2
- package/dist/reactivity/reactive/patch.d.mts +1 -3
- package/dist/reactivity/reactive/patchState.mjs +1 -1
- package/dist/reactivity/reactive/shallow.d.mts +1 -3
- package/dist/reactivity/reactive/shared.d.mts +1 -3
- package/dist/reactivity/reactive.d.mts +0 -2
- package/dist/reactivity/readonly.d.mts +1 -3
- package/dist/reactivity/ref.d.mts +1 -3
- package/dist/reactivity/ref.mjs +1 -1
- package/dist/reactivity/shallowRef.d.mts +1 -3
- package/dist/reactivity/toRefs.d.mts +0 -2
- package/dist/reactivity/traverse.d.mts +1 -3
- package/dist/reactivity/watch/types.d.mts +0 -2
- package/dist/reactivity/watch.d.mts +0 -2
- package/dist/router/auto-routes.d.mts +0 -2
- package/dist/router/createRouter.d.mts +1 -3
- package/dist/router/navigationCore.d.mts +1 -3
- package/dist/router/resolve.d.mts +1 -3
- package/dist/router/scrollRestoration/adapters.d.mts +1 -3
- package/dist/router/scrollRestoration/controller.d.mts +1 -3
- package/dist/router/scrollRestoration/index.d.mts +0 -2
- package/dist/router/scrollRestoration/index.mjs +1 -1
- package/dist/router/scrollRestoration/types.d.mts +1 -3
- package/dist/router/types.d.mts +0 -2
- package/dist/router/useRoute.d.mts +1 -3
- package/dist/router/useRouter.d.mts +1 -3
- package/dist/router.d.mts +0 -2
- package/dist/routerInternal/query.d.mts +1 -3
- package/dist/routerInternal/types.d.mts +1 -3
- package/dist/runtime/app/pending.d.mts +1 -3
- package/dist/runtime/app/setData/commitTracker.d.mts +1 -3
- package/dist/runtime/app/setData/observation.d.mts +0 -2
- package/dist/runtime/app/setData/scheduler.d.mts +1 -3
- package/dist/runtime/app/setData/scheduler.mjs +1 -1
- package/dist/runtime/app.d.mts +1 -3
- package/dist/runtime/capabilities.d.mts +0 -2
- package/dist/runtime/css.d.mts +1 -3
- package/dist/runtime/defaults.d.mts +1 -3
- package/dist/runtime/define/props.mjs +1 -1
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
- package/dist/runtime/define.d.mts +0 -2
- package/dist/runtime/disposables.d.mts +1 -3
- package/dist/runtime/elementIntersectionObserver.d.mts +1 -3
- package/dist/runtime/features/inlineEvents.d.mts +1 -3
- package/dist/runtime/features/jsxIslands.d.mts +1 -3
- package/dist/runtime/features/layout.d.mts +1 -3
- package/dist/runtime/features/patchStrategy.d.mts +1 -3
- package/dist/runtime/features/publicLayout.d.mts +0 -2
- package/dist/runtime/features/scopedSlots.d.mts +1 -3
- package/dist/runtime/features/setDataHighFrequencyWarning.d.mts +1 -3
- package/dist/runtime/features/templateRefs.d.mts +1 -3
- package/dist/runtime/hooks/base.d.mts +1 -3
- package/dist/runtime/hooks/register.d.mts +1 -3
- package/dist/runtime/hooks/vue.d.mts +1 -3
- package/dist/runtime/intersectionObserver.d.mts +1 -3
- package/dist/runtime/jsxIsland.d.mts +1 -3
- package/dist/runtime/layoutBridge.d.mts +0 -2
- package/dist/runtime/noSetData.d.mts +1 -3
- package/dist/runtime/pageEnvironment.d.mts +1 -3
- package/dist/runtime/pageLayout.d.mts +0 -2
- package/dist/runtime/pageScroll.d.mts +1 -3
- package/dist/runtime/provide.d.mts +0 -2
- package/dist/runtime/provideStore.d.mts +1 -3
- package/dist/runtime/publicRuntime.d.mts +1 -3
- package/dist/runtime/pullDownRefresh.d.mts +1 -3
- package/dist/runtime/register/app.d.mts +1 -3
- package/dist/runtime/register/component.d.mts +1 -3
- package/dist/runtime/register/inline.d.mts +0 -2
- package/dist/runtime/register/runtimeInstance.d.mts +0 -2
- package/dist/runtime/register/runtimeInstance.mjs +1 -1
- package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -1
- package/dist/runtime/register/setup.d.mts +0 -2
- package/dist/runtime/register/watch.d.mts +0 -2
- package/dist/runtime/selectorQuery.d.mts +1 -3
- package/dist/runtime/template.d.mts +1 -3
- package/dist/runtime/templateRefTypes.d.mts +0 -2
- package/dist/runtime/types/core.d.mts +0 -2
- package/dist/runtime/types/miniprogram.d.mts +0 -2
- package/dist/runtime/types/miniprogramHost.d.mts +0 -2
- package/dist/runtime/types/miniprogramHostSources.d.mts +1 -3
- package/dist/runtime/types/options.d.mts +0 -2
- package/dist/runtime/types/props/propTypes.d.mts +0 -2
- package/dist/runtime/types/props/router.d.mts +0 -2
- package/dist/runtime/types/props/setup.d.mts +1 -3
- package/dist/runtime/types/runtime.d.mts +1 -3
- package/dist/runtime/types/setData.d.mts +1 -3
- package/dist/runtime/types.d.mts +0 -2
- package/dist/runtime/uniAppHost.d.mts +0 -2
- package/dist/runtime/updatePerformance.d.mts +1 -3
- package/dist/runtime/use.d.mts +1 -3
- package/dist/runtime/vueCompat/context.d.mts +1 -3
- package/dist/runtime/vueCompat/model.d.mts +0 -2
- package/dist/runtime/vueCompat/router.d.mts +0 -2
- package/dist/runtime/vueCompat/templateRef.d.mts +1 -3
- package/dist/scheduler.d.mts +1 -3
- package/dist/store/define.d.mts +1 -3
- package/dist/store/manager.d.mts +1 -3
- package/dist/store/storeToRefs.d.mts +0 -2
- package/dist/store/types.d.mts +0 -2
- package/dist/tt/jsx-runtime.d.mts +0 -2
- package/dist/types/definitions.d.mts +1 -3
- package/dist/types/pageLayout.d.mts +1 -3
- package/dist/types/pageMeta.d.mts +1 -3
- package/dist/types/reactivity.d.mts +0 -2
- package/dist/version.d.mts +1 -3
- package/dist/vue-augment.d.mts +1 -3
- package/dist/vue-demi.d.mts +0 -2
- package/dist/vue-types.d.mts +0 -2
- package/dist/weapp/jsx-runtime.d.mts +0 -2
- package/package.json +8 -8
- /package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/defineProperty.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPrimitive.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPropertyKey.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/typeof.mjs +0 -0
|
@@ -6,7 +6,6 @@ import { registerApp as registerApp$1 } from "./register/app.mjs";
|
|
|
6
6
|
import { registerComponent as registerComponent$1 } from "./register/component.mjs";
|
|
7
7
|
import { mountRuntimeInstance as mountRuntimeInstance$1 } from "./register/runtimeInstance.mjs";
|
|
8
8
|
import "./register.mjs";
|
|
9
|
-
//#region src/runtime/publicRuntime.d.ts
|
|
10
9
|
export declare const createApp: typeof createApp$1;
|
|
11
10
|
export declare const defineComponent: typeof defineComponent$1;
|
|
12
11
|
export declare const createWevuComponent: typeof createWevuComponent$1;
|
|
@@ -17,5 +16,4 @@ export declare const setWevuDefaults: typeof setWevuDefaults$1;
|
|
|
17
16
|
/**
|
|
18
17
|
* 创建公开入口的作用域插槽组件,并保留历史上的完整能力行为。
|
|
19
18
|
*/
|
|
20
|
-
export declare function createWevuScopedSlotComponent(overrides?: CreateWevuScopedSlotComponentOptions): void;
|
|
21
|
-
//#endregion
|
|
19
|
+
export declare function createWevuScopedSlotComponent(overrides?: CreateWevuScopedSlotComponentOptions): void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/runtime/pullDownRefresh.d.ts
|
|
2
1
|
export type PullDownRefreshHandler = () => void | Promise<void>;
|
|
3
2
|
export interface UseAsyncPullDownRefreshOptions {
|
|
4
3
|
onError?: (error: unknown) => void | Promise<void>;
|
|
@@ -7,5 +6,4 @@ export interface UseAsyncPullDownRefreshOptions {
|
|
|
7
6
|
/**
|
|
8
7
|
* 注册下拉刷新回调,并在回调结束后自动停止宿主下拉刷新状态。
|
|
9
8
|
*/
|
|
10
|
-
export declare function useAsyncPullDownRefresh(refresh: PullDownRefreshHandler, options?: UseAsyncPullDownRefreshOptions): void;
|
|
11
|
-
//#endregion
|
|
9
|
+
export declare function useAsyncPullDownRefresh(refresh: PullDownRefreshHandler, options?: UseAsyncPullDownRefreshOptions): void;
|
|
@@ -4,10 +4,8 @@ import { RuntimeApp } from "../types/runtime.mjs";
|
|
|
4
4
|
import { DefineAppOptions } from "../types/options.mjs";
|
|
5
5
|
import "../types.mjs";
|
|
6
6
|
import { WatchMap } from "./watch.mjs";
|
|
7
|
-
//#region src/runtime/register/app.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* 注册 App 入口(框架内部使用)。
|
|
10
9
|
* @internal
|
|
11
10
|
*/
|
|
12
|
-
export declare function registerApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineAppOptions<D, C, M>['setup'], mpOptions: MiniProgramAppOptions): void;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare function registerApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineAppOptions<D, C, M>['setup'], mpOptions: MiniProgramAppOptions): void;
|
|
@@ -5,12 +5,10 @@ import { RuntimeApp } from "../types/runtime.mjs";
|
|
|
5
5
|
import { DefineComponentOptions } from "../types/options.mjs";
|
|
6
6
|
import "../types.mjs";
|
|
7
7
|
import { WatchMap } from "./watch.mjs";
|
|
8
|
-
//#region src/runtime/register/component.d.ts
|
|
9
8
|
/**
|
|
10
9
|
* 注册组件入口(框架内部使用)。
|
|
11
10
|
* @internal
|
|
12
11
|
*/
|
|
13
12
|
export declare function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'], mpOptions: MiniProgramComponentRawOptions, options?: {
|
|
14
13
|
registerNative?: boolean;
|
|
15
|
-
}): any;
|
|
16
|
-
//#endregion
|
|
14
|
+
}): any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/runtime/register/inline.d.ts
|
|
2
1
|
export interface InlineExpressionEntry {
|
|
3
2
|
keys: string[];
|
|
4
3
|
indexKeys?: string[];
|
|
@@ -11,5 +10,4 @@ interface InlineExpressionScopeResolver {
|
|
|
11
10
|
indexKey: string;
|
|
12
11
|
}
|
|
13
12
|
export type InlineExpressionMap = Record<string, InlineExpressionEntry>;
|
|
14
|
-
//#endregion
|
|
15
13
|
export {};
|
|
@@ -4,7 +4,6 @@ import { InternalRuntimeState, RuntimeApp, RuntimeInstance } from "../types/runt
|
|
|
4
4
|
import { DefineAppOptions, DefineComponentOptions } from "../types/options.mjs";
|
|
5
5
|
import "../types.mjs";
|
|
6
6
|
import { WatchMap } from "./watch.mjs";
|
|
7
|
-
//#region src/runtime/register/runtimeInstance.d.ts
|
|
8
7
|
type RuntimeSetupFunction<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> = DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'] | DefineAppOptions<D, C, M>['setup'];
|
|
9
8
|
interface RuntimeMountOptions {
|
|
10
9
|
deferSetData?: boolean;
|
|
@@ -26,5 +25,4 @@ export declare function teardownRuntimeInstance(target: InternalRuntimeState, op
|
|
|
26
25
|
skipHooks?: boolean;
|
|
27
26
|
preserveNativeDeclarationChildren?: boolean;
|
|
28
27
|
}): void;
|
|
29
|
-
//#endregion
|
|
30
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{effectScope as e}from"../../reactivity/core.mjs";import{isReactive as t}from"../../reactivity/reactive.mjs";import{isRef as n}from"../../reactivity/ref.mjs";import{getMiniProgramRuntimeGlobalObject as r}from"../platform.mjs";import{callHookList as i}from"../hooks/base.mjs";import{isSetDataHighFrequencyWarningRequested as a,requireRuntimeCapability as o,runtimeCapabilityRegistry as s}from"../capabilities.mjs";import{runTeardownSteps as c}from"../teardown.mjs";import{observePhysicalDispatch as l}from"../app/setData/observation.mjs";import{applySnapshotUpdate as u,isDeepEqualValue as d}from"../app/setData/snapshot.mjs";import{observeSetDataCompletion as ee}from"../app/setData/commitTracker.mjs";import{isRuntimeLayoutComponentTarget as f}from"../layoutComponentMatcher.mjs";import{attachRuntimeSlots as te,createNoopWatchStopHandle as ne,safeMarkNoSetData as re}from"./runtimeInstance/setupContext.mjs";import{bridgeRuntimeMethodsToTarget as ie}from"./runtimeInstance/methodBridge.mjs";import{releaseNativeDeclaration as p}from"./runtimeInstance/nativeDeclaration.mjs";import{attachRuntimeProvideParentContext as ae}from"./runtimeInstance/provideContext.mjs";import{attachNativeInstanceRef as oe,attachRuntimeInstance as se,attachRuntimeRef as ce,callNativeSetData as m,ensureRuntimeProps as le,resolveNativeSetData as ue}from"./runtimeInstance/utils.mjs";import{runRuntimeSetupPhase as de}from"./runtimeInstance/setupPhase.mjs";import{restoreReactiveSetupSnapshot as h}from"./runtimeInstance/setupSnapshot.mjs";import{registerWatches as fe}from"./watch.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as pe,WEVU_EFFECT_SCOPE_KEY as g,WEVU_EXPOSED_KEY as me,WEVU_HOOKS_KEY as _,WEVU_HOST_COMMIT_PROMISE_KEY as v,WEVU_NATIVE_SLOT_CONTEXT_KEY as y,WEVU_ON_BEFORE_UNMOUNT_HOOK as b,WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as he,WEVU_PARENT_INSTANCE_KEY as x,WEVU_PROPS_DERIVED_KEYS_KEY as ge,WEVU_PROVIDES_KEY as S,WEVU_PUBLIC_RUNTIME_KEY as C,WEVU_RUNTIME_APP_KEY as w,WEVU_SETUP_CONTEXT_INSTANCE_KEY as T,WEVU_SLOT_OWNER_ID_KEY as _e,WEVU_WATCH_STOPS_KEY as E}from"@weapp-core/constants";const D=/* @__PURE__ */ new WeakMap;function O(e,t=/* @__PURE__ */ new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(O(r,t));return n}let n={};t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=O(i,t);return n}function ve(e,t){let n=e??{};for(let[e,r]of Object.entries(t)){let t;for(let r of Object.keys(n))if(e.startsWith(`${r}.`)){t=r;break}if(t){let i={value:n[t]};u(i,`value.${e.slice(t.length+1)}`,r,`set`,{cloneValue:!1,clonedParents:/* @__PURE__ */ new WeakSet}),n[t]=i.value;continue}let i=`${e}.`;for(let e of Object.keys(n))e.startsWith(i)&&delete n[e];n[e]=r}return n}function ye(e,t,n){let r=e.data;if((!r||typeof r!=`object`)&&(!n||!Object.keys(n).length))return;let i=Array.isArray(t)&&t.length?new Set(t):void 0,a={};if(r&&typeof r==`object`)for(let[e,t]of Object.entries(r))i?.has(e)||(a[e]=O(t));if(n)for(let[e,t]of Object.entries(n))i?.has(e)||(a[e]=O(t));return a}function be(e){return!!e?.__wevuHasTemplateRuntimeBindings}function k(e,t,n,r,i){if(e.__wevu)return import.meta.env?.PROD!==!0&&e[w]&&e[w]!==t?L(e,t,n,r,{snapshotOmitKeys:i?.snapshotOmitKeys,attached:i?.attached}):e.__wevu;try{return A(e,t,n,r,i)}catch(t){try{I(e,{skipHooks:!0})}catch{}throw t}}function A(e,n,c,u,d){let f=n.__wevuSetDataOptions,p=be(n)?o(`scopedSlots`,`mountRuntimeInstance(scoped-slot bindings)`):void 0,h=p?.prepareMount(e),g=e.__wevuTemplateRefs;Array.isArray(g)&&g.length&&o(`templateRefs`,`mountRuntimeInstance(template refs)`);let me=a(f?.highFrequencyWarning)?o(`setDataHighFrequencyWarning`,`mountRuntimeInstance(setData.highFrequencyWarning)`):void 0;ae(e,n,d?.attached,d?.layoutParent),re(e);let _=!!f?.suspendWhenHidden,y=typeof e.route==`string`&&e.route?`page:${e.route}`:typeof e.is==`string`&&e.is?`component:${e.is}`:`unknown-target`,b=me?.createMonitor({option:f?.highFrequencyWarning,targetLabel:y,isInPageScrollHook:()=>Number(e[he]??0)>0}),x=!0,S=!d?.deferSetData,w=!1,T=0,k,A,j,M,N=[],P=!(v in e),F=0,I=!1,L,R,z,B,V=()=>{!F&&!k&&!R&&(I=!1,L=void 0)},H=()=>{F||k||(I?B?.(L):z?.(),R=void 0,z=void 0,B=void 0)},xe=()=>{P&&(F+=1)},U=(e=`committed`,t)=>{P&&!w&&(e===`failed`&&!I&&(I=!0,L=t),--F,H())},Se=e=>U(`failed`,e);P&&Object.defineProperty(e,v,{configurable:!0,enumerable:!1,get:()=>!F&&!k?I?Promise.reject(L):void 0:(R??(R=new Promise((e,t)=>{z=e,B=t})),R)});let W=()=>{h&&s.scopedSlots?.refresh(e,h)},G=()=>{if(w)return;let t=e.__wevuTemplateRefs;!s.templateRefs&&(!Array.isArray(t)||!t.length)?P&&U():o(`templateRefs`,`mountRuntimeInstance(template ref completion)`).schedule(e,P?U:void 0,e,P?Se:void 0)},Ce=()=>{h&&p?.syncNativeOwnerId(e,h)},we=(e,t)=>{let n={settle:e,next:void 0};j?j.next=n:A=n,j=n,t&&(M??(M=[])).push(t)},K=(e,t,n)=>{let r=e,i=!0;for(;r;){let e=r.next;r.next=void 0,t===`failed`&&!i?r.settle(`abandoned`):r.settle(t,n),r=e,i=!1}},Te=(t,n,r)=>{let i=T;xe(),W(),ee({observer:r,invoke:n=>{let i=ue(e);if(!i)n();else return r&&l(r,t),m(e,i,t,n)},completion:`callback`,settle:(e,t)=>{if(!(w||i!==T)){if(e!==`committed`)U(e,t),n(e,t);else{try{n(e,t)}catch(e){throw U(`failed`,e),e}G()}}}})},Ee=()=>{if(!k)return;let e=k,t=A,n=N;k=void 0,A=void 0,j=void 0,N=[];let r=M;M=void 0,Te(e,(e,r)=>{if(e===`committed`)try{for(let e of n)e()}finally{K(t,e,r)}else K(t,e,r)},r&&{dispatch:e=>r.forEach(t=>t.dispatch(e)),returned:e=>r.forEach(t=>t.returned(e)),complete:e=>r.forEach(t=>t.complete(e))})},De=()=>{M=void 0;let e=A;k=void 0,A=void 0,j=void 0,N=[],K(e,`abandoned`),H()},Oe=e=>{V(),k=ve(k,e)},q={setData(t,n){if(b?.(),!S||_&&!x){Oe(t),n&&N.push(n),W();return}W(),V(),xe();let r=ue(e);if(!r){try{n?.()}catch(e){throw U(`failed`,e),e}G();return}let i=!0,a=!1,o=!1,s=!1,c=e=>{s||(s=!0,U(`failed`,e))},l=()=>{s||(s=!0,G())},u=()=>{try{n?.()}catch(e){throw c(e),e}i?a=!0:o||l()},d;try{d=m(e,r,t,u)}catch(e){throw c(e),e}return i=!1,o=!!(d&&typeof d.then==`function`),d&&typeof d.then==`function`?d.then(()=>{l()},e=>{throw c(e),e}):(a&&l(),d)},__wevu_dispatchSetData(e,t,n){b?.(),w?t(`abandoned`):!S||_&&!x?(Oe(e),we(t,n),W()):(V(),Te(e,t,n))},__wevu_enableSetData(e=!1){S=!0,e?De():Ee()},__wevu_setVisibility(e){x=e,x&&S&&Ee()},__wevu_disposeSetData(){w||(w=!0,T+=1,k=void 0,A=void 0,j=void 0,N=[],F=0,I=!1,L=void 0,H(),P&&Reflect.deleteProperty(e,v))}};Object.defineProperty(q,"__wevu_reportSetDataError",{configurable:!0,enumerable:!1,value:t=>{i(e,`onError`,[t])},writable:!1}),Object.defineProperty(q,"__wevu_targetLabel",{configurable:!0,enumerable:!1,value:y,writable:!1});let J=e.properties;J&&typeof J==`object`&&Object.defineProperty(q,"__wevu_initialProps",{configurable:!0,enumerable:!1,value:J,writable:!1}),Array.isArray(d?.snapshotOmitKeys)&&d.snapshotOmitKeys.length&&Object.defineProperty(q,"__wevu_snapshotOmitKeys",{configurable:!0,enumerable:!1,value:d.snapshotOmitKeys,writable:!1});let Y=ye(e,d?.snapshotOmitKeys);Y&&Object.keys(Y).length&&Object.defineProperty(q,"__wevu_initialSnapshot",{configurable:!0,enumerable:!1,value:Y,writable:!1}),h&&Object.defineProperty(q,"__wevu_initialState",{configurable:!0,enumerable:!1,value:{[_e]:h.ownerId},writable:!1}),(d?.deferSetData||u||J&&typeof J==`object`&&Object.keys(J).length>0)&&Object.defineProperty(q,"__wevu_deferInitialSnapshot",{configurable:!0,enumerable:!1,value:!0,writable:!1});let X=n.mount(q);se(X,e);let ke=X?.proxy??{},Z=X?.state??{},Ae=X?.setupState??Object.create(null);Z&&typeof Z==`object`&&(ce(Z,X),oe(Z,e));let je=X?.computed??Object.create(null);if(!X?.methods)try{X.methods=Object.create(null)}catch{}let Me=X?.methods??Object.create(null),Ne=X?.watch??(()=>ne()),Pe=X?.bindModel??(()=>{}),Q={...X??{},state:Z,setupState:Ae,proxy:ke,methods:Me,computed:je,watch:Ne,bindModel:Pe,snapshot:X?.snapshot??(()=>Object.create(null)),unmount:X?.unmount??(()=>{})};Object.defineProperty(Q,"__wevu_initialRuntimeSnapshot",{configurable:!0,enumerable:!1,value:O(Z),writable:!1});let Fe=Q,Ie={__wevu_flushSetupSnapshotSync:X.__wevu_flushSetupSnapshotSync,__wevu_touchSetupMethodsVersion:X.__wevu_touchSetupMethodsVersion,__wevu_trackSetupReactiveKey:X.__wevu_trackSetupReactiveKey,__wevu_cloneDispatchedSnapshot:X.__wevu_cloneDispatchedSnapshot,[ge]:X[ge]};for(let[e,t]of Object.entries(Ie))t&&Object.defineProperty(Q,e,{configurable:!0,enumerable:!1,value:t,writable:!0});Object.defineProperty(e,C,{value:Q,configurable:!0,enumerable:!1,writable:!1}),e.__wevu=Q;let Le=le(e,Z);te(Z,Le),h&&p?.attachMount(e,Q,h,!!d?.deferSetData),Ce(),u&&de({target:e,runtime:X,runtimeWithDefaults:Q,runtimeState:Z,runtimeProxy:ke,setup:u});let $=c?fe(Q,c,e):[];if($.length&&(e[E]=$),u){if(import.meta.env?.PROD!==!0&&typeof r()?.[pe]?.trackWevuComponent==`function`){let e={};for(let[n,r]of Object.entries(Q.setupState??{}))t(r)&&(e[n]=O(r));D.set(Q,e)}d?.deferSetData||Fe.__wevu_flushSetupSnapshotSync?.(),d?.deferSetData||W()}else!d?.deferSetData&&e.properties&&typeof e.properties==`object`&&Object.keys(e.properties).length>0&&(Fe.__wevu_flushSetupSnapshotSync?.(),W());return ie(e,X),X}function j(e,t,n){for(let e of Reflect.ownKeys(t))Reflect.has(n,e)||Reflect.getOwnPropertyDescriptor(t,e)?.configurable&&Reflect.deleteProperty(t,e);for(let e of Reflect.ownKeys(n)){let r=Reflect.getOwnPropertyDescriptor(n,e);if(r)try{Reflect.defineProperty(t,e,r)}catch{try{t[e]=n[e]}catch{}}}ce(t.state,t);let r=D.get(n);return r&&D.set(t,r),e.__wevu=t,Object.defineProperty(e,C,{value:t,configurable:!0,enumerable:!1,writable:!1}),t}function M(e,r,i){let a=e.state,o=e.setupState,s={};for(let e of Object.keys(r??{})){if(!Object.prototype.hasOwnProperty.call(a,e))continue;let r=o?.[e];(!o||!Object.prototype.hasOwnProperty.call(o,e)||n(r)||t(r))&&(s[e]=i&&Object.prototype.hasOwnProperty.call(i,e)?O(i[e]):O(n(r)?r.value:a[e]))}return s}function N(e,r){let i=e.__wevu,a=i?.state,o=i?.setupState,s=r?.nativeData??e.data;if(!a||typeof a!=`object`||!s||typeof s!=`object`)return;let c=i?.__wevu_initialRuntimeSnapshot;for(let[e,i]of Object.entries(s))if(e&&e!==`undefined`&&Object.prototype.hasOwnProperty.call(a,e))try{let s=o?.[e],l=O(i);if(o&&Object.prototype.hasOwnProperty.call(o,e)&&(!r?.includeSetupState||!n(s)&&!t(s))||!r?.includeSetupState&&c&&Object.prototype.hasOwnProperty.call(c,e)&&!d(a[e],c[e],20,{keys:1e4})||!r?.includeSetupState&&c&&!Object.prototype.hasOwnProperty.call(c,e))continue;if(n(s)){s.value=l;continue}if(t(s)&&l&&typeof l==`object`){h(s,l,r?.initialSetupState?.[e]);continue}a[e]=l}catch{}}function P(e,t){let n=e.__wevu?.adapter;N(e,{includeSetupState:t?.rehydrateSetupState}),n?.__wevu_enableSetData?.(!0),e.__wevu?.__wevu_flushSetupSnapshotSync?.()}function F(e,t){(e.__wevu?.adapter)?.__wevu_setVisibility?.(t)}function I(t,n){let r=t.__wevu,a=t[E],l=t[g];c([()=>{if(!n?.skipHooks&&r&&t[_]?.[b]){if(l?.active)l.run(()=>i(t,b));else{let n=e(!0);c([()=>n.run(()=>i(t,b)),()=>n.stop()])}}},...(!import.meta.env?.PLATFORM||import.meta.env?.PLATFORM===`weapp`)&&t[y]===!0?[()=>p(t,n?.preserveNativeDeclarationChildren)]:[],()=>s.scopedSlots?.teardown(t),()=>{Array.isArray(t.__wevuTemplateRefs)&&t.__wevuTemplateRefs.length>0&&o(`templateRefs`,`teardownRuntimeInstance(template refs)`).clear(t)},()=>{!n?.skipHooks&&r&&t[_]&&i(t,`onUnload`,[])},()=>{t[_]&&(t[_]=void 0)},()=>{if(Array.isArray(a))for(let e of a)try{e()}catch{}},()=>{t[E]=void 0},()=>{l?.stop()},()=>{t[g]=void 0},()=>r?.unmount(),()=>{(r?.adapter)?.__wevu_disposeSetData?.()},()=>{delete t[T],delete t[me]},()=>{delete t.__wevu},()=>{C in t&&delete t[C]},()=>{delete t[x]},()=>{delete t[S]},()=>{delete t[w]}])}function L(e,t,n,r,i){let a=e.__wevu,o=a?D.get(a):void 0,s=a?M(a,e.data,i?.stateSnapshot):void 0,c=e[x],l=c&&f(c)?c:void 0;I(e,{skipHooks:!0,preserveNativeDeclarationChildren:!0});let u=k(e,t,n,r,{deferSetData:!0,snapshotOmitKeys:i?.snapshotOmitKeys,attached:i?.attached,layoutParent:l}),d=s??(i?.stateSnapshot?M(u,i.stateSnapshot,i.stateSnapshot):void 0);if(d){let t=e.data;t&&typeof t==`object`&&Object.assign(t,O(d)),N(e,{includeSetupState:!0,nativeData:d,initialSetupState:o})}return!a||a===u?u:j(e,a,u)}export{P as enableDeferredSetData,k as mountRuntimeInstance,L as refreshRuntimeInstance,F as setRuntimeSetDataVisibility,I as teardownRuntimeInstance};
|
|
1
|
+
import{effectScope as e}from"../../reactivity/core.mjs";import{isReactive as t}from"../../reactivity/reactive.mjs";import{isRef as n}from"../../reactivity/ref.mjs";import{getMiniProgramRuntimeGlobalObject as r}from"../platform.mjs";import{callHookList as i}from"../hooks/base.mjs";import{isSetDataHighFrequencyWarningRequested as a,requireRuntimeCapability as o,runtimeCapabilityRegistry as s}from"../capabilities.mjs";import{runTeardownSteps as c}from"../teardown.mjs";import{observePhysicalDispatch as l}from"../app/setData/observation.mjs";import{applySnapshotUpdate as u,isDeepEqualValue as d}from"../app/setData/snapshot.mjs";import{observeSetDataCompletion as ee}from"../app/setData/commitTracker.mjs";import{isRuntimeLayoutComponentTarget as f}from"../layoutComponentMatcher.mjs";import{attachRuntimeSlots as te,createNoopWatchStopHandle as ne,safeMarkNoSetData as re}from"./runtimeInstance/setupContext.mjs";import{bridgeRuntimeMethodsToTarget as ie}from"./runtimeInstance/methodBridge.mjs";import{releaseNativeDeclaration as p}from"./runtimeInstance/nativeDeclaration.mjs";import{attachRuntimeProvideParentContext as ae}from"./runtimeInstance/provideContext.mjs";import{attachNativeInstanceRef as oe,attachRuntimeInstance as se,attachRuntimeRef as ce,callNativeSetData as m,ensureRuntimeProps as le,resolveNativeSetData as ue}from"./runtimeInstance/utils.mjs";import{runRuntimeSetupPhase as de}from"./runtimeInstance/setupPhase.mjs";import{restoreReactiveSetupSnapshot as h}from"./runtimeInstance/setupSnapshot.mjs";import{registerWatches as fe}from"./watch.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as pe,WEVU_EFFECT_SCOPE_KEY as g,WEVU_EXPOSED_KEY as me,WEVU_HOOKS_KEY as _,WEVU_HOST_COMMIT_PROMISE_KEY as v,WEVU_NATIVE_SLOT_CONTEXT_KEY as y,WEVU_ON_BEFORE_UNMOUNT_HOOK as b,WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as he,WEVU_PARENT_INSTANCE_KEY as x,WEVU_PROPS_DERIVED_KEYS_KEY as ge,WEVU_PROVIDES_KEY as S,WEVU_PUBLIC_RUNTIME_KEY as C,WEVU_RUNTIME_APP_KEY as w,WEVU_SETUP_CONTEXT_INSTANCE_KEY as T,WEVU_SLOT_OWNER_ID_KEY as _e,WEVU_WATCH_STOPS_KEY as E}from"@weapp-core/constants";const D=/* @__PURE__ */ new WeakMap;function O(e,t=/* @__PURE__ */ new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(O(r,t));return n}let n={};t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=O(i,t);return n}function ve(e,t){let n=e??{};for(let[e,r]of Object.entries(t)){let t;for(let r of Object.keys(n))if(e.startsWith(`${r}.`)){t=r;break}if(t){let i={value:n[t]};u(i,`value.${e.slice(t.length+1)}`,r,`set`,{cloneValue:!1,clonedParents:/* @__PURE__ */ new WeakSet}),n[t]=i.value;continue}let i=`${e}.`;for(let e of Object.keys(n))e.startsWith(i)&&delete n[e];n[e]=r}return n}function ye(e,t,n){let r=e.data;if((!r||typeof r!=`object`)&&(!n||!Object.keys(n).length))return;let i=Array.isArray(t)&&t.length?new Set(t):void 0,a={};if(r&&typeof r==`object`)for(let[e,t]of Object.entries(r))i?.has(e)||(a[e]=O(t));if(n)for(let[e,t]of Object.entries(n))i?.has(e)||(a[e]=O(t));return a}function be(e){return!!e?.__wevuHasTemplateRuntimeBindings}function k(e,t,n,r,i){if(e.__wevu)return import.meta.env?.PROD!==!0&&e[w]&&e[w]!==t?L(e,t,n,r,{snapshotOmitKeys:i?.snapshotOmitKeys,attached:i?.attached}):e.__wevu;try{return A(e,t,n,r,i)}catch(t){try{I(e,{skipHooks:!0})}catch{}throw t}}function A(e,n,c,u,d){let f=n.__wevuSetDataOptions,p=be(n)?o(`scopedSlots`,`mountRuntimeInstance(scoped-slot bindings)`):void 0,h=p?.prepareMount(e),g=e.__wevuTemplateRefs;Array.isArray(g)&&g.length&&o(`templateRefs`,`mountRuntimeInstance(template refs)`);let me=a(f?.highFrequencyWarning)?o(`setDataHighFrequencyWarning`,`mountRuntimeInstance(setData.highFrequencyWarning)`):void 0;ae(e,n,d?.attached,d?.layoutParent),re(e);let _=!!f?.suspendWhenHidden,y=typeof e.route==`string`&&e.route?`page:${e.route}`:typeof e.is==`string`&&e.is?`component:${e.is}`:`unknown-target`,b=me?.createMonitor({option:f?.highFrequencyWarning,targetLabel:y,isInPageScrollHook:()=>Number(e[he]??0)>0}),x=!0,S=!d?.deferSetData,w=!1,T=0,k,A,j,M,N=[],P=!(v in e),F=0,I=!1,L,R,z,B,V=()=>{F||k||R||(I=!1,L=void 0)},H=()=>{F||k||(I?B?.(L):z?.(),R=void 0,z=void 0,B=void 0)},xe=()=>{P&&(F+=1)},U=(e=`committed`,t)=>{P&&!w&&(e===`failed`&&!I&&(I=!0,L=t),--F,H())},Se=e=>U(`failed`,e);P&&Object.defineProperty(e,v,{configurable:!0,enumerable:!1,get:()=>!F&&!k?I?Promise.reject(L):void 0:(R??(R=new Promise((e,t)=>{z=e,B=t})),R)});let W=()=>{h&&s.scopedSlots?.refresh(e,h)},G=()=>{if(w)return;let t=e.__wevuTemplateRefs;!s.templateRefs&&(!Array.isArray(t)||!t.length)?P&&U():o(`templateRefs`,`mountRuntimeInstance(template ref completion)`).schedule(e,P?U:void 0,e,P?Se:void 0)},Ce=()=>{h&&p?.syncNativeOwnerId(e,h)},we=(e,t)=>{let n={settle:e,next:void 0};j?j.next=n:A=n,j=n,t&&(M??(M=[])).push(t)},K=(e,t,n)=>{let r=e,i=!0;for(;r;){let e=r.next;r.next=void 0,t===`failed`&&!i?r.settle(`abandoned`):r.settle(t,n),r=e,i=!1}},Te=(t,n,r)=>{let i=T;xe(),W(),ee({observer:r,invoke:n=>{let i=ue(e);if(!i)n();else return r&&l(r,t),m(e,i,t,n)},completion:`callback`,settle:(e,t)=>{if(!(w||i!==T)){if(e!==`committed`)U(e,t),n(e,t);else{try{n(e,t)}catch(e){throw U(`failed`,e),e}G()}}}})},Ee=()=>{if(!k)return;let e=k,t=A,n=N;k=void 0,A=void 0,j=void 0,N=[];let r=M;M=void 0,Te(e,(e,r)=>{if(e===`committed`)try{for(let e of n)e()}finally{K(t,e,r)}else K(t,e,r)},r&&{dispatch:e=>r.forEach(t=>t.dispatch(e)),returned:e=>r.forEach(t=>t.returned(e)),complete:e=>r.forEach(t=>t.complete(e))})},De=()=>{M=void 0;let e=A;k=void 0,A=void 0,j=void 0,N=[],K(e,`abandoned`),H()},Oe=e=>{V(),k=ve(k,e)},q={setData(t,n){if(b?.(),!S||_&&!x){Oe(t),n&&N.push(n),W();return}W(),V(),xe();let r=ue(e);if(!r){try{n?.()}catch(e){throw U(`failed`,e),e}G();return}let i=!0,a=!1,o=!1,s=!1,c=e=>{s||(s=!0,U(`failed`,e))},l=()=>{s||(s=!0,G())},u=()=>{try{n?.()}catch(e){throw c(e),e}i?a=!0:o||l()},d;try{d=m(e,r,t,u)}catch(e){throw c(e),e}return i=!1,o=!!(d&&typeof d.then==`function`),d&&typeof d.then==`function`?d.then(()=>{l()},e=>{throw c(e),e}):(a&&l(),d)},__wevu_dispatchSetData(e,t,n){b?.(),w?t(`abandoned`):!S||_&&!x?(Oe(e),we(t,n),W()):(V(),Te(e,t,n))},__wevu_enableSetData(e=!1){S=!0,e?De():Ee()},__wevu_setVisibility(e){x=e,x&&S&&Ee()},__wevu_disposeSetData(){w||(w=!0,T+=1,k=void 0,A=void 0,j=void 0,N=[],F=0,I=!1,L=void 0,H(),P&&Reflect.deleteProperty(e,v))}};Object.defineProperty(q,"__wevu_reportSetDataError",{configurable:!0,enumerable:!1,value:t=>{i(e,`onError`,[t])},writable:!1}),Object.defineProperty(q,"__wevu_targetLabel",{configurable:!0,enumerable:!1,value:y,writable:!1});let J=e.properties;J&&typeof J==`object`&&Object.defineProperty(q,"__wevu_initialProps",{configurable:!0,enumerable:!1,value:J,writable:!1}),Array.isArray(d?.snapshotOmitKeys)&&d.snapshotOmitKeys.length&&Object.defineProperty(q,"__wevu_snapshotOmitKeys",{configurable:!0,enumerable:!1,value:d.snapshotOmitKeys,writable:!1});let Y=ye(e,d?.snapshotOmitKeys);Y&&Object.keys(Y).length&&Object.defineProperty(q,"__wevu_initialSnapshot",{configurable:!0,enumerable:!1,value:Y,writable:!1}),h&&Object.defineProperty(q,"__wevu_initialState",{configurable:!0,enumerable:!1,value:{[_e]:h.ownerId},writable:!1}),(d?.deferSetData||u||J&&typeof J==`object`&&Object.keys(J).length>0)&&Object.defineProperty(q,"__wevu_deferInitialSnapshot",{configurable:!0,enumerable:!1,value:!0,writable:!1});let X=n.mount(q);se(X,e);let ke=X?.proxy??{},Z=X?.state??{},Ae=X?.setupState??Object.create(null);Z&&typeof Z==`object`&&(ce(Z,X),oe(Z,e));let je=X?.computed??Object.create(null);if(!X?.methods)try{X.methods=Object.create(null)}catch{}let Me=X?.methods??Object.create(null),Ne=X?.watch??(()=>ne()),Pe=X?.bindModel??(()=>{}),Q={...X??{},state:Z,setupState:Ae,proxy:ke,methods:Me,computed:je,watch:Ne,bindModel:Pe,snapshot:X?.snapshot??(()=>Object.create(null)),unmount:X?.unmount??(()=>{})};Object.defineProperty(Q,"__wevu_initialRuntimeSnapshot",{configurable:!0,enumerable:!1,value:O(Z),writable:!1});let Fe=Q,Ie={__wevu_flushSetupSnapshotSync:X.__wevu_flushSetupSnapshotSync,__wevu_touchSetupMethodsVersion:X.__wevu_touchSetupMethodsVersion,__wevu_trackSetupReactiveKey:X.__wevu_trackSetupReactiveKey,__wevu_cloneDispatchedSnapshot:X.__wevu_cloneDispatchedSnapshot,[ge]:X[ge]};for(let[e,t]of Object.entries(Ie))t&&Object.defineProperty(Q,e,{configurable:!0,enumerable:!1,value:t,writable:!0});Object.defineProperty(e,C,{value:Q,configurable:!0,enumerable:!1,writable:!1}),e.__wevu=Q;let Le=le(e,Z);te(Z,Le),h&&p?.attachMount(e,Q,h,!!d?.deferSetData),Ce(),u&&de({target:e,runtime:X,runtimeWithDefaults:Q,runtimeState:Z,runtimeProxy:ke,setup:u});let $=c?fe(Q,c,e):[];if($.length&&(e[E]=$),u){if(import.meta.env?.PROD!==!0&&typeof r()?.[pe]?.trackWevuComponent==`function`){let e={};for(let[n,r]of Object.entries(Q.setupState??{}))t(r)&&(e[n]=O(r));D.set(Q,e)}d?.deferSetData||Fe.__wevu_flushSetupSnapshotSync?.(),d?.deferSetData||W()}else!d?.deferSetData&&e.properties&&typeof e.properties==`object`&&Object.keys(e.properties).length>0&&(Fe.__wevu_flushSetupSnapshotSync?.(),W());return ie(e,X),X}function j(e,t,n){for(let e of Reflect.ownKeys(t))Reflect.has(n,e)||Reflect.getOwnPropertyDescriptor(t,e)?.configurable&&Reflect.deleteProperty(t,e);for(let e of Reflect.ownKeys(n)){let r=Reflect.getOwnPropertyDescriptor(n,e);if(r)try{Reflect.defineProperty(t,e,r)}catch{try{t[e]=n[e]}catch{}}}ce(t.state,t);let r=D.get(n);return r&&D.set(t,r),e.__wevu=t,Object.defineProperty(e,C,{value:t,configurable:!0,enumerable:!1,writable:!1}),t}function M(e,r,i){let a=e.state,o=e.setupState,s={};for(let e of Object.keys(r??{})){if(!Object.prototype.hasOwnProperty.call(a,e))continue;let r=o?.[e];(!o||!Object.prototype.hasOwnProperty.call(o,e)||n(r)||t(r))&&(s[e]=i&&Object.prototype.hasOwnProperty.call(i,e)?O(i[e]):O(n(r)?r.value:a[e]))}return s}function N(e,r){let i=e.__wevu,a=i?.state,o=i?.setupState,s=r?.nativeData??e.data;if(!a||typeof a!=`object`||!s||typeof s!=`object`)return;let c=i?.__wevu_initialRuntimeSnapshot;for(let[e,i]of Object.entries(s))if(e&&e!==`undefined`&&Object.prototype.hasOwnProperty.call(a,e))try{let s=o?.[e],l=O(i);if(o&&Object.prototype.hasOwnProperty.call(o,e)&&(!r?.includeSetupState||!n(s)&&!t(s))||!r?.includeSetupState&&c&&Object.prototype.hasOwnProperty.call(c,e)&&!d(a[e],c[e],20,{keys:1e4})||!r?.includeSetupState&&c&&!Object.prototype.hasOwnProperty.call(c,e))continue;if(n(s)){s.value=l;continue}if(t(s)&&l&&typeof l==`object`){h(s,l,r?.initialSetupState?.[e]);continue}a[e]=l}catch{}}function P(e,t){let n=e.__wevu?.adapter;N(e,{includeSetupState:t?.rehydrateSetupState}),n?.__wevu_enableSetData?.(!0),e.__wevu?.__wevu_flushSetupSnapshotSync?.()}function F(e,t){(e.__wevu?.adapter)?.__wevu_setVisibility?.(t)}function I(t,n){let r=t.__wevu,a=t[E],l=t[g];c([()=>{if(!n?.skipHooks&&r&&t[_]?.[b]){if(l?.active)l.run(()=>i(t,b));else{let n=e(!0);c([()=>n.run(()=>i(t,b)),()=>n.stop()])}}},...(!import.meta.env?.PLATFORM||import.meta.env?.PLATFORM===`weapp`)&&t[y]===!0?[()=>p(t,n?.preserveNativeDeclarationChildren)]:[],()=>s.scopedSlots?.teardown(t),()=>{Array.isArray(t.__wevuTemplateRefs)&&t.__wevuTemplateRefs.length>0&&o(`templateRefs`,`teardownRuntimeInstance(template refs)`).clear(t)},()=>{!n?.skipHooks&&r&&t[_]&&i(t,`onUnload`,[])},()=>{t[_]&&(t[_]=void 0)},()=>{if(Array.isArray(a))for(let e of a)try{e()}catch{}},()=>{t[E]=void 0},()=>{l?.stop()},()=>{t[g]=void 0},()=>r?.unmount(),()=>{(r?.adapter)?.__wevu_disposeSetData?.()},()=>{delete t[T],delete t[me]},()=>{delete t.__wevu},()=>{C in t&&delete t[C]},()=>{delete t[x]},()=>{delete t[S]},()=>{delete t[w]}])}function L(e,t,n,r,i){let a=e.__wevu,o=a?D.get(a):void 0,s=a?M(a,e.data,i?.stateSnapshot):void 0,c=e[x],l=c&&f(c)?c:void 0;I(e,{skipHooks:!0,preserveNativeDeclarationChildren:!0});let u=k(e,t,n,r,{deferSetData:!0,snapshotOmitKeys:i?.snapshotOmitKeys,attached:i?.attached,layoutParent:l}),d=s??(i?.stateSnapshot?M(u,i.stateSnapshot,i.stateSnapshot):void 0);if(d){let t=e.data;t&&typeof t==`object`&&Object.assign(t,O(d)),N(e,{includeSetupState:!0,nativeData:d,initialSetupState:o})}return!a||a===u?u:j(e,a,u)}export{P as enableDeferredSetData,k as mountRuntimeInstance,L as refreshRuntimeInstance,F as setRuntimeSetDataVisibility,I as teardownRuntimeInstance};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentMiniProgramGlobalObject as e}from"../platform/current.mjs";import{getCurrentMiniProgramHostConfig as t,getMiniProgramRuntimeConsoleWarn as n}from"../platform.mjs";function r(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function i(e){let t={devOnly:!0,sampleWindowMs:1e3,maxCalls:30,coolDownMs:5e3,warnOnPageScroll:!0,pageScrollCoolDownMs:2e3};return e===void 0||e===!1?{...t,enabled:!1}:e===!0?{...t,enabled:!0}:r(e)?{enabled:e.enabled??!0,devOnly:e.devOnly??t.devOnly,sampleWindowMs:typeof e.sampleWindowMs==`number`?Math.max(100,Math.floor(e.sampleWindowMs)):t.sampleWindowMs,maxCalls:typeof e.maxCalls==`number`?Math.max(1,Math.floor(e.maxCalls)):t.maxCalls,coolDownMs:typeof e.coolDownMs==`number`?Math.max(0,Math.floor(e.coolDownMs)):t.coolDownMs,warnOnPageScroll:e.warnOnPageScroll??t.warnOnPageScroll,pageScrollCoolDownMs:typeof e.pageScrollCoolDownMs==`number`?Math.max(0,Math.floor(e.pageScrollCoolDownMs)):t.pageScrollCoolDownMs}:{...t,enabled:!1}}function a(){let n=t();if(n?.debug===!0||n?.envVersion===`develop`)return!0;let r=e();try{if(r?.getAccountInfoSync?.()?.miniProgram?.envVersion===`develop`)return!0}catch{}return!1}function o(e){let t=i(e.option);if(!t.enabled)return;let r=a();if(t.devOnly&&!r)return;let o=e.now??(()=>Date.now()),s=e.logger??(e=>{let t=n();typeof t==`function`&&t(e)}),c=[],l=-1/0,u=-1/0;return()=>{let n=o();c.push(n);let r=n-t.sampleWindowMs;for(;c.length>0&&c[0]<r;)c.shift();let i=e.isInPageScrollHook?.()??!1;t.warnOnPageScroll&&i&&(t.pageScrollCoolDownMs<=0||n-u>=t.pageScrollCoolDownMs)&&(u=n,s(`[wevu:setData] 检测到 onPageScroll 回调内调用 setData(${e.targetLabel})。建议改用 IntersectionObserver 监听可见性,或对滚动更新做节流。`))
|
|
1
|
+
import{getCurrentMiniProgramGlobalObject as e}from"../platform/current.mjs";import{getCurrentMiniProgramHostConfig as t,getMiniProgramRuntimeConsoleWarn as n}from"../platform.mjs";function r(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function i(e){let t={devOnly:!0,sampleWindowMs:1e3,maxCalls:30,coolDownMs:5e3,warnOnPageScroll:!0,pageScrollCoolDownMs:2e3};return e===void 0||e===!1?{...t,enabled:!1}:e===!0?{...t,enabled:!0}:r(e)?{enabled:e.enabled??!0,devOnly:e.devOnly??t.devOnly,sampleWindowMs:typeof e.sampleWindowMs==`number`?Math.max(100,Math.floor(e.sampleWindowMs)):t.sampleWindowMs,maxCalls:typeof e.maxCalls==`number`?Math.max(1,Math.floor(e.maxCalls)):t.maxCalls,coolDownMs:typeof e.coolDownMs==`number`?Math.max(0,Math.floor(e.coolDownMs)):t.coolDownMs,warnOnPageScroll:e.warnOnPageScroll??t.warnOnPageScroll,pageScrollCoolDownMs:typeof e.pageScrollCoolDownMs==`number`?Math.max(0,Math.floor(e.pageScrollCoolDownMs)):t.pageScrollCoolDownMs}:{...t,enabled:!1}}function a(){let n=t();if(n?.debug===!0||n?.envVersion===`develop`)return!0;let r=e();try{if(r?.getAccountInfoSync?.()?.miniProgram?.envVersion===`develop`)return!0}catch{}return!1}function o(e){let t=i(e.option);if(!t.enabled)return;let r=a();if(t.devOnly&&!r)return;let o=e.now??(()=>Date.now()),s=e.logger??(e=>{let t=n();typeof t==`function`&&t(e)}),c=[],l=-1/0,u=-1/0;return()=>{let n=o();c.push(n);let r=n-t.sampleWindowMs;for(;c.length>0&&c[0]<r;)c.shift();let i=e.isInPageScrollHook?.()??!1;t.warnOnPageScroll&&i&&(t.pageScrollCoolDownMs<=0||n-u>=t.pageScrollCoolDownMs)&&(u=n,s(`[wevu:setData] 检测到 onPageScroll 回调内调用 setData(${e.targetLabel})。建议改用 IntersectionObserver 监听可见性,或对滚动更新做节流。`)),c.length<=t.maxCalls||t.coolDownMs>0&&n-l<t.coolDownMs||(l=n,s(`[wevu:setData] 检测到高频 setData 调用:${c.length} 次/${t.sampleWindowMs}ms(${e.targetLabel})。建议合并更新或降低调用频率。`))}}export{o as createSetDataHighFrequencyWarningMonitor,a as isDevelopmentRuntime,i as resolveHighFrequencyWarningOptions};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/runtime/register/setup.d.ts
|
|
2
1
|
type SetupRunner = {
|
|
3
2
|
bivarianceHack: (props: Record<string, any>, ctx: any) => any;
|
|
4
3
|
}['bivarianceHack'];
|
|
@@ -7,5 +6,4 @@ type SetupRunner = {
|
|
|
7
6
|
* @internal
|
|
8
7
|
*/
|
|
9
8
|
export declare function runSetupFunction(setup: SetupRunner | undefined, props: Record<string, any>, context: any): unknown;
|
|
10
|
-
//#endregion
|
|
11
9
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "../../reactivity/index.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/register/watch.d.ts
|
|
4
3
|
type WatchHandler = (this: any, value: any, oldValue: any) => void;
|
|
5
4
|
export type WatchDescriptor = WatchHandler | string | {
|
|
6
5
|
handler: WatchHandler | string;
|
|
@@ -8,5 +7,4 @@ export type WatchDescriptor = WatchHandler | string | {
|
|
|
8
7
|
deep?: boolean;
|
|
9
8
|
};
|
|
10
9
|
export type WatchMap = Record<string, WatchDescriptor>;
|
|
11
|
-
//#endregion
|
|
12
10
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { HostMiniProgramBoundingClientRectResult, HostMiniProgramNodesRefFields, HostMiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery } from "./types/miniprogramHost.mjs";
|
|
2
2
|
import { InternalRuntimeState } from "./types/runtime.mjs";
|
|
3
3
|
import "./types.mjs";
|
|
4
|
-
//#region src/runtime/selectorQuery.d.ts
|
|
5
4
|
export interface UseSelectorQueryOptions {
|
|
6
5
|
context?: InternalRuntimeState | null;
|
|
7
6
|
}
|
|
@@ -49,5 +48,4 @@ export declare function useSelectorFields(options: UseAllSelectorFieldsOptions):
|
|
|
49
48
|
export declare function useScrollOffset(options?: UseScrollOffsetOptions & {
|
|
50
49
|
all?: false;
|
|
51
50
|
}): (selector: string) => Promise<HostMiniProgramScrollOffsetResult | null>;
|
|
52
|
-
export declare function useScrollOffset(options: UseAllScrollOffsetOptions): (selector: string) => Promise<HostMiniProgramScrollOffsetResult[] | null>;
|
|
53
|
-
//#endregion
|
|
51
|
+
export declare function useScrollOffset(options: UseAllScrollOffsetOptions): (selector: string) => Promise<HostMiniProgramScrollOffsetResult[] | null>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
//#region src/runtime/template.d.ts
|
|
2
1
|
export declare function normalizeStyle(value: any): string;
|
|
3
2
|
export declare function normalizeClass(value: any): string;
|
|
4
|
-
export declare function resolvePropValue(target: any, key: string, fallback: any, preferProps?: boolean): any;
|
|
5
|
-
//#endregion
|
|
3
|
+
export declare function resolvePropValue(target: any, key: string, fallback: any, preferProps?: boolean): any;
|
|
@@ -2,8 +2,6 @@ import { TemplateRefValue } from "./types.mjs";
|
|
|
2
2
|
import { AlipayIntrinsicElements } from "@weapp-core/types/alipay";
|
|
3
3
|
import { TtIntrinsicElements } from "@weapp-core/types/tt";
|
|
4
4
|
import { WeappIntrinsicElements } from "@weapp-core/types/weapp";
|
|
5
|
-
//#region src/runtime/templateRefTypes.d.ts
|
|
6
5
|
type MiniProgramTemplateRefTagName = keyof AlipayIntrinsicElements | keyof TtIntrinsicElements | keyof WeappIntrinsicElements;
|
|
7
6
|
export type MiniProgramTemplateRefElements = { [K in MiniProgramTemplateRefTagName]: TemplateRefValue; };
|
|
8
|
-
//#endregion
|
|
9
7
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComputedDefinitions, ExtractComputed, ExtractMethods, MethodDefinitions } from "../../types/definitions.mjs";
|
|
2
|
-
//#region src/runtime/types/core.d.ts
|
|
3
2
|
export type ComponentPublicInstance<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, P = Record<string, any>, S = Record<string, any>> = D & ExtractComputed<C> & ExtractMethods<M> & {
|
|
4
3
|
$attrs: Record<string, any>;
|
|
5
4
|
$props: P;
|
|
@@ -26,5 +25,4 @@ export interface ModelBinding<T = any> {
|
|
|
26
25
|
update: (value: T) => void;
|
|
27
26
|
model: <Event extends string = 'input', ValueProp extends string = 'value', Formatted = T>(options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => ModelBindingPayload<T, Event, ValueProp, Formatted>;
|
|
28
27
|
}
|
|
29
|
-
//#endregion
|
|
30
28
|
export type { ComputedDefinitions, ExtractComputed, ExtractMethods, MethodDefinitions };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
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 "./miniprogramHost.mjs";
|
|
2
|
-
//#region src/runtime/types/miniprogram.d.ts
|
|
3
2
|
export interface MiniProgramAdapter {
|
|
4
3
|
/**
|
|
5
4
|
* 下发视图数据。返回 `void` 表示同步完成;异步适配器必须返回在宿主提交后兑现的 Promise。
|
|
@@ -79,5 +78,4 @@ export type MiniProgramPageLifetimes = Partial<HostMiniProgramPageLifetime>;
|
|
|
79
78
|
export type MiniProgramComponentRawOptions = Omit<HostMiniProgramComponentTrivialOption, 'behaviors'> & {
|
|
80
79
|
behaviors?: MiniProgramBehaviorIdentifier[];
|
|
81
80
|
} & MiniProgramPageLifetimes & Record<string, any>;
|
|
82
|
-
//#endregion
|
|
83
81
|
export type { HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, HostMiniProgramNodesRef as MiniProgramNodesRef, HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, HostMiniProgramPageLifetime as MiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, HostMiniProgramRouter as MiniProgramRouter, HostMiniProgramSaveExitState as MiniProgramSaveExitState, HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, HostMiniProgramTriggerEventOptions as TriggerEventOptions };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract } from "./miniprogramHostSources.mjs";
|
|
2
|
-
//#region src/runtime/types/miniprogramHost.d.ts
|
|
3
2
|
export type HostMiniProgramComponentBehaviorOptions = MiniProgramHostNamespace.Component.ComponentOptions;
|
|
4
3
|
export type HostMiniProgramComponentTrivialOption = MiniProgramHostNamespace.Component.TrivialOption;
|
|
5
4
|
export type HostMiniProgramBehaviorIdentifier = MiniProgramHostNamespace.Behavior.Identifier;
|
|
@@ -40,5 +39,4 @@ export type HostMiniProgramAppOptions<T extends Record<string, any>> = MiniProgr
|
|
|
40
39
|
export type HostMiniProgramComponentTrivialInstance = MiniProgramHostNamespace.Component.TrivialInstance;
|
|
41
40
|
export type HostMiniProgramPageTrivialInstance = MiniProgramHostNamespace.Page.TrivialInstance;
|
|
42
41
|
export type HostMiniProgramAppTrivialInstance = MiniProgramHostNamespace.App.TrivialInstance;
|
|
43
|
-
//#endregion
|
|
44
42
|
export type { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="miniprogram-api-typings" preserve="true" />
|
|
2
|
-
//#region src/runtime/types/miniprogramHostSources.d.ts
|
|
3
2
|
export declare namespace WechatMiniProgramHostNamespace {
|
|
4
3
|
export import App = WechatMiniprogram.App;
|
|
5
4
|
export import Behavior = WechatMiniprogram.Behavior;
|
|
@@ -108,5 +107,4 @@ export interface MiniProgramRuntimeHostSourceRegistry {
|
|
|
108
107
|
export interface MiniProgramHostSourceRegistry extends MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostSourceRegistry {}
|
|
109
108
|
export type MiniProgramPlatformHostNamespaceBySource<TSourceName extends MiniProgramPlatformHostSourceName = MiniProgramPlatformHostSourceName> = MiniProgramPlatformHostSourceRegistry[TSourceName];
|
|
110
109
|
export type MiniProgramRuntimeHostNamespaceBySource<TSourceName extends MiniProgramRuntimeHostSourceName = MiniProgramRuntimeHostSourceName> = MiniProgramRuntimeHostSourceRegistry[TSourceName];
|
|
111
|
-
export type MiniProgramHostNamespaceBySource<TSourceName extends MiniProgramHostSourceName = MiniProgramHostSourceName> = MiniProgramHostSourceRegistry[TSourceName];
|
|
112
|
-
//#endregion
|
|
110
|
+
export type MiniProgramHostNamespaceBySource<TSourceName extends MiniProgramHostSourceName = MiniProgramHostSourceName> = MiniProgramHostSourceRegistry[TSourceName];
|
|
@@ -7,7 +7,6 @@ import { ComponentPublicInstance } from "./core.mjs";
|
|
|
7
7
|
import { SetupContext, SetupFunction } from "./props/setup.mjs";
|
|
8
8
|
import "./props.mjs";
|
|
9
9
|
import { ShallowUnwrapRef } from "../../vue-types.mjs";
|
|
10
|
-
//#region src/runtime/types/options.d.ts
|
|
11
10
|
export type DataOption<D extends object> = D | (() => D);
|
|
12
11
|
type SetupThis<S> = [Exclude<S, void>] extends [never] ? Record<never, never> : ShallowUnwrapRef<Exclude<S, void>>;
|
|
13
12
|
export interface DefineComponentOptions<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, S extends Record<string, any> | void = Record<string, any> | void> extends MiniProgramComponentOptions, MiniProgramPageLifetimes {
|
|
@@ -87,5 +86,4 @@ export interface CreateAppOptions<D extends object = Record<string, any>, C exte
|
|
|
87
86
|
setup?: (props: AppSetupProps, ctx: SetupContext<D, C, M, AppSetupProps>) => Record<string, any> | void;
|
|
88
87
|
[key: string]: any;
|
|
89
88
|
}
|
|
90
|
-
//#endregion
|
|
91
89
|
export type { PageFeatures };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HostMiniProgramComponentAllProperty, HostMiniProgramComponentShortProperty } from "../miniprogramHost.mjs";
|
|
2
|
-
//#region src/runtime/types/props/propTypes.d.ts
|
|
3
2
|
type PropMethod<T, TConstructor = any> = [T] extends [((...args: any) => any) | undefined] ? {
|
|
4
3
|
new (): TConstructor;
|
|
5
4
|
(): T;
|
|
@@ -75,5 +74,4 @@ export type InferProps<P extends ComponentPropsOptions = ComponentPropsOptions>
|
|
|
75
74
|
export type ExtractPropTypes<P extends ComponentPropsOptions = ComponentPropsOptions> = InferProps<P>;
|
|
76
75
|
export type ExtractPublicPropTypes<P extends ComponentPropsOptions = ComponentPropsOptions> = InferProps<P>;
|
|
77
76
|
export type ExtractDefaultPropTypes<P extends ComponentPropsOptions = ComponentPropsOptions> = { [K in keyof Pick<P, DefaultKeys<P>>]: InferPropType<P[K]>; };
|
|
78
|
-
//#endregion
|
|
79
77
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HostMiniProgramNavigateToOption, HostMiniProgramReLaunchOption, HostMiniProgramRedirectToOption, HostMiniProgramRouter, HostMiniProgramSwitchTabOption } from "../miniprogramHost.mjs";
|
|
2
|
-
//#region src/runtime/types/props/router.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Router 路由类型映射(供声明合并扩展)。
|
|
5
4
|
*
|
|
@@ -47,5 +46,4 @@ export interface SetupContextRouter {
|
|
|
47
46
|
navigateTo: (option: MiniProgramRouterNavigateToOption) => ReturnType<HostMiniProgramRouter['navigateTo']>;
|
|
48
47
|
navigateBack: HostMiniProgramRouter['navigateBack'];
|
|
49
48
|
}
|
|
50
|
-
//#endregion
|
|
51
49
|
export {};
|
|
@@ -4,7 +4,6 @@ import { SetupContextRouter } from "./router.mjs";
|
|
|
4
4
|
import { ComputedDefinitions, MethodDefinitions } from "../../../types/definitions.mjs";
|
|
5
5
|
import "../core.mjs";
|
|
6
6
|
import { InternalRuntimeState, RuntimeInstance } from "../runtime.mjs";
|
|
7
|
-
//#region src/runtime/types/props/setup.d.ts
|
|
8
7
|
export type SetupContextSelectorQuery = HostMiniProgramSelectorQuery;
|
|
9
8
|
export type SetupContextIntersectionObserverOptions = HostMiniProgramIntersectionObserverOptions;
|
|
10
9
|
export type SetupContextIntersectionObserver = HostMiniProgramIntersectionObserver;
|
|
@@ -92,5 +91,4 @@ export interface SetupContext<D extends object, C extends ComputedDefinitions, M
|
|
|
92
91
|
* Vue 3 对齐:slots(由编译期传入的 slot 名元数据驱动)
|
|
93
92
|
*/
|
|
94
93
|
slots: Record<string, any>;
|
|
95
|
-
}
|
|
96
|
-
//#endregion
|
|
94
|
+
}
|
|
@@ -5,7 +5,6 @@ import { Ref } from "../../reactivity/ref.mjs";
|
|
|
5
5
|
import { EffectScope } from "../../reactivity/core.mjs";
|
|
6
6
|
import { WatchOptions, WatchStopHandle } from "../../reactivity/watch/types.mjs";
|
|
7
7
|
import "../../reactivity/index.mjs";
|
|
8
|
-
//#region src/runtime/types/runtime.d.ts
|
|
9
8
|
export interface AppConfig {
|
|
10
9
|
globalProperties: Record<string, any>;
|
|
11
10
|
}
|
|
@@ -56,5 +55,4 @@ export interface InternalRuntimeStateFields {
|
|
|
56
55
|
__wevuTemplateRefsPending?: boolean;
|
|
57
56
|
__wevuReadyCalled?: boolean;
|
|
58
57
|
}
|
|
59
|
-
export type InternalRuntimeState = InternalRuntimeStateFields & Partial<MiniProgramInstance>;
|
|
60
|
-
//#endregion
|
|
58
|
+
export type InternalRuntimeState = InternalRuntimeStateFields & Partial<MiniProgramInstance>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WevuBindingSourceSpanV1, WevuBindingUpdateMode } from "@weapp-core/constants";
|
|
2
|
-
//#region src/runtime/types/setData.d.ts
|
|
3
2
|
export interface SetDataSnapshotOptions {
|
|
4
3
|
/**
|
|
5
4
|
* 开发态高频 setData 告警。
|
|
@@ -262,5 +261,4 @@ export interface SetDataDebugInfo {
|
|
|
262
261
|
payloadBytes: number | null;
|
|
263
262
|
} | null;
|
|
264
263
|
};
|
|
265
|
-
}
|
|
266
|
-
//#endregion
|
|
264
|
+
}
|
package/dist/runtime/types.d.mts
CHANGED
|
@@ -12,7 +12,6 @@ import { SetupContext, SetupContextIntersectionObserver, SetupContextIntersectio
|
|
|
12
12
|
import "./types/props.mjs";
|
|
13
13
|
import { AllowedComponentProps, ComponentCustomProps, ComponentOptionsMixin, DefineComponent, NativeComponent, ObjectDirective, PublicProps, ShallowUnwrapRef, VNode, VNodeProps } from "../vue-types.mjs";
|
|
14
14
|
import { CreateAppOptions, DataOption, DefineAppOptions, DefineComponentOptions } from "./types/options.mjs";
|
|
15
|
-
//#region src/runtime/types.d.ts
|
|
16
15
|
export interface WevuGlobalComponents {}
|
|
17
16
|
export interface WevuGlobalDirectives {}
|
|
18
17
|
export interface GlobalComponents extends WevuGlobalComponents {}
|
|
@@ -26,5 +25,4 @@ export interface TemplateRefValue {
|
|
|
26
25
|
node: (cb?: (value: any) => void) => Promise<any | null>;
|
|
27
26
|
}
|
|
28
27
|
export type MiniProgramTemplateRefValue = TemplateRefValue;
|
|
29
|
-
//#endregion
|
|
30
28
|
export type { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, AllowedComponentProps, AppConfig, ComponentCustomProps, ComponentOptionsMixin, ComponentPropsOptions, ComponentPublicInstance, ComputedDefinitions, CreateAppOptions, DataOption, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DefineAppOptions, DefineComponent, DefineComponentOptions, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, ExtractComputed, ExtractDefaultPropTypes, ExtractMethods, ExtractPropTypes, ExtractPublicPropTypes, 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, InferNativePropType, InferNativeProps, InferPropType, InferProps, InternalRuntimeState, InternalRuntimeStateFields, MethodDefinitions, MiniProgramAdapter, HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, MiniProgramComponentInstance, HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, MiniProgramComponentOptions, HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramInstance, HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, HostMiniProgramNodesRef as MiniProgramNodesRef, HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, HostMiniProgramPageLifetime as MiniProgramPageLifetime, MiniProgramPageLifetimes, HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, HostMiniProgramRouter as MiniProgramRouter, MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, HostMiniProgramSaveExitState as MiniProgramSaveExitState, HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, ModelBinding, ModelBindingOptions, ModelBindingPayload, NativeComponent, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, ObjectDirective, PageFeatures, PropConstructor, PropOptions, PropType, PublicProps, RuntimeApp, RuntimeInstance, SetDataBindingDiagnostic, SetDataDebugInfo, SetDataSnapshotOptions, SetupContext, SetupContextIntersectionObserver, SetupContextIntersectionObserverOptions, SetupContextNativeInstance, SetupContextRouter, SetupContextSelectorQuery, SetupFunction, ShallowUnwrapRef, HostMiniProgramTriggerEventOptions as TriggerEventOptions, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, VNode, VNodeProps, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract, WevuPlugin, WevuTypedRouterRouteMap };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/runtime/updatePerformance.d.ts
|
|
2
1
|
export type UpdatePerformanceListenerResult = Record<string, any>;
|
|
3
2
|
export type UpdatePerformanceListener = (result: UpdatePerformanceListenerResult) => void;
|
|
4
3
|
export type UseUpdatePerformanceListenerStopHandle = () => void;
|
|
@@ -8,5 +7,4 @@ export type UseUpdatePerformanceListenerStopHandle = () => void;
|
|
|
8
7
|
* - 底层能力:`instance.setUpdatePerformanceListener(listener)`。
|
|
9
8
|
* - 清理策略:卸载时回传 `undefined` 作为监听器,平台不支持时静默降级。
|
|
10
9
|
*/
|
|
11
|
-
export declare function useUpdatePerformanceListener(listener: UpdatePerformanceListener): UseUpdatePerformanceListenerStopHandle;
|
|
12
|
-
//#endregion
|
|
10
|
+
export declare function useUpdatePerformanceListener(listener: UpdatePerformanceListener): UseUpdatePerformanceListenerStopHandle;
|
package/dist/runtime/use.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RuntimeApp, WevuPlugin } from "./types/runtime.mjs";
|
|
2
2
|
import "./types.mjs";
|
|
3
|
-
//#region src/runtime/use.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* 在 `app` 级 `setup()` 中显式获取运行时 app,提供与 `app.use()` / `app.provide()` 对齐的 SFC 写法。
|
|
6
5
|
*/
|
|
@@ -8,5 +7,4 @@ export declare function defineAppSetup<T>(setup: (app: RuntimeApp<any, any, any>
|
|
|
8
7
|
/**
|
|
9
8
|
* 在 `app` 级 `setup()` 中安装插件,提供与 `app.use()` 对齐的 SFC 调用方式。
|
|
10
9
|
*/
|
|
11
|
-
export declare function use(plugin: WevuPlugin, ...options: any[]): RuntimeApp<any, any, any>;
|
|
12
|
-
//#endregion
|
|
10
|
+
export declare function use(plugin: WevuPlugin, ...options: any[]): RuntimeApp<any, any, any>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { SetupContextNativeInstance } from "../types/props/setup.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/vueCompat/context.d.ts
|
|
4
3
|
export declare function useAttrs(): Record<string, any>;
|
|
5
4
|
export declare function useSlots(): Record<string, any>;
|
|
6
|
-
export declare function useNativeInstance(): SetupContextNativeInstance;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare function useNativeInstance(): SetupContextNativeInstance;
|
|
@@ -2,7 +2,6 @@ import { ModelBinding, ModelBindingOptions, ModelBindingPayload } from "../types
|
|
|
2
2
|
import { Ref } from "../../reactivity/ref.mjs";
|
|
3
3
|
import "../../reactivity/index.mjs";
|
|
4
4
|
import "../types.mjs";
|
|
5
|
-
//#region src/runtime/vueCompat/model.d.ts
|
|
6
5
|
export type ModelModifiers<M extends PropertyKey = string> = Record<M, true | undefined>;
|
|
7
6
|
export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [ModelRef<T, M, G, S>, ModelModifiers<M>];
|
|
8
7
|
export interface UseModelOptions<T, M extends PropertyKey = string, G = T, S = T> {
|
|
@@ -26,5 +25,4 @@ export declare function useBindModel<DefaultEvent extends string = 'input', Defa
|
|
|
26
25
|
*/
|
|
27
26
|
export 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
27
|
export declare function mergeModels<T>(a: T, b: T): T;
|
|
29
|
-
//#endregion
|
|
30
28
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SetupContextRouter } from "../types/props/router.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/vueCompat/router.d.ts
|
|
4
3
|
type RuntimeRouter = SetupContextRouter;
|
|
5
4
|
/**
|
|
6
5
|
* 获取与当前组件路径语义一致的原生 Router 对象。
|
|
@@ -25,5 +24,4 @@ export declare function useNativeRouter(): RuntimeRouter;
|
|
|
25
24
|
* 推荐改用 `wevu/router` 子入口的 `useRouter()`。
|
|
26
25
|
*/
|
|
27
26
|
export declare function useNativePageRouter(): RuntimeRouter;
|
|
28
|
-
//#endregion
|
|
29
27
|
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ShallowRef } from "../../reactivity/ref.mjs";
|
|
2
2
|
import "../../reactivity/index.mjs";
|
|
3
3
|
import { TemplateRefs } from "../types.mjs";
|
|
4
|
-
//#region src/runtime/vueCompat/templateRef.d.ts
|
|
5
4
|
export type TemplateRef<T = unknown> = Readonly<ShallowRef<T | null>>;
|
|
6
5
|
export declare function useTemplateRef<K extends keyof TemplateRefs>(name: K): TemplateRef<TemplateRefs[K]>;
|
|
7
|
-
export declare function useTemplateRef<T = unknown>(name: string): TemplateRef<T>;
|
|
8
|
-
//#endregion
|
|
6
|
+
export declare function useTemplateRef<T = unknown>(name: string): TemplateRef<T>;
|
package/dist/scheduler.d.mts
CHANGED
package/dist/store/define.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { DefineStoreOptions, OptionsStore, SetupStore, StoreDefinition, StoreSetupOptions } from "./types.mjs";
|
|
2
|
-
//#region src/store/define.d.ts
|
|
3
2
|
/** 定义 Setup Store,返回值在实例上自动解包 ref。 */
|
|
4
3
|
export declare function defineStore<Id extends string, T extends Record<string, any>>(id: Id, setup: () => T, options?: StoreSetupOptions): StoreDefinition<Id, SetupStore<Id, T>>;
|
|
5
4
|
/** 定义 Options Store,共享 state/getters/actions 的 this 类型。 */
|
|
6
|
-
export declare function defineStore<Id extends string, S extends Record<string, any> = Record<never, never>, G extends Record<string, any> = Record<never, never>, A extends Record<string, any> = Record<never, never>>(id: Id, options: DefineStoreOptions<S, G, A>): StoreDefinition<Id, OptionsStore<S, G, A, Id>>;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare function defineStore<Id extends string, S extends Record<string, any> = Record<never, never>, G extends Record<string, any> = Record<never, never>, A extends Record<string, any> = Record<never, never>>(id: Id, options: DefineStoreOptions<S, G, A>): StoreDefinition<Id, OptionsStore<S, G, A, Id>>;
|
package/dist/store/manager.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Pinia } from "./types.mjs";
|
|
2
|
-
//#region src/store/manager.d.ts
|
|
3
2
|
/** 设置组件外使用的活动 Store 管理器。 */
|
|
4
3
|
export declare function setActivePinia(pinia: Pinia): Pinia;
|
|
5
4
|
export declare function setActivePinia(pinia: undefined): undefined;
|
|
@@ -11,5 +10,4 @@ export declare function createPinia(): Pinia;
|
|
|
11
10
|
/** 保留原有创建名称,与推荐的 createPinia 是同一个函数。 */
|
|
12
11
|
export declare const createStore: typeof createPinia;
|
|
13
12
|
/** 释放整个管理器;与单个 Store 的 $dispose 不同,此操作也清除状态。 */
|
|
14
|
-
export declare function disposePinia(pinia: Pinia): void;
|
|
15
|
-
//#endregion
|
|
13
|
+
export declare function disposePinia(pinia: Pinia): void;
|
|
@@ -2,10 +2,8 @@ import { Ref } from "../reactivity/ref.mjs";
|
|
|
2
2
|
import { ComputedRef } from "../reactivity/computed.mjs";
|
|
3
3
|
import "../reactivity/index.mjs";
|
|
4
4
|
import { StoreApi } from "./types.mjs";
|
|
5
|
-
//#region src/store/storeToRefs.d.ts
|
|
6
5
|
type IfEquals<X, Y, Yes, No> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? Yes : No;
|
|
7
6
|
/** 仅提取状态与 getter,保留 getter 的只读类型。 */
|
|
8
7
|
export type StoreToRefsResult<T extends Record<string, any>> = { [K in keyof T as K extends keyof StoreApi<any, any, any, any> ? never : T[K] extends ((...args: any[]) => any) ? never : K]: IfEquals<{ [P in K]: T[P]; }, { -readonly [P in K]: T[P]; }, Ref<T[K]>, ComputedRef<T[K]>>; };
|
|
9
8
|
export declare function storeToRefs<T extends Record<string, any>>(store: T): StoreToRefsResult<T>;
|
|
10
|
-
//#endregion
|
|
11
9
|
export {};
|
package/dist/store/types.d.mts
CHANGED
|
@@ -4,7 +4,6 @@ import { EffectScope } from "../reactivity/core.mjs";
|
|
|
4
4
|
import { WatchOptions } from "../reactivity/watch/types.mjs";
|
|
5
5
|
import "../reactivity/index.mjs";
|
|
6
6
|
import { UnwrapRef } from "vue";
|
|
7
|
-
//#region src/store/types.d.ts
|
|
8
7
|
/** 与 Pinia 一致的变更类型和值。 */
|
|
9
8
|
export declare const MutationType: {
|
|
10
9
|
readonly direct: "direct";
|
|
@@ -102,5 +101,4 @@ export type SetupStore<Id extends string, T extends Record<string, any>> = Setup
|
|
|
102
101
|
export type StoreGeneric = Record<string, any> & StoreApi<string, any, any, any>;
|
|
103
102
|
export type StoreState<T extends StoreGeneric> = T['$state'];
|
|
104
103
|
export type StoreActions<T extends StoreGeneric> = SetupActions<Omit<T, keyof StoreApi<any, any, any, any>>>;
|
|
105
|
-
//#endregion
|
|
106
104
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JSX as JSX$1, WevuJsxChild, WevuJsxElement, WevuJsxEventHandler, WevuJsxGlobalComponents, WevuJsxGlobalComponents as WevuJsxGlobalComponents$1, WevuJsxHostAttributes } from "wevu/jsx-runtime";
|
|
2
2
|
import { TtIntrinsicElementBaseAttributes, TtIntrinsicElements, TtIntrinsicElements as TtIntrinsicElements$1 } from "@weapp-core/types/tt";
|
|
3
|
-
//#region src/tt/jsx-runtime.d.ts
|
|
4
3
|
export declare namespace JSX {
|
|
5
4
|
type Element = JSX$1.Element;
|
|
6
5
|
interface ElementClass extends JSX$1.ElementClass {}
|
|
@@ -8,5 +7,4 @@ export declare namespace JSX {
|
|
|
8
7
|
interface IntrinsicAttributes extends JSX$1.IntrinsicAttributes {}
|
|
9
8
|
interface IntrinsicElements extends WevuJsxGlobalComponents$1, TtIntrinsicElements$1 {}
|
|
10
9
|
}
|
|
11
|
-
//#endregion
|
|
12
10
|
export type { TtIntrinsicElementBaseAttributes, TtIntrinsicElements, WevuJsxChild, WevuJsxElement, WevuJsxEventHandler, WevuJsxGlobalComponents, WevuJsxHostAttributes };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ComputedGetter, WritableComputedOptions } from "./reactivity.mjs";
|
|
2
|
-
//#region src/types/definitions.d.ts
|
|
3
2
|
export type ComputedDefinitions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
|
4
3
|
export type MethodDefinitions = Record<string, (...args: any[]) => any>;
|
|
5
4
|
export type ExtractComputed<C extends ComputedDefinitions> = { [K in keyof C]: C[K] extends ComputedGetter<infer R> ? R : C[K] extends WritableComputedOptions<infer R> ? R : never; };
|
|
6
|
-
export type ExtractMethods<M extends MethodDefinitions> = { [K in keyof M]: M[K] extends ((...args: infer P) => infer R) ? (...args: P) => R : never; };
|
|
7
|
-
//#endregion
|
|
5
|
+
export type ExtractMethods<M extends MethodDefinitions> = { [K in keyof M]: M[K] extends ((...args: infer P) => infer R) ? (...args: P) => R : never; };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types/pageMeta.d.ts
|
|
2
1
|
export type PageLayoutMeta = string | false | {
|
|
3
2
|
name: string;
|
|
4
3
|
props?: Record<string, unknown>;
|
|
@@ -6,5 +5,4 @@ export type PageLayoutMeta = string | false | {
|
|
|
6
5
|
export interface PageMeta {
|
|
7
6
|
layout?: PageLayoutMeta;
|
|
8
7
|
[key: string]: unknown;
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
8
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Ref, ShallowRef } from "@vue/reactivity";
|
|
2
|
-
//#region src/types/reactivity.d.ts
|
|
3
2
|
/** 保持 Vue Ref 的品牌和读写泛型,不加载模板或宿主声明。 */
|
|
4
3
|
type Ref$1<T = any, S = T> = Ref<T, S>;
|
|
5
4
|
type ShallowRef$1<T = any, S = T> = ShallowRef<T, S>;
|
|
@@ -9,5 +8,4 @@ export interface WritableComputedOptions<T> {
|
|
|
9
8
|
get: ComputedGetter<T>;
|
|
10
9
|
set: ComputedSetter<T>;
|
|
11
10
|
}
|
|
12
|
-
//#endregion
|
|
13
11
|
export { Ref$1 as Ref, ShallowRef$1 as ShallowRef };
|
package/dist/version.d.mts
CHANGED