wevu 7.1.4 → 7.2.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/README.md +20 -6
- package/dist/dev/index.mjs +3 -2
- package/dist/dev/package.mjs +1 -1
- package/dist/dev/reactivity/computed.mjs +10 -1
- package/dist/dev/reactivity/computed.mjs.map +1 -1
- package/dist/dev/reactivity/reactive.mjs +27 -20
- package/dist/dev/reactivity/reactive.mjs.map +1 -1
- package/dist/dev/router/auto-routes.mjs +11 -0
- package/dist/dev/router/auto-routes.mjs.map +1 -0
- package/dist/dev/router/createRouter.mjs +3 -4
- package/dist/dev/router/createRouter.mjs.map +1 -1
- package/dist/dev/router/navigationCore.mjs +7 -7
- package/dist/dev/router/navigationCore.mjs.map +1 -1
- package/dist/dev/router/resolve.mjs.map +1 -1
- package/dist/dev/router/types.mjs.map +1 -1
- package/dist/dev/router/useRoute.mjs.map +1 -1
- package/dist/dev/router/useRouter.mjs.map +1 -1
- package/dist/dev/routerInternal/matching.mjs +1 -1
- package/dist/dev/routerInternal/matching.mjs.map +1 -1
- package/dist/dev/routerInternal/params.mjs.map +1 -1
- package/dist/dev/runtime/hooks/base.mjs +5 -5
- package/dist/dev/runtime/hooks/base.mjs.map +1 -1
- package/dist/dev/runtime/platform.mjs +31 -24
- package/dist/dev/runtime/platform.mjs.map +1 -1
- package/dist/dev/runtime/register/component/alipay.mjs +72 -0
- package/dist/dev/runtime/register/component/alipay.mjs.map +1 -0
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +5 -2
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs.map +1 -1
- package/dist/dev/store/actions.mjs +27 -29
- package/dist/dev/store/actions.mjs.map +1 -1
- package/dist/dev/store/base.mjs +152 -36
- package/dist/dev/store/base.mjs.map +1 -1
- package/dist/dev/store/define/create.mjs +92 -0
- package/dist/dev/store/define/create.mjs.map +1 -0
- package/dist/dev/store/define.mjs +11 -15
- package/dist/dev/store/define.mjs.map +1 -1
- package/dist/dev/store/manager.mjs +55 -14
- package/dist/dev/store/manager.mjs.map +1 -1
- package/dist/dev/store/storeToRefs.mjs +10 -18
- package/dist/dev/store/storeToRefs.mjs.map +1 -1
- package/dist/dev/store/subscriptions.mjs +17 -0
- package/dist/dev/store/subscriptions.mjs.map +1 -0
- package/dist/dev/store/types.mjs +11 -0
- package/dist/dev/store/types.mjs.map +1 -0
- package/dist/dev/store/utils.mjs +1 -37
- package/dist/dev/store/utils.mjs.map +1 -1
- package/dist/dev/store/view.mjs +56 -0
- package/dist/dev/store/view.mjs.map +1 -0
- package/dist/dev/store.mjs +3 -2
- package/dist/dev/vue-demi.mjs +3 -2
- package/dist/dev/vue-demi.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/reactivity/computed.d.mts +4 -0
- package/dist/reactivity/computed.mjs +1 -1
- package/dist/reactivity/reactive.mjs +1 -1
- package/dist/router/auto-routes.d.mts +7 -0
- package/dist/router/auto-routes.mjs +1 -0
- package/dist/router/createRouter.d.mts +2 -1
- package/dist/router/createRouter.mjs +1 -1
- package/dist/router/navigationCore.d.mts +3 -2
- package/dist/router/navigationCore.mjs +1 -1
- package/dist/router/resolve.d.mts +3 -2
- package/dist/router/routeSync.d.mts +1 -0
- package/dist/router/types.d.mts +173 -78
- package/dist/router/useRoute.d.mts +4 -3
- package/dist/router/useRouter.d.mts +2 -1
- package/dist/router.d.mts +18 -3
- package/dist/routerInternal/location.d.mts +2 -0
- package/dist/routerInternal/matching.d.mts +2 -0
- package/dist/routerInternal/matching.mjs +1 -1
- package/dist/routerInternal/params.d.mts +2 -0
- package/dist/routerInternal/records.d.mts +2 -0
- package/dist/routerInternal/recordsWarnings.d.mts +2 -0
- package/dist/routerInternal/shared.d.mts +9 -0
- package/dist/routerInternal/snapshots.d.mts +2 -0
- package/dist/runtime/hooks/base.mjs +1 -1
- package/dist/runtime/platform.mjs +1 -1
- package/dist/runtime/register/component/alipay.mjs +1 -0
- package/dist/runtime/register/component/registerNativeDefinition.mjs +1 -1
- package/dist/store/actions.mjs +1 -1
- package/dist/store/base.mjs +1 -1
- package/dist/store/define/create.mjs +1 -0
- package/dist/store/define.d.mts +5 -16
- package/dist/store/define.mjs +1 -1
- package/dist/store/manager.d.mts +13 -5
- package/dist/store/manager.mjs +1 -1
- package/dist/store/storeToRefs.d.mts +5 -7
- package/dist/store/storeToRefs.mjs +1 -1
- package/dist/store/subscriptions.mjs +1 -0
- package/dist/store/types.d.mts +85 -59
- package/dist/store/types.mjs +1 -0
- package/dist/store/utils.mjs +1 -1
- package/dist/store/view.mjs +1 -0
- package/dist/store.d.mts +3 -3
- package/dist/store.mjs +1 -1
- package/dist/vue-demi.d.mts +3 -3
- package/dist/vue-demi.mjs +1 -1
- package/package.json +29 -9
- package/dist/dev/api/vitest/setup.d.mts +0 -1
- package/dist/dev/api/vitest.d.mts +0 -1
- package/dist/dev/api.d.mts +0 -1
- package/dist/dev/compiler.d.mts +0 -1
- package/dist/dev/fetch.d.mts +0 -9
- package/dist/dev/index.d.mts +0 -72
- package/dist/dev/internal-reactivity.d.mts +0 -18
- package/dist/dev/internal-runtime.d.mts +0 -44
- package/dist/dev/internal-template.d.mts +0 -2
- package/dist/dev/jsxTypes.d.mts +0 -9
- package/dist/dev/macros/shared.d.mts +0 -83
- package/dist/dev/macros.d.mts +0 -71
- package/dist/dev/reactivity/asyncDerivation.d.mts +0 -41
- package/dist/dev/reactivity/computed.d.mts +0 -21
- package/dist/dev/reactivity/core.d.mts +0 -35
- package/dist/dev/reactivity/index.d.mts +0 -16
- package/dist/dev/reactivity/reactive/mutation.d.mts +0 -21
- package/dist/dev/reactivity/reactive/patch.d.mts +0 -18
- package/dist/dev/reactivity/reactive/shallow.d.mts +0 -22
- package/dist/dev/reactivity/reactive/shared.d.mts +0 -4
- package/dist/dev/reactivity/reactive.d.mts +0 -42
- package/dist/dev/reactivity/readonly.d.mts +0 -27
- package/dist/dev/reactivity/ref.d.mts +0 -27
- package/dist/dev/reactivity/shallowRef.d.mts +0 -19
- package/dist/dev/reactivity/toRefs.d.mts +0 -43
- package/dist/dev/reactivity/traverse.d.mts +0 -8
- package/dist/dev/reactivity/watch/types.d.mts +0 -43
- package/dist/dev/reactivity/watch.d.mts +0 -22
- package/dist/dev/router/createRouter.d.mts +0 -8
- package/dist/dev/router/navigationCore.d.mts +0 -6
- package/dist/dev/router/resolve.d.mts +0 -6
- package/dist/dev/router/routeSync.d.mts +0 -1
- package/dist/dev/router/types.d.mts +0 -172
- package/dist/dev/router/useRoute.d.mts +0 -19
- package/dist/dev/router/useRouter.d.mts +0 -8
- package/dist/dev/router.d.mts +0 -10
- package/dist/dev/routerInternal/query.d.mts +0 -7
- package/dist/dev/routerInternal/types.d.mts +0 -9
- package/dist/dev/runtime/app/pending.d.mts +0 -10
- package/dist/dev/runtime/app/setData/commitTracker.d.mts +0 -13
- package/dist/dev/runtime/app/setData/scheduler.d.mts +0 -51
- package/dist/dev/runtime/app.d.mts +0 -8
- package/dist/dev/runtime/capabilities.d.mts +0 -75
- package/dist/dev/runtime/css.d.mts +0 -14
- package/dist/dev/runtime/defaults.d.mts +0 -12
- package/dist/dev/runtime/define.d.mts +0 -118
- package/dist/dev/runtime/disposables.d.mts +0 -31
- package/dist/dev/runtime/elementIntersectionObserver.d.mts +0 -26
- package/dist/dev/runtime/features/inlineEvents.d.mts +0 -7
- package/dist/dev/runtime/features/layout.d.mts +0 -7
- package/dist/dev/runtime/features/patchStrategy.d.mts +0 -7
- package/dist/dev/runtime/features/publicLayout.d.mts +0 -24
- package/dist/dev/runtime/features/scopedSlots.d.mts +0 -23
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.d.mts +0 -7
- package/dist/dev/runtime/features/templateRefs.d.mts +0 -7
- package/dist/dev/runtime/hooks/base.d.mts +0 -27
- package/dist/dev/runtime/hooks/register.d.mts +0 -30
- package/dist/dev/runtime/hooks/vue.d.mts +0 -52
- package/dist/dev/runtime/hooks.d.mts +0 -4
- package/dist/dev/runtime/index.d.mts +0 -46
- package/dist/dev/runtime/intersectionObserver.d.mts +0 -14
- package/dist/dev/runtime/jsxIsland.d.mts +0 -37
- package/dist/dev/runtime/layoutBridge.d.mts +0 -55
- package/dist/dev/runtime/noSetData.d.mts +0 -5
- package/dist/dev/runtime/pageEnvironment.d.mts +0 -50
- package/dist/dev/runtime/pageLayout.d.mts +0 -25
- package/dist/dev/runtime/pageScroll.d.mts +0 -29
- package/dist/dev/runtime/provide.d.mts +0 -60
- package/dist/dev/runtime/provideStore.d.mts +0 -7
- package/dist/dev/runtime/publicRuntime.d.mts +0 -22
- package/dist/dev/runtime/pullDownRefresh.d.mts +0 -12
- package/dist/dev/runtime/register/app.d.mts +0 -14
- package/dist/dev/runtime/register/component.d.mts +0 -17
- package/dist/dev/runtime/register/inline.d.mts +0 -15
- package/dist/dev/runtime/register/runtimeInstance.d.mts +0 -26
- package/dist/dev/runtime/register/setup.d.mts +0 -11
- package/dist/dev/runtime/register/watch.d.mts +0 -12
- package/dist/dev/runtime/register.d.mts +0 -5
- package/dist/dev/runtime/selectorQuery.d.mts +0 -54
- package/dist/dev/runtime/template.d.mts +0 -6
- package/dist/dev/runtime/templateRefTypes.d.mts +0 -12
- package/dist/dev/runtime/types/core.d.mts +0 -35
- package/dist/dev/runtime/types/miniprogram.d.mts +0 -84
- package/dist/dev/runtime/types/miniprogramHost.d.mts +0 -45
- package/dist/dev/runtime/types/miniprogramHostSources.d.mts +0 -112
- package/dist/dev/runtime/types/options.d.mts +0 -138
- package/dist/dev/runtime/types/props/propTypes.d.mts +0 -79
- package/dist/dev/runtime/types/props/router.d.mts +0 -51
- package/dist/dev/runtime/types/props/setup.d.mts +0 -96
- package/dist/dev/runtime/types/props.d.mts +0 -4
- package/dist/dev/runtime/types/runtime.d.mts +0 -59
- package/dist/dev/runtime/types/setData.d.mts +0 -237
- package/dist/dev/runtime/types.d.mts +0 -29
- package/dist/dev/runtime/uniAppHost.d.mts +0 -8
- package/dist/dev/runtime/updatePerformance.d.mts +0 -13
- package/dist/dev/runtime/use.d.mts +0 -13
- package/dist/dev/runtime/vueCompat/context.d.mts +0 -8
- package/dist/dev/runtime/vueCompat/model.d.mts +0 -30
- package/dist/dev/runtime/vueCompat/router.d.mts +0 -29
- package/dist/dev/runtime/vueCompat/templateRef.d.mts +0 -9
- package/dist/dev/runtime/vueCompat.d.mts +0 -5
- package/dist/dev/scheduler.d.mts +0 -4
- package/dist/dev/store/define/optionsStyle.mjs +0 -117
- package/dist/dev/store/define/optionsStyle.mjs.map +0 -1
- package/dist/dev/store/define/setupStyle.mjs +0 -137
- package/dist/dev/store/define/setupStyle.mjs.map +0 -1
- package/dist/dev/store/define/shared.mjs +0 -81
- package/dist/dev/store/define/shared.mjs.map +0 -1
- package/dist/dev/store/define.d.mts +0 -19
- package/dist/dev/store/manager.d.mts +0 -8
- package/dist/dev/store/storeToRefs.d.mts +0 -13
- package/dist/dev/store/types.d.mts +0 -80
- package/dist/dev/store.d.mts +0 -5
- package/dist/dev/version.d.mts +0 -4
- package/dist/dev/vue-augment.d.mts +0 -8
- package/dist/dev/vue-demi.d.mts +0 -87
- package/dist/dev/vue-types.d.mts +0 -19
- package/dist/dev/web-apis.d.mts +0 -3
- package/dist/store/define/optionsStyle.mjs +0 -1
- package/dist/store/define/setupStyle.mjs +0 -1
- package/dist/store/define/shared.mjs +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { DeepWatchStrategy, MapSources, MaybeUndefined, MultiWatchSources, OnCleanup, WatchCallback, WatchEffect, WatchEffectOptions, WatchMultiSources, WatchOptions, WatchScheduler, WatchSource, WatchSourceValue, WatchSources, WatchStopHandle, getDeepWatchStrategy, setDeepWatchStrategy } from "./watch/types.mjs";
|
|
2
|
-
//#region src/reactivity/watch.d.ts
|
|
3
|
-
export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
4
|
-
export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T extends ReadonlyArray<any> ? never : T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
5
|
-
export declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(source: readonly [...T] | T, cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
6
|
-
export declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(source: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
7
|
-
/**
|
|
8
|
-
* watchEffect 注册一个响应式副作用,可选清理函数。
|
|
9
|
-
* 副作用会立即执行,并在依赖变化时重新运行。
|
|
10
|
-
*/
|
|
11
|
-
export declare function watchEffect(effectFn: WatchEffect, options?: WatchEffectOptions): WatchStopHandle;
|
|
12
|
-
/**
|
|
13
|
-
* 以后置刷新的方式运行副作用,与 Vue 的 `watchPostEffect()` 兼容。
|
|
14
|
-
*/
|
|
15
|
-
export declare function watchPostEffect(effectFn: WatchEffect, options?: Omit<WatchEffectOptions, 'flush'>): WatchStopHandle;
|
|
16
|
-
/**
|
|
17
|
-
* 以同步刷新的方式运行副作用,与 Vue 的 `watchSyncEffect()` 兼容。
|
|
18
|
-
*/
|
|
19
|
-
export declare function watchSyncEffect(effectFn: WatchEffect, options?: Omit<WatchEffectOptions, 'flush'>): WatchStopHandle;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { type MapSources, type MaybeUndefined, type MultiWatchSources, type OnCleanup, type WatchCallback, type WatchEffect, type WatchEffectOptions, type WatchMultiSources, type WatchOptions, type WatchScheduler, type WatchSource, type WatchSourceValue, type WatchSources, type WatchStopHandle, getDeepWatchStrategy, setDeepWatchStrategy };
|
|
22
|
-
//# sourceMappingURL=watch.d.mts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { RouterNavigation, UseRouterOptions } from "./types.mjs";
|
|
2
|
-
//#region src/router/createRouter.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* @description 创建高阶路由导航器(对齐 Vue Router 的 createRouter 心智)
|
|
5
|
-
*/
|
|
6
|
-
export declare function createRouter(options?: UseRouterOptions): RouterNavigation;
|
|
7
|
-
//#endregion
|
|
8
|
-
//# sourceMappingURL=createRouter.d.mts.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { NavigationFailure, NavigationFailureTypeValue, RouteLocationNormalizedLoaded } from "./types.mjs";
|
|
2
|
-
//#region src/router/navigationCore.d.ts
|
|
3
|
-
export declare function createNavigationFailure(type: NavigationFailureTypeValue, to?: RouteLocationNormalizedLoaded, from?: RouteLocationNormalizedLoaded, cause?: unknown): NavigationFailure;
|
|
4
|
-
export declare function isNavigationFailure(error: unknown, type?: NavigationFailureTypeValue): error is NavigationFailure;
|
|
5
|
-
//#endregion
|
|
6
|
-
//# sourceMappingURL=navigationCore.d.mts.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RouteResolveCodec } from "../routerInternal/types.mjs";
|
|
2
|
-
import { RouteLocationNormalizedLoaded, RouteLocationRaw } from "./types.mjs";
|
|
3
|
-
//#region src/router/resolve.d.ts
|
|
4
|
-
export declare function resolveRouteLocation(to: RouteLocationRaw, currentPath?: string, codec?: RouteResolveCodec): RouteLocationNormalizedLoaded;
|
|
5
|
-
//#endregion
|
|
6
|
-
//# sourceMappingURL=resolve.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./types.mjs";
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { SetupContextRouter, TypedRouterTabBarUrl } from "../runtime/types/props/router.mjs";
|
|
2
|
-
import "../runtime/types/props.mjs";
|
|
3
|
-
//#region src/router/types.d.ts
|
|
4
|
-
export type LocationQueryValue = string | null;
|
|
5
|
-
export type LocationQueryValueRaw = LocationQueryValue | number | boolean | undefined;
|
|
6
|
-
export type LocationQuery = Record<string, LocationQueryValue | LocationQueryValue[]>;
|
|
7
|
-
export type LocationQueryRaw = Record<string, LocationQueryValueRaw | LocationQueryValueRaw[]>;
|
|
8
|
-
export type RouteParamValue = string;
|
|
9
|
-
export type RouteParamValueRaw = RouteParamValue | number | boolean | null | undefined;
|
|
10
|
-
export type RouteParams = Record<string, RouteParamValue | RouteParamValue[]>;
|
|
11
|
-
export type RouteParamsRaw = Record<string, RouteParamValueRaw | RouteParamValueRaw[]>;
|
|
12
|
-
export type RouteParamsMode = 'loose' | 'strict';
|
|
13
|
-
export type RouteQueryParser = (search: string) => LocationQueryRaw | LocationQuery;
|
|
14
|
-
export type RouteQueryStringifier = (query: LocationQueryRaw | LocationQuery) => string;
|
|
15
|
-
export type RouteMeta = Record<string, unknown>;
|
|
16
|
-
export interface NamedRouteRecord {
|
|
17
|
-
name: string;
|
|
18
|
-
path: string;
|
|
19
|
-
}
|
|
20
|
-
export interface RouteRecordInput {
|
|
21
|
-
name?: string;
|
|
22
|
-
path: string;
|
|
23
|
-
meta?: RouteMeta;
|
|
24
|
-
alias?: string | readonly string[];
|
|
25
|
-
children?: readonly RouteRecordInput[];
|
|
26
|
-
beforeEnter?: NavigationGuard | readonly NavigationGuard[];
|
|
27
|
-
redirect?: RouteRecordRedirect;
|
|
28
|
-
}
|
|
29
|
-
export type NamedRoutes = Readonly<Record<string, string>> | readonly RouteRecordRaw[];
|
|
30
|
-
export type RouteLocationRaw = string | {
|
|
31
|
-
path?: string;
|
|
32
|
-
fullPath?: string;
|
|
33
|
-
query?: LocationQueryRaw;
|
|
34
|
-
hash?: string;
|
|
35
|
-
name?: string;
|
|
36
|
-
params?: RouteParamsRaw;
|
|
37
|
-
};
|
|
38
|
-
export interface RouteLocationNormalizedLoaded {
|
|
39
|
-
path: string;
|
|
40
|
-
fullPath: string;
|
|
41
|
-
query: LocationQuery;
|
|
42
|
-
hash: string;
|
|
43
|
-
name?: string;
|
|
44
|
-
meta?: RouteMeta;
|
|
45
|
-
href?: string;
|
|
46
|
-
matched?: readonly RouteRecordMatched[];
|
|
47
|
-
redirectedFrom?: RouteLocationRedirectedFrom;
|
|
48
|
-
params: RouteParams;
|
|
49
|
-
}
|
|
50
|
-
export declare const NavigationFailureType: {
|
|
51
|
-
readonly unknown: 1;
|
|
52
|
-
readonly aborted: 4;
|
|
53
|
-
readonly cancelled: 8;
|
|
54
|
-
readonly duplicated: 16;
|
|
55
|
-
};
|
|
56
|
-
export type NavigationFailureTypeValue = (typeof NavigationFailureType)[keyof typeof NavigationFailureType];
|
|
57
|
-
export interface NavigationFailure extends Error {
|
|
58
|
-
readonly __wevuNavigationFailure: true;
|
|
59
|
-
readonly type: NavigationFailureTypeValue;
|
|
60
|
-
readonly to?: RouteLocationNormalizedLoaded;
|
|
61
|
-
readonly from?: RouteLocationNormalizedLoaded;
|
|
62
|
-
readonly cause?: unknown;
|
|
63
|
-
}
|
|
64
|
-
export type NavigationMode = 'push' | 'replace' | 'back';
|
|
65
|
-
export type InitialNavigationMode = 'eager' | 'blocking';
|
|
66
|
-
export interface NavigationRedirect {
|
|
67
|
-
to: RouteLocationRaw;
|
|
68
|
-
replace?: boolean;
|
|
69
|
-
}
|
|
70
|
-
export type RouteRecordRedirect = RouteLocationRaw | NavigationRedirect | ((to: RouteLocationNormalizedLoaded, from: RouteLocationNormalizedLoaded) => RouteLocationRaw | NavigationRedirect | Promise<RouteLocationRaw | NavigationRedirect>);
|
|
71
|
-
export interface RouteRecordRaw extends Omit<RouteRecordInput, 'name' | 'children'>, NamedRouteRecord {
|
|
72
|
-
children?: readonly RouteRecordRaw[];
|
|
73
|
-
}
|
|
74
|
-
export interface RouteRecordMatched {
|
|
75
|
-
name: string;
|
|
76
|
-
path: string;
|
|
77
|
-
aliasPath?: string;
|
|
78
|
-
meta?: RouteMeta;
|
|
79
|
-
}
|
|
80
|
-
export interface RouteLocationRedirectedFrom {
|
|
81
|
-
path: string;
|
|
82
|
-
fullPath: string;
|
|
83
|
-
query: LocationQuery;
|
|
84
|
-
hash: string;
|
|
85
|
-
name?: string;
|
|
86
|
-
meta?: RouteMeta;
|
|
87
|
-
href?: string;
|
|
88
|
-
matched?: readonly RouteRecordMatched[];
|
|
89
|
-
params: RouteParams;
|
|
90
|
-
}
|
|
91
|
-
export type NavigationGuardResult = void | boolean | NavigationFailure | RouteLocationRaw | NavigationRedirect;
|
|
92
|
-
export type NavigationGuard = (to: RouteLocationNormalizedLoaded | undefined, from: RouteLocationNormalizedLoaded, context?: NavigationGuardContext) => NavigationGuardResult | Promise<NavigationGuardResult>;
|
|
93
|
-
export type NavigationAfterEach = (to: RouteLocationNormalizedLoaded | undefined, from: RouteLocationNormalizedLoaded, failure?: NavigationFailure, context?: NavigationAfterEachContext) => void | Promise<void>;
|
|
94
|
-
export interface NavigationGuardContext {
|
|
95
|
-
readonly mode: NavigationMode;
|
|
96
|
-
readonly to?: RouteLocationNormalizedLoaded;
|
|
97
|
-
readonly from: RouteLocationNormalizedLoaded;
|
|
98
|
-
readonly nativeRouter: SetupContextRouter;
|
|
99
|
-
}
|
|
100
|
-
export interface NavigationAfterEachContext {
|
|
101
|
-
readonly mode: NavigationMode;
|
|
102
|
-
readonly to?: RouteLocationNormalizedLoaded;
|
|
103
|
-
readonly from: RouteLocationNormalizedLoaded;
|
|
104
|
-
readonly nativeRouter: SetupContextRouter;
|
|
105
|
-
readonly failure?: NavigationFailure;
|
|
106
|
-
}
|
|
107
|
-
export interface NavigationErrorContext {
|
|
108
|
-
readonly mode: NavigationMode;
|
|
109
|
-
readonly to?: RouteLocationNormalizedLoaded;
|
|
110
|
-
readonly from: RouteLocationNormalizedLoaded;
|
|
111
|
-
readonly nativeRouter: SetupContextRouter;
|
|
112
|
-
readonly failure: NavigationFailure;
|
|
113
|
-
}
|
|
114
|
-
export type NavigationErrorHandler = (error: unknown, context: NavigationErrorContext) => void | Promise<void>;
|
|
115
|
-
export interface UseRouterOptions {
|
|
116
|
-
tabBarEntries?: readonly (TypedRouterTabBarUrl | string)[];
|
|
117
|
-
/**
|
|
118
|
-
* Vue Router 对齐入口:推荐使用 `routes`
|
|
119
|
-
*/
|
|
120
|
-
routes?: readonly RouteRecordInput[];
|
|
121
|
-
/**
|
|
122
|
-
* 兼容入口:支持对象 map 或路由记录数组
|
|
123
|
-
*/
|
|
124
|
-
namedRoutes?: NamedRoutes;
|
|
125
|
-
paramsMode?: RouteParamsMode;
|
|
126
|
-
maxRedirects?: number;
|
|
127
|
-
/**
|
|
128
|
-
* 首屏导航守卫模式。默认立即挂载页面,只有明确配置 `blocking` 时才等待守卫完成。
|
|
129
|
-
*/
|
|
130
|
-
initialNavigationMode?: InitialNavigationMode;
|
|
131
|
-
/**
|
|
132
|
-
* blocking 首屏导航守卫的最大等待时间(毫秒),超时后放行页面挂载。
|
|
133
|
-
*/
|
|
134
|
-
initialNavigationTimeout?: number;
|
|
135
|
-
parseQuery?: RouteQueryParser;
|
|
136
|
-
stringifyQuery?: RouteQueryStringifier;
|
|
137
|
-
/**
|
|
138
|
-
* 异常型导航失败时是否以 Promise reject 抛出失败对象。
|
|
139
|
-
*
|
|
140
|
-
* - `true`:更贴近 Vue Router 心智(默认)
|
|
141
|
-
* - `false`:始终以返回值形式携带失败对象
|
|
142
|
-
*/
|
|
143
|
-
rejectOnError?: boolean;
|
|
144
|
-
}
|
|
145
|
-
export interface RouterNavigation {
|
|
146
|
-
readonly nativeRouter: SetupContextRouter;
|
|
147
|
-
readonly options: Readonly<UseRouterOptions>;
|
|
148
|
-
readonly currentRoute: Readonly<RouteLocationNormalizedLoaded>;
|
|
149
|
-
install: (app?: unknown) => void;
|
|
150
|
-
resolve: (to: RouteLocationRaw) => RouteLocationNormalizedLoaded;
|
|
151
|
-
isReady: () => Promise<void>;
|
|
152
|
-
push: (to: RouteLocationRaw) => Promise<void | NavigationFailure>;
|
|
153
|
-
replace: (to: RouteLocationRaw) => Promise<void | NavigationFailure>;
|
|
154
|
-
back: (delta?: number) => Promise<void | NavigationFailure>;
|
|
155
|
-
go: (delta: number) => Promise<void | NavigationFailure>;
|
|
156
|
-
forward: () => Promise<void | NavigationFailure>;
|
|
157
|
-
hasRoute: (name: string) => boolean;
|
|
158
|
-
getRoutes: () => readonly RouteRecordRaw[];
|
|
159
|
-
addRoute: AddRoute;
|
|
160
|
-
removeRoute: (name: string) => void;
|
|
161
|
-
clearRoutes: () => void;
|
|
162
|
-
beforeEach: (guard: NavigationGuard) => () => void;
|
|
163
|
-
beforeResolve: (guard: NavigationGuard) => () => void;
|
|
164
|
-
afterEach: (hook: NavigationAfterEach) => () => void;
|
|
165
|
-
onError: (handler: NavigationErrorHandler) => () => void;
|
|
166
|
-
}
|
|
167
|
-
export interface AddRoute {
|
|
168
|
-
(route: RouteRecordRaw): () => void;
|
|
169
|
-
(parentName: string, route: RouteRecordRaw): () => void;
|
|
170
|
-
}
|
|
171
|
-
//#endregion
|
|
172
|
-
//# sourceMappingURL=types.d.mts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SetupContextRouter } from "../runtime/types/props/router.mjs";
|
|
2
|
-
import "../runtime/types/props.mjs";
|
|
3
|
-
import { RouteLocationNormalizedLoaded } from "./types.mjs";
|
|
4
|
-
import "./routeSync.mjs";
|
|
5
|
-
//#region src/router/useRoute.d.ts
|
|
6
|
-
export interface UseRouteOptions {
|
|
7
|
-
resolveRoute?: (route: RouteLocationNormalizedLoaded) => RouteLocationNormalizedLoaded;
|
|
8
|
-
}
|
|
9
|
-
export declare function useRoute(options?: UseRouteOptions): Readonly<RouteLocationNormalizedLoaded>;
|
|
10
|
-
/**
|
|
11
|
-
* @description 获取当前组件路径语义的原生 Router
|
|
12
|
-
*/
|
|
13
|
-
export declare function useNativeRouter(): SetupContextRouter;
|
|
14
|
-
/**
|
|
15
|
-
* @description 获取当前页面路径语义的原生 Page Router
|
|
16
|
-
*/
|
|
17
|
-
export declare function useNativePageRouter(): SetupContextRouter;
|
|
18
|
-
//#endregion
|
|
19
|
-
//# sourceMappingURL=useRoute.d.mts.map
|
package/dist/dev/router.d.mts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RouterNavigateToOption, RouterReLaunchOption, RouterRedirectToOption, RouterSwitchTabOption, SetupContextRouter, TypedRouterTabBarUrl, TypedRouterUrl, WevuTypedRouterRouteMap } from "./runtime/types/props/router.mjs";
|
|
2
|
-
import "./runtime/types/props.mjs";
|
|
3
|
-
import { parseQuery, stringifyQuery } from "./routerInternal/query.mjs";
|
|
4
|
-
import { AddRoute, InitialNavigationMode, LocationQuery, LocationQueryRaw, LocationQueryValue, LocationQueryValueRaw, NamedRouteRecord, NamedRoutes, NavigationAfterEach, NavigationAfterEachContext, NavigationErrorContext, NavigationErrorHandler, NavigationFailure, NavigationFailureType, NavigationFailureTypeValue, NavigationGuard, NavigationGuardContext, NavigationGuardResult, NavigationMode, NavigationRedirect, RouteLocationNormalizedLoaded, RouteLocationRaw, RouteLocationRedirectedFrom, RouteMeta, RouteParamValue, RouteParamValueRaw, RouteParams, RouteParamsMode, RouteParamsRaw, RouteQueryParser, RouteQueryStringifier, RouteRecordInput, RouteRecordMatched, RouteRecordRaw, RouteRecordRedirect, RouterNavigation, UseRouterOptions } from "./router/types.mjs";
|
|
5
|
-
import { createRouter } from "./router/createRouter.mjs";
|
|
6
|
-
import { createNavigationFailure, isNavigationFailure } from "./router/navigationCore.mjs";
|
|
7
|
-
import { resolveRouteLocation } from "./router/resolve.mjs";
|
|
8
|
-
import { useNativePageRouter, useNativeRouter, useRoute } from "./router/useRoute.mjs";
|
|
9
|
-
import { useRouter } from "./router/useRouter.mjs";
|
|
10
|
-
export { type AddRoute, type InitialNavigationMode, type LocationQuery, type LocationQueryRaw, type LocationQueryValue, type LocationQueryValueRaw, type NamedRouteRecord, type NamedRoutes, type NavigationAfterEach, type NavigationAfterEachContext, type NavigationErrorContext, type NavigationErrorHandler, type NavigationFailure, NavigationFailureType, type NavigationFailureTypeValue, type NavigationGuard, type NavigationGuardContext, type NavigationGuardResult, type NavigationMode, type NavigationRedirect, type RouteLocationNormalizedLoaded, type RouteLocationRaw, type RouteLocationRedirectedFrom, type RouteMeta, type RouteParamValue, type RouteParamValueRaw, type RouteParams, type RouteParamsMode, type RouteParamsRaw, type RouteQueryParser, type RouteQueryStringifier, type RouteRecordInput, type RouteRecordMatched, type RouteRecordRaw, type RouteRecordRedirect, type RouterNavigateToOption, type RouterNavigation, type RouterReLaunchOption, type RouterRedirectToOption, type RouterSwitchTabOption, type SetupContextRouter, type TypedRouterTabBarUrl, type TypedRouterUrl, type UseRouterOptions, type WevuTypedRouterRouteMap, createNavigationFailure, createRouter, isNavigationFailure, parseQuery, resolveRouteLocation, stringifyQuery, useNativePageRouter, useNativeRouter, useRoute, useRouter };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { LocationQuery, LocationQueryRaw } from "../router/types.mjs";
|
|
2
|
-
import "../router.mjs";
|
|
3
|
-
//#region src/routerInternal/query.d.ts
|
|
4
|
-
export declare function parseQuery(search: string): LocationQuery;
|
|
5
|
-
export declare function stringifyQuery(query?: LocationQueryRaw | LocationQuery): string;
|
|
6
|
-
//#endregion
|
|
7
|
-
//# sourceMappingURL=query.d.mts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RouteQueryParser, RouteQueryStringifier } from "../router/types.mjs";
|
|
2
|
-
import "../router.mjs";
|
|
3
|
-
//#region src/routerInternal/types.d.ts
|
|
4
|
-
export interface RouteResolveCodec {
|
|
5
|
-
parseQuery: RouteQueryParser;
|
|
6
|
-
stringifyQuery: RouteQueryStringifier;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//# sourceMappingURL=types.d.mts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RuntimeApp } from "../types/runtime.mjs";
|
|
2
|
-
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/app/pending.d.ts
|
|
4
|
-
export interface PendingRuntimeAppRegistration {
|
|
5
|
-
app: RuntimeApp<any, any, any>;
|
|
6
|
-
register: () => void;
|
|
7
|
-
}
|
|
8
|
-
export declare function takePendingRuntimeAppRegistration(): PendingRuntimeAppRegistration | undefined;
|
|
9
|
-
//#endregion
|
|
10
|
-
//# sourceMappingURL=pending.d.mts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MiniProgramAdapter } from "../../types/miniprogram.mjs";
|
|
2
|
-
import "../../types.mjs";
|
|
3
|
-
//#region src/runtime/app/setData/commitTracker.d.ts
|
|
4
|
-
export type SetDataPayload = Record<string, unknown>;
|
|
5
|
-
export type SetDataAdapterSettlement = 'committed' | 'failed' | 'abandoned';
|
|
6
|
-
export type SetDataAdapterSettler = (settlement: SetDataAdapterSettlement, cause?: unknown) => void;
|
|
7
|
-
export interface CommitAwareSetDataAdapter extends MiniProgramAdapter {
|
|
8
|
-
__wevu_dispatchSetData?: (payload: SetDataPayload, settle: SetDataAdapterSettler) => void;
|
|
9
|
-
__wevu_reportSetDataError?: (error: Error) => void;
|
|
10
|
-
__wevu_disposeSetData?: () => void;
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//# sourceMappingURL=commitTracker.d.mts.map
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { SetDataDebugInfo } from "../../types/setData.mjs";
|
|
2
|
-
import "../../types.mjs";
|
|
3
|
-
import { CommitAwareSetDataAdapter } from "./commitTracker.mjs";
|
|
4
|
-
import "../../capabilities.mjs";
|
|
5
|
-
import { WevuRuntimeBindingManifestV1 } from "@weapp-core/constants";
|
|
6
|
-
//#region src/runtime/app/setData/scheduler.d.ts
|
|
7
|
-
export interface SetDataSchedulerOptions {
|
|
8
|
-
state: Record<string, any>;
|
|
9
|
-
setupState?: Record<string, any>;
|
|
10
|
-
snapshotOmitKeys?: Set<string>;
|
|
11
|
-
computedRefs: Record<string, {
|
|
12
|
-
value: any;
|
|
13
|
-
}>;
|
|
14
|
-
dirtyComputedKeys: Set<string>;
|
|
15
|
-
includeComputed: boolean;
|
|
16
|
-
setDataStrategy: 'diff' | 'patch';
|
|
17
|
-
computedCompare: 'reference' | 'shallow' | 'deep';
|
|
18
|
-
computedCompareMaxDepth: number;
|
|
19
|
-
computedCompareMaxKeys: number;
|
|
20
|
-
currentAdapter: CommitAwareSetDataAdapter;
|
|
21
|
-
shouldIncludeKey: (key: string) => boolean;
|
|
22
|
-
maxPatchKeys: number;
|
|
23
|
-
maxPayloadBytes: number;
|
|
24
|
-
mergeSiblingThreshold: number;
|
|
25
|
-
mergeSiblingMaxInflationRatio: number;
|
|
26
|
-
mergeSiblingMaxParentBytes: number;
|
|
27
|
-
mergeSiblingSkipArray: boolean;
|
|
28
|
-
elevateTopKeyThreshold: number;
|
|
29
|
-
prelinkMaxDepth?: number;
|
|
30
|
-
prelinkMaxKeys?: number;
|
|
31
|
-
toPlainMaxDepth: number;
|
|
32
|
-
toPlainMaxKeys: number;
|
|
33
|
-
includeFunctions?: boolean;
|
|
34
|
-
functionPaths: string[];
|
|
35
|
-
debug: ((info: SetDataDebugInfo) => void) | undefined;
|
|
36
|
-
debugWhen: 'fallback' | 'always';
|
|
37
|
-
debugSampleRate: number;
|
|
38
|
-
bindingManifest?: WevuRuntimeBindingManifestV1;
|
|
39
|
-
loopWarning: false | {
|
|
40
|
-
sampleWindowMs: number;
|
|
41
|
-
maxFlushes: number;
|
|
42
|
-
coolDownMs: number;
|
|
43
|
-
};
|
|
44
|
-
targetLabel?: string;
|
|
45
|
-
runTracker: () => void;
|
|
46
|
-
isMounted: () => boolean;
|
|
47
|
-
initialSnapshot?: Record<string, any>;
|
|
48
|
-
initialState?: Record<string, any>;
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//# sourceMappingURL=scheduler.d.mts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ComputedDefinitions, MethodDefinitions } from "./types/core.mjs";
|
|
2
|
-
import { RuntimeApp } from "./types/runtime.mjs";
|
|
3
|
-
import { CreateAppOptions } from "./types/options.mjs";
|
|
4
|
-
import "./types.mjs";
|
|
5
|
-
//#region src/runtime/app.d.ts
|
|
6
|
-
export declare function createApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(options: CreateAppOptions<D, C, M>): RuntimeApp<D, C, M>;
|
|
7
|
-
//#endregion
|
|
8
|
-
//# sourceMappingURL=app.d.mts.map
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { ComputedDefinitions, MethodDefinitions } from "./types/core.mjs";
|
|
2
|
-
import { InternalRuntimeState, RuntimeInstance } from "./types/runtime.mjs";
|
|
3
|
-
import { SetDataSnapshotOptions } from "./types/setData.mjs";
|
|
4
|
-
import "./types.mjs";
|
|
5
|
-
import { SetDataSchedulerOptions } from "./app/setData/scheduler.mjs";
|
|
6
|
-
import { InlineExpressionMap } from "./register/inline.mjs";
|
|
7
|
-
//#region src/runtime/capabilities.d.ts
|
|
8
|
-
export type RuntimeCapabilityName = 'patchStrategy' | 'templateRefs' | 'inlineEvents' | 'setDataHighFrequencyWarning' | 'scopedSlots' | 'layout';
|
|
9
|
-
export interface TemplateRefBinding {
|
|
10
|
-
selector: string;
|
|
11
|
-
inFor: boolean;
|
|
12
|
-
name?: string;
|
|
13
|
-
get?: () => unknown;
|
|
14
|
-
kind?: 'component' | 'element';
|
|
15
|
-
}
|
|
16
|
-
export interface LayoutHostBinding {
|
|
17
|
-
key: string;
|
|
18
|
-
refName?: string;
|
|
19
|
-
selector: string;
|
|
20
|
-
kind?: 'component';
|
|
21
|
-
}
|
|
22
|
-
export interface HighFrequencyWarningMonitorOptions {
|
|
23
|
-
option: SetDataSnapshotOptions['highFrequencyWarning'];
|
|
24
|
-
targetLabel: string;
|
|
25
|
-
isInPageScrollHook?: () => boolean;
|
|
26
|
-
now?: () => number;
|
|
27
|
-
logger?: (message: string) => void;
|
|
28
|
-
}
|
|
29
|
-
export interface SetDataScheduler {
|
|
30
|
-
job: () => void | Promise<void>;
|
|
31
|
-
snapshot: () => Record<string, unknown>;
|
|
32
|
-
cloneLatestSnapshot: () => Record<string, unknown>;
|
|
33
|
-
start?: () => void;
|
|
34
|
-
dispose?: () => void;
|
|
35
|
-
}
|
|
36
|
-
export interface ScopedSlotMountState {
|
|
37
|
-
ownerId: string;
|
|
38
|
-
shouldFlushNativeOwnerId: boolean;
|
|
39
|
-
}
|
|
40
|
-
export interface RuntimeCapabilityRegistry {
|
|
41
|
-
patchStrategy?: {
|
|
42
|
-
createScheduler: (options: SetDataSchedulerOptions) => SetDataScheduler;
|
|
43
|
-
};
|
|
44
|
-
templateRefs?: {
|
|
45
|
-
attachBindings: (target: InternalRuntimeState, bindings: readonly TemplateRefBinding[]) => void;
|
|
46
|
-
hasBindings: (target: InternalRuntimeState) => boolean;
|
|
47
|
-
schedule: (target: InternalRuntimeState, onResolved?: () => void, assignmentTarget?: InternalRuntimeState, onRejected?: (cause: unknown) => void) => void;
|
|
48
|
-
scheduleOwner: (target: InternalRuntimeState) => void;
|
|
49
|
-
clear: (target: InternalRuntimeState, assignmentTarget?: InternalRuntimeState) => void;
|
|
50
|
-
};
|
|
51
|
-
inlineEvents?: {
|
|
52
|
-
handler: (this: InternalRuntimeState, event: unknown) => unknown;
|
|
53
|
-
run: (context: unknown, expression: unknown, event: unknown, map?: InlineExpressionMap) => unknown;
|
|
54
|
-
};
|
|
55
|
-
setDataHighFrequencyWarning?: {
|
|
56
|
-
createMonitor: (options: HighFrequencyWarningMonitorOptions) => (() => void) | undefined;
|
|
57
|
-
};
|
|
58
|
-
scopedSlots?: {
|
|
59
|
-
prepareMount: (target: InternalRuntimeState) => ScopedSlotMountState;
|
|
60
|
-
attachMount: <D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(target: InternalRuntimeState, runtime: RuntimeInstance<D, C, M>, state: ScopedSlotMountState, deferSnapshot: boolean) => void;
|
|
61
|
-
refresh: (target: InternalRuntimeState, state: ScopedSlotMountState) => void;
|
|
62
|
-
syncNativeOwnerId: (target: InternalRuntimeState, state: ScopedSlotMountState) => void;
|
|
63
|
-
teardown: (target: InternalRuntimeState) => void;
|
|
64
|
-
resolveLifecycleProxy: (target: InternalRuntimeState) => unknown;
|
|
65
|
-
allocateOwnerId: () => string;
|
|
66
|
-
};
|
|
67
|
-
layout?: {
|
|
68
|
-
attachPageSetter: (target: InternalRuntimeState) => void;
|
|
69
|
-
attachHosts: (bindings: readonly LayoutHostBinding[], target: InternalRuntimeState) => void;
|
|
70
|
-
detachHosts: (bindings: readonly LayoutHostBinding[], target: InternalRuntimeState) => void;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
74
|
-
export type { SetDataSchedulerOptions };
|
|
75
|
-
//# sourceMappingURL=capabilities.d.mts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ComputedRef } from "../reactivity/computed.mjs";
|
|
2
|
-
import "../reactivity/index.mjs";
|
|
3
|
-
//#region src/runtime/css.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* 读取当前 SFC 的 CSS Modules 映射。
|
|
6
|
-
*/
|
|
7
|
-
export declare function useCssModule(name?: string): Record<string, string>;
|
|
8
|
-
/**
|
|
9
|
-
* 注册编译器生成的响应式 CSS 变量。
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export declare function useCssVars(getter: (context: Record<string, any>) => Record<string, unknown>): ComputedRef<string>;
|
|
13
|
-
//#endregion
|
|
14
|
-
//# sourceMappingURL=css.d.mts.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CreateAppOptions, DefineComponentOptions } from "./types/options.mjs";
|
|
2
|
-
import "./types.mjs";
|
|
3
|
-
//#region src/runtime/defaults.d.ts
|
|
4
|
-
export declare const INTERNAL_DEFAULTS_SCOPE_KEY = "__wevuDefaultsScope";
|
|
5
|
-
export interface WevuDefaults {
|
|
6
|
-
app?: Partial<CreateAppOptions<any, any, any>>;
|
|
7
|
-
component?: Partial<DefineComponentOptions<any, any, any, any>>;
|
|
8
|
-
}
|
|
9
|
-
export declare function setWevuDefaults(next: WevuDefaults): void;
|
|
10
|
-
export declare function resetWevuDefaults(): void;
|
|
11
|
-
//#endregion
|
|
12
|
-
//# sourceMappingURL=defaults.d.mts.map
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { HostMiniProgramComponentPropertyOption } from "./types/miniprogramHost.mjs";
|
|
2
|
-
import { MiniProgramComponentRawOptions } from "./types/miniprogram.mjs";
|
|
3
|
-
import { ComponentPropsOptions, InferProps } from "./types/props/propTypes.mjs";
|
|
4
|
-
import { ComponentPublicInstance, ComputedDefinitions, MethodDefinitions } from "./types/core.mjs";
|
|
5
|
-
import { RuntimeApp } from "./types/runtime.mjs";
|
|
6
|
-
import { DefineComponent, ShallowUnwrapRef } from "../vue-types.mjs";
|
|
7
|
-
import { SetDataSnapshotOptions } from "./types/setData.mjs";
|
|
8
|
-
import { DefineComponentOptions } from "./types/options.mjs";
|
|
9
|
-
import "./types.mjs";
|
|
10
|
-
import { WevuRuntimeBindingManifestV1 } from "@weapp-core/constants";
|
|
11
|
-
//#region src/runtime/define.d.ts
|
|
12
|
-
/**
|
|
13
|
-
* defineComponent 返回的组件定义描述,用于手动注册或高级用法。
|
|
14
|
-
*/
|
|
15
|
-
export interface ComponentDefinition<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
16
|
-
/**
|
|
17
|
-
* 内部 runtime app(高级能力使用),不对外暴露正式 API。
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
__wevu_runtime: RuntimeApp<D, C, M>;
|
|
21
|
-
/**
|
|
22
|
-
* 内部选项快照(高级能力使用),包含 data/computed/methods 等。
|
|
23
|
-
* @internal
|
|
24
|
-
*/
|
|
25
|
-
__wevu_options: {
|
|
26
|
-
scopedSlotOwnerRequired: boolean;
|
|
27
|
-
data: () => D;
|
|
28
|
-
computed: C;
|
|
29
|
-
methods: M;
|
|
30
|
-
setData: SetDataSnapshotOptions | undefined;
|
|
31
|
-
bindingManifest?: WevuRuntimeBindingManifestV1;
|
|
32
|
-
watch: Record<string, any> | undefined;
|
|
33
|
-
setup: ((props: any, ctx: any) => any) | undefined;
|
|
34
|
-
mpOptions: MiniProgramComponentRawOptions;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
type SetupBindings<S> = Exclude<S, void> extends never ? Record<never, never> : Exclude<S, void>;
|
|
38
|
-
type ResolveProps<P> = P extends ComponentPropsOptions ? InferProps<P> : P;
|
|
39
|
-
export interface WevuComponentConstructor<Props, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
40
|
-
new (): ComponentPublicInstance<D, C, M, Props> & ShallowUnwrapRef<RawBindings>;
|
|
41
|
-
}
|
|
42
|
-
export type WevuDefinedComponent<PropsOrPropOptions, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> = DefineComponent<PropsOrPropOptions, RawBindings, D, C, M> & ComponentDefinition<D, C, M>;
|
|
43
|
-
export interface SetupContextWithTypeProps<TypeProps> {
|
|
44
|
-
props: TypeProps;
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
}
|
|
47
|
-
export type SetupFunctionWithTypeProps<TypeProps> = (props: TypeProps, ctx: SetupContextWithTypeProps<TypeProps>) => Record<string, any> | void;
|
|
48
|
-
export interface DefineComponentTypePropsOptions<TypeProps> {
|
|
49
|
-
__typeProps: TypeProps;
|
|
50
|
-
setup?: SetupFunctionWithTypeProps<TypeProps>;
|
|
51
|
-
[key: string]: any;
|
|
52
|
-
}
|
|
53
|
-
export interface DefineComponentWithTypeProps<TypeProps> {
|
|
54
|
-
new (): {
|
|
55
|
-
$props: TypeProps;
|
|
56
|
-
} & Record<string, any>;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* 按 Vue 3 风格定义一个小程序组件/页面。
|
|
60
|
-
*
|
|
61
|
-
* - 统一注册为 `Component()`
|
|
62
|
-
*
|
|
63
|
-
* @param options 组件定义项
|
|
64
|
-
* @returns 可手动注册的组件定义
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```ts
|
|
68
|
-
* defineComponent({
|
|
69
|
-
* data: () => ({ count: 0 }),
|
|
70
|
-
* setup() {
|
|
71
|
-
* onMounted(() => console.log('已挂载'))
|
|
72
|
-
* }
|
|
73
|
-
* })
|
|
74
|
-
* ```
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```ts
|
|
78
|
-
* defineComponent({
|
|
79
|
-
* setup() {
|
|
80
|
-
* onPageScroll(() => {})
|
|
81
|
-
* }
|
|
82
|
-
* })
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
export declare function defineComponent<TypeProps = any>(options: DefineComponentTypePropsOptions<TypeProps>): DefineComponentWithTypeProps<TypeProps>;
|
|
86
|
-
export declare function defineComponent<P extends ComponentPropsOptions = Record<never, never>, D extends object = Record<never, never>, C extends ComputedDefinitions = Record<never, never>, M extends MethodDefinitions = Record<never, never>, S extends Record<string, any> | void = void>(options: DefineComponentOptions<P, D, C, M, S>): WevuComponentConstructor<ResolveProps<P>, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>;
|
|
87
|
-
/**
|
|
88
|
-
* 创建不触发宿主全局注册的 Wevu 组件定义。
|
|
89
|
-
*
|
|
90
|
-
* @param options 组件选项
|
|
91
|
-
* @internal
|
|
92
|
-
*/
|
|
93
|
-
export declare function createWevuComponentDefinition(options: DefineComponentOptions<any, any, any, any, any>): WevuComponentConstructor<InferProps<ComponentPropsOptions>, Record<string, any>, Record<string, any>, ComputedDefinitions, MethodDefinitions> & ComponentDefinition<any, any, any>;
|
|
94
|
-
/**
|
|
95
|
-
* 从现有组件定义派生拥有独立应用上下文的组件定义。
|
|
96
|
-
*
|
|
97
|
-
* @param definition 已解析的 Wevu 组件定义
|
|
98
|
-
* @internal
|
|
99
|
-
*/
|
|
100
|
-
export declare function createIsolatedWevuComponentDefinition(definition: object): ComponentDefinition<any, any, any>;
|
|
101
|
-
/**
|
|
102
|
-
* 获取组件定义对应的宿主生命周期定义。
|
|
103
|
-
*
|
|
104
|
-
* @param definition Wevu 组件定义
|
|
105
|
-
* @internal
|
|
106
|
-
*/
|
|
107
|
-
export declare function getWevuComponentLifecycleDefinition(definition: object): Record<string, any> | undefined;
|
|
108
|
-
/**
|
|
109
|
-
* 从 Vue SFC 选项创建 wevu 组件,供 weapp-vite 编译产物直接调用的兼容入口。
|
|
110
|
-
*
|
|
111
|
-
* @param options 组件选项,可能包含小程序特有的 properties
|
|
112
|
-
* @internal
|
|
113
|
-
*/
|
|
114
|
-
export declare function createWevuComponent<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions>(options: DefineComponentOptions<P, D, C, M> & {
|
|
115
|
-
properties?: HostMiniProgramComponentPropertyOption;
|
|
116
|
-
}): void;
|
|
117
|
-
//#endregion
|
|
118
|
-
//# sourceMappingURL=define.d.mts.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
//#region src/runtime/disposables.d.ts
|
|
2
|
-
export type DisposableMethodName = 'dispose' | 'abort' | 'cancel' | 'stop' | 'disconnect' | 'destroy' | 'close';
|
|
3
|
-
export type DisposableObject = Partial<Record<DisposableMethodName, () => void>>;
|
|
4
|
-
export type DisposableLike = (() => void) | DisposableObject;
|
|
5
|
-
export interface DisposableBag {
|
|
6
|
-
/**
|
|
7
|
-
* 注册一个清理项,返回“取消注册”函数(不会立即执行清理)。
|
|
8
|
-
*/
|
|
9
|
-
add: (target: DisposableLike | null | undefined) => () => void;
|
|
10
|
-
/**
|
|
11
|
-
* 立即执行并清空当前 bag 中的全部清理项(幂等)。
|
|
12
|
-
*/
|
|
13
|
-
dispose: () => void;
|
|
14
|
-
/**
|
|
15
|
-
* 注册 timeout,并在 bag dispose 时自动 clearTimeout。
|
|
16
|
-
*/
|
|
17
|
-
setTimeout: (handler: (...args: any[]) => void, timeout?: number, ...args: any[]) => ReturnType<typeof setTimeout>;
|
|
18
|
-
/**
|
|
19
|
-
* 注册 interval,并在 bag dispose 时自动 clearInterval。
|
|
20
|
-
*/
|
|
21
|
-
setInterval: (handler: (...args: any[]) => void, timeout?: number, ...args: any[]) => ReturnType<typeof setInterval>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* 在 setup() 中创建一个“清理袋”,统一管理副作用释放。
|
|
25
|
-
*
|
|
26
|
-
* 典型用法:注册定时器、请求任务、事件监听退订函数,
|
|
27
|
-
* 在页面/组件卸载时自动批量清理,减少内存泄漏风险。
|
|
28
|
-
*/
|
|
29
|
-
export declare function useDisposables(): DisposableBag;
|
|
30
|
-
//#endregion
|
|
31
|
-
//# sourceMappingURL=disposables.d.mts.map
|