wevu 7.1.3 → 7.2.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/README.md +20 -6
- package/dist/dev/index.d.mts +3 -3
- package/dist/dev/index.mjs +3 -2
- package/dist/dev/package.mjs +1 -1
- package/dist/dev/reactivity/computed.d.mts +4 -0
- 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.d.mts +8 -0
- package/dist/dev/router/auto-routes.mjs +11 -0
- package/dist/dev/router/auto-routes.mjs.map +1 -0
- package/dist/dev/router/createRouter.d.mts +2 -1
- package/dist/dev/router/createRouter.mjs +3 -4
- package/dist/dev/router/createRouter.mjs.map +1 -1
- package/dist/dev/router/navigationCore.d.mts +3 -2
- package/dist/dev/router/navigationCore.mjs +7 -7
- package/dist/dev/router/navigationCore.mjs.map +1 -1
- package/dist/dev/router/resolve.d.mts +3 -2
- package/dist/dev/router/resolve.mjs.map +1 -1
- package/dist/dev/router/routeSync.d.mts +1 -0
- package/dist/dev/router/types.d.mts +173 -78
- package/dist/dev/router/types.mjs.map +1 -1
- package/dist/dev/router/useRoute.d.mts +4 -3
- package/dist/dev/router/useRoute.mjs.map +1 -1
- package/dist/dev/router/useRouter.d.mts +2 -1
- package/dist/dev/router/useRouter.mjs.map +1 -1
- package/dist/dev/router.d.mts +19 -3
- package/dist/dev/routerInternal/location.d.mts +2 -0
- package/dist/dev/routerInternal/matching.d.mts +2 -0
- package/dist/dev/routerInternal/matching.mjs +1 -1
- package/dist/dev/routerInternal/matching.mjs.map +1 -1
- package/dist/dev/routerInternal/params.d.mts +2 -0
- package/dist/dev/routerInternal/params.mjs.map +1 -1
- package/dist/dev/routerInternal/records.d.mts +2 -0
- package/dist/dev/routerInternal/recordsWarnings.d.mts +2 -0
- package/dist/dev/routerInternal/shared.d.mts +9 -0
- package/dist/dev/routerInternal/snapshots.d.mts +2 -0
- 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.d.mts +5 -16
- package/dist/dev/store/define.mjs +11 -15
- package/dist/dev/store/define.mjs.map +1 -1
- package/dist/dev/store/manager.d.mts +13 -5
- package/dist/dev/store/manager.mjs +55 -14
- package/dist/dev/store/manager.mjs.map +1 -1
- package/dist/dev/store/storeToRefs.d.mts +5 -7
- 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.d.mts +85 -59
- 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.d.mts +3 -3
- package/dist/dev/store.mjs +3 -2
- package/dist/dev/vue-demi.d.mts +3 -3
- 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/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/store/define/optionsStyle.mjs +0 -1
- package/dist/store/define/setupStyle.mjs +0 -1
- package/dist/store/define/shared.mjs +0 -1
|
@@ -1,80 +1,106 @@
|
|
|
1
|
+
import { Ref as Ref$1 } from "../reactivity/ref.mjs";
|
|
2
|
+
import { ComputedRef, WritableComputedRef } from "../reactivity/computed.mjs";
|
|
3
|
+
import { EffectScope } from "../reactivity/core.mjs";
|
|
4
|
+
import { WatchOptions } from "../reactivity/watch/types.mjs";
|
|
5
|
+
import "../reactivity/index.mjs";
|
|
6
|
+
import { UnwrapRef } from "vue";
|
|
1
7
|
//#region src/store/types.d.ts
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
/** 与 Pinia 一致的变更类型和值。 */
|
|
9
|
+
export declare const MutationType: {
|
|
10
|
+
readonly direct: "direct";
|
|
11
|
+
readonly patchObject: "patch object";
|
|
12
|
+
readonly patchFunction: "patch function";
|
|
13
|
+
};
|
|
14
|
+
export type MutationType = typeof MutationType[keyof typeof MutationType];
|
|
15
|
+
export type StateTree = Record<PropertyKey, any>;
|
|
16
|
+
export type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]>; };
|
|
17
|
+
export type SubscriptionCallbackMutation<S> = {
|
|
18
|
+
type: 'direct' | 'patch function';
|
|
19
|
+
storeId: string;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'patch object';
|
|
22
|
+
storeId: string;
|
|
23
|
+
payload: DeepPartial<S>;
|
|
24
|
+
};
|
|
9
25
|
export interface SubscriptionCallback<S = any> {
|
|
10
|
-
(mutation:
|
|
11
|
-
type: MutationType;
|
|
12
|
-
storeId: string;
|
|
13
|
-
}, state: S): void;
|
|
26
|
+
(mutation: SubscriptionCallbackMutation<S>, state: S): void;
|
|
14
27
|
}
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
export interface StoreSubscribeOptions {
|
|
19
|
-
/**
|
|
20
|
-
* @description 是否在卸载后仍保留订阅(适用于跨页面生命周期的订阅)
|
|
21
|
-
*/
|
|
28
|
+
/** detached 订阅不随注册时的页面或组件作用域卸载。 */
|
|
29
|
+
export interface StoreSubscribeOptions extends WatchOptions<boolean> {
|
|
22
30
|
detached?: boolean;
|
|
23
31
|
}
|
|
24
|
-
/**
|
|
25
|
-
* @description Action 订阅回调上下文
|
|
26
|
-
*/
|
|
27
32
|
export interface ActionContext<TStore = any, TResult = any> {
|
|
28
33
|
name: string;
|
|
29
34
|
store: TStore;
|
|
30
35
|
args: any[];
|
|
31
|
-
after: (
|
|
32
|
-
onError: (
|
|
36
|
+
after: (callback: (result: TResult) => void) => void;
|
|
37
|
+
onError: (callback: (error: any) => void) => void;
|
|
33
38
|
}
|
|
34
|
-
/**
|
|
35
|
-
* @description Action 订阅回调类型
|
|
36
|
-
*/
|
|
37
39
|
export interface ActionSubscriber<TStore = any, TResult = any> {
|
|
38
40
|
(context: ActionContext<TStore, TResult>): void;
|
|
39
41
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
export interface PiniaPluginContext {
|
|
43
|
+
store: any;
|
|
44
|
+
pinia: Pinia;
|
|
45
|
+
app: any;
|
|
46
|
+
options: Record<string, any>;
|
|
47
|
+
}
|
|
48
|
+
export interface PiniaPlugin {
|
|
49
|
+
(context: PiniaPluginContext): Partial<PiniaCustomProperties> & Record<string, any> | void;
|
|
50
|
+
}
|
|
51
|
+
/** 应用的 Store 管理器,独立保存实例与状态。 */
|
|
52
|
+
export interface Pinia {
|
|
53
|
+
state: Ref$1<Record<string, StateTree>>;
|
|
44
54
|
install: (app: any) => void;
|
|
55
|
+
use: (plugin: PiniaPlugin) => Pinia;
|
|
56
|
+
_e: EffectScope;
|
|
57
|
+
_s: Map<string, any>;
|
|
58
|
+
_p: PiniaPlugin[];
|
|
59
|
+
_a: any;
|
|
60
|
+
/** @deprecated 使用公开的 Pinia API。 */
|
|
45
61
|
_stores: Map<string, any>;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}) => void) => StoreManager;
|
|
49
|
-
_plugins: Array<(context: {
|
|
50
|
-
store: any;
|
|
51
|
-
}) => void>;
|
|
62
|
+
/** @deprecated 使用 use() 注册插件。 */
|
|
63
|
+
_plugins: PiniaPlugin[];
|
|
52
64
|
}
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
/** createStore 返回的管理器,与 Pinia 使用同一类型契约。 */
|
|
66
|
+
export type StoreManager = Pinia;
|
|
67
|
+
export interface PiniaCustomProperties {}
|
|
68
|
+
export interface PiniaCustomStateProperties<S extends StateTree = StateTree> {}
|
|
69
|
+
export interface StoreDefinition<Id extends string = string, T = any> {
|
|
70
|
+
(pinia?: Pinia | null): T;
|
|
71
|
+
$id: Id;
|
|
72
|
+
}
|
|
73
|
+
export interface StoreSetupOptions {
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
}
|
|
76
|
+
export type StoreGetters<G> = { readonly [K in keyof G]: G[K] extends ((...args: any[]) => infer R) ? R : never; };
|
|
77
|
+
/** 通过 action 名称同时收窄参数与异步解包后的返回值。 */
|
|
78
|
+
type StoreActionContext<TStore, A> = { [K in keyof A]: A[K] extends ((...args: infer Args) => infer Result) ? Omit<ActionContext<TStore, Awaited<Result>>, 'name' | 'args'> & {
|
|
79
|
+
name: K;
|
|
80
|
+
args: Args;
|
|
81
|
+
} : never; }[keyof A];
|
|
82
|
+
export interface StoreApi<Id extends string, S, TStore, A> {
|
|
83
|
+
$id: Id;
|
|
84
|
+
$state: keyof PiniaCustomStateProperties extends never ? S : S & PiniaCustomStateProperties;
|
|
85
|
+
$patch: (patch: DeepPartial<S> | ((state: S) => void)) => void;
|
|
67
86
|
$reset: () => void;
|
|
68
|
-
$subscribe: (
|
|
69
|
-
$onAction: (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
state:
|
|
76
|
-
getters?: G & Record<string, (state: S) => any> & ThisType<OptionsStore<S, G, A>>;
|
|
87
|
+
$subscribe: (callback: SubscriptionCallback<S>, options?: StoreSubscribeOptions) => () => void;
|
|
88
|
+
$onAction: (callback: (context: StoreActionContext<TStore, A>) => void, detached?: boolean) => () => void;
|
|
89
|
+
$dispose: () => void;
|
|
90
|
+
}
|
|
91
|
+
export type OptionsStore<S extends Record<string, any>, G extends Record<string, any>, A extends Record<string, any>, Id extends string = string> = UnwrapRef<S> & StoreGetters<G> & A & PiniaCustomProperties & PiniaCustomStateProperties<S> & StoreApi<Id, UnwrapRef<S>, OptionsStore<S, G, A, Id>, A>;
|
|
92
|
+
export interface DefineStoreOptions<S extends Record<string, any>, G extends Record<string, any>, A extends Record<string, any>> {
|
|
93
|
+
state?: () => S;
|
|
94
|
+
getters?: G & Record<string, (state: UnwrapRef<S>) => any> & ThisType<OptionsStore<S, G, A>>;
|
|
77
95
|
actions?: A & ThisType<OptionsStore<S, G, A>>;
|
|
96
|
+
[key: string]: any;
|
|
78
97
|
}
|
|
98
|
+
type SetupActions<T> = { [K in keyof T as T[K] extends ((...args: any[]) => any) ? K : never]: T[K]; };
|
|
99
|
+
type SetupState<T> = { [K in keyof T as T[K] extends ComputedRef<any> | WritableComputedRef<any> | ((...args: any[]) => any) ? never : K]: UnwrapRef<T[K]>; };
|
|
100
|
+
type SetupValues<T> = { [K in keyof T as T[K] extends ComputedRef<any> ? never : K]: UnwrapRef<T[K]>; } & { readonly [K in keyof T as T[K] extends ComputedRef<any> ? K : never]: UnwrapRef<T[K]>; };
|
|
101
|
+
export type SetupStore<Id extends string, T extends Record<string, any>> = SetupValues<T> & PiniaCustomProperties & StoreApi<Id, SetupState<T>, SetupStore<Id, T>, SetupActions<T>>;
|
|
102
|
+
export type StoreGeneric = Record<string, any> & StoreApi<string, any, any, any>;
|
|
103
|
+
export type StoreState<T extends StoreGeneric> = T['$state'];
|
|
104
|
+
export type StoreActions<T extends StoreGeneric> = SetupActions<Omit<T, keyof StoreApi<any, any, any, any>>>;
|
|
79
105
|
//#endregion
|
|
80
106
|
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../../../src/store/types.ts"],"sourcesContent":["import type { UnwrapRef } from 'vue'\nimport type { ComputedRef, Ref, WritableComputedRef } from '../reactivity'\nimport type { EffectScope } from '../reactivity/core'\nimport type { WatchOptions } from '../reactivity/watch/types'\n\n/** 与 Pinia 一致的变更类型和值。 */\nexport const MutationType = {\n direct: 'direct',\n patchObject: 'patch object',\n patchFunction: 'patch function',\n} as const\n// eslint-disable-next-line ts/no-redeclare -- 与 Pinia 一致,同时导出类型和运行时值\nexport type MutationType = typeof MutationType[keyof typeof MutationType]\nexport type StateTree = Record<PropertyKey, any>\nexport type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> }\nexport type SubscriptionCallbackMutation<S>\n = | { type: 'direct' | 'patch function', storeId: string }\n | { type: 'patch object', storeId: string, payload: DeepPartial<S> }\nexport interface SubscriptionCallback<S = any> {\n (mutation: SubscriptionCallbackMutation<S>, state: S): void\n}\n/** detached 订阅不随注册时的页面或组件作用域卸载。 */\nexport interface StoreSubscribeOptions extends WatchOptions<boolean> {\n detached?: boolean\n}\nexport interface ActionContext<TStore = any, TResult = any> {\n name: string\n store: TStore\n args: any[]\n after: (callback: (result: TResult) => void) => void\n onError: (callback: (error: any) => void) => void\n}\nexport interface ActionSubscriber<TStore = any, TResult = any> {\n (context: ActionContext<TStore, TResult>): void\n}\nexport interface PiniaPluginContext {\n store: any\n pinia: Pinia\n app: any\n options: Record<string, any>\n}\nexport interface PiniaPlugin {\n (context: PiniaPluginContext): Partial<PiniaCustomProperties> & Record<string, any> | void\n}\n/** 应用的 Store 管理器,独立保存实例与状态。 */\nexport interface Pinia {\n state: Ref<Record<string, StateTree>>\n install: (app: any) => void\n use: (plugin: PiniaPlugin) => Pinia\n _e: EffectScope\n _s: Map<string, any>\n _p: PiniaPlugin[]\n _a: any\n /** @deprecated 使用公开的 Pinia API。 */\n _stores: Map<string, any>\n /** @deprecated 使用 use() 注册插件。 */\n _plugins: PiniaPlugin[]\n}\n/** createStore 返回的管理器,与 Pinia 使用同一类型契约。 */\nexport type StoreManager = Pinia\n\nexport interface PiniaCustomProperties {}\n\n// eslint-disable-next-line ts/no-unused-vars -- 保留 Pinia 的泛型参数名,供消费者声明合并\nexport interface PiniaCustomStateProperties<S extends StateTree = StateTree> {}\n\nexport interface StoreDefinition<Id extends string = string, T = any> {\n (pinia?: Pinia | null): T\n $id: Id\n}\nexport interface StoreSetupOptions { [key: string]: any }\nexport type GetterTree<S extends Record<string, any>> = Record<string, (state: S) => any>\nexport type StoreGetters<G> = { readonly [K in keyof G]: G[K] extends (...args: any[]) => infer R ? R : never }\n/** 通过 action 名称同时收窄参数与异步解包后的返回值。 */\ntype StoreActionContext<TStore, A> = {\n [K in keyof A]: A[K] extends (...args: infer Args) => infer Result\n ? Omit<ActionContext<TStore, Awaited<Result>>, 'name' | 'args'> & { name: K, args: Args }\n : never\n}[keyof A]\nexport interface StoreApi<Id extends string, S, TStore, A> {\n $id: Id\n $state: keyof PiniaCustomStateProperties extends never ? S : S & PiniaCustomStateProperties\n $patch: (patch: DeepPartial<S> | ((state: S) => void)) => void\n $reset: () => void\n $subscribe: (callback: SubscriptionCallback<S>, options?: StoreSubscribeOptions) => () => void\n $onAction: (callback: (context: StoreActionContext<TStore, A>) => void, detached?: boolean) => () => void\n $dispose: () => void\n}\nexport type OptionsStore<S extends Record<string, any>, G extends Record<string, any>, A extends Record<string, any>, Id extends string = string>\n = UnwrapRef<S> & StoreGetters<G> & A & PiniaCustomProperties & PiniaCustomStateProperties<S>\n & StoreApi<Id, UnwrapRef<S>, OptionsStore<S, G, A, Id>, A>\nexport interface DefineStoreOptions<S extends Record<string, any>, G extends Record<string, any>, A extends Record<string, any>> {\n state?: () => S\n getters?: G & Record<string, (state: UnwrapRef<S>) => any> & ThisType<OptionsStore<S, G, A>>\n actions?: A & ThisType<OptionsStore<S, G, A>>\n [key: string]: any\n}\ntype SetupActions<T> = { [K in keyof T as T[K] extends (...args: any[]) => any ? K : never]: T[K] }\ntype SetupState<T> = { [K in keyof T as T[K] extends ComputedRef<any> | WritableComputedRef<any> | ((...args: any[]) => any) ? never : K]: UnwrapRef<T[K]> }\ntype SetupValues<T> = { [K in keyof T as T[K] extends ComputedRef<any> ? never : K]: UnwrapRef<T[K]> }\n & { readonly [K in keyof T as T[K] extends ComputedRef<any> ? K : never]: UnwrapRef<T[K]> }\nexport type SetupStore<Id extends string, T extends Record<string, any>> = SetupValues<T> & PiniaCustomProperties\n & StoreApi<Id, SetupState<T>, SetupStore<Id, T>, SetupActions<T>>\nexport type StoreGeneric = Record<string, any> & StoreApi<string, any, any, any>\nexport type StoreState<T extends StoreGeneric> = T['$state']\nexport type StoreActions<T extends StoreGeneric> = SetupActions<Omit<T, keyof StoreApi<any, any, any, any>>>\nexport type StoreGettersType<T extends StoreGeneric> = Omit<T, keyof StoreState<T> | keyof StoreActions<T> | keyof StoreApi<any, any, any, any>>\n"],"mappings":";;AAMA,MAAa,eAAe;CAC1B,QAAQ;CACR,aAAa;CACb,eAAe;AACjB"}
|
package/dist/dev/store/utils.mjs
CHANGED
|
@@ -7,43 +7,7 @@ function isPlainObject(val) {
|
|
|
7
7
|
const proto = Object.getPrototypeOf(val);
|
|
8
8
|
return proto === Object.prototype || proto === null;
|
|
9
9
|
}
|
|
10
|
-
function mergeShallow(target, patch) {
|
|
11
|
-
for (const k in patch) target[k] = patch[k];
|
|
12
|
-
}
|
|
13
|
-
function cloneDeep(value) {
|
|
14
|
-
if (Array.isArray(value)) return value.map((item) => cloneDeep(item));
|
|
15
|
-
if (isPlainObject(value)) {
|
|
16
|
-
const result = {};
|
|
17
|
-
for (const key in value) result[key] = cloneDeep(value[key]);
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
return value;
|
|
21
|
-
}
|
|
22
|
-
function resetObject(target, snapshot) {
|
|
23
|
-
if (Array.isArray(target) && Array.isArray(snapshot)) {
|
|
24
|
-
target.length = 0;
|
|
25
|
-
snapshot.forEach((item, index) => {
|
|
26
|
-
target[index] = cloneDeep(item);
|
|
27
|
-
});
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (!isObject(snapshot)) return;
|
|
31
|
-
for (const key in target) if (!(key in snapshot)) delete target[key];
|
|
32
|
-
for (const key in snapshot) {
|
|
33
|
-
const snapValue = snapshot[key];
|
|
34
|
-
const currentValue = target[key];
|
|
35
|
-
if (Array.isArray(snapValue) && Array.isArray(currentValue)) {
|
|
36
|
-
resetObject(currentValue, snapValue);
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
if (isPlainObject(snapValue) && isPlainObject(currentValue)) {
|
|
40
|
-
resetObject(currentValue, snapValue);
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
target[key] = cloneDeep(snapValue);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
10
|
|
|
47
11
|
//#endregion
|
|
48
|
-
export {
|
|
12
|
+
export { isObject, isPlainObject };
|
|
49
13
|
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../src/store/utils.ts"],"sourcesContent":["export function isObject(val: unknown): val is object {\n return typeof val === 'object' && val !== null\n}\n\nexport function isPlainObject(val: unknown): val is Record<string, any> {\n if (!isObject(val)) {\n return false\n }\n const proto = Object.getPrototypeOf(val)\n return proto === Object.prototype || proto === null\n}\n
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../src/store/utils.ts"],"sourcesContent":["export function isObject(val: unknown): val is object {\n return typeof val === 'object' && val !== null\n}\n\nexport function isPlainObject(val: unknown): val is Record<string, any> {\n if (!isObject(val)) {\n return false\n }\n const proto = Object.getPrototypeOf(val)\n return proto === Object.prototype || proto === null\n}\n"],"mappings":";AAAA,SAAgB,SAAS,KAA6B;CACpD,OAAO,OAAO,QAAQ,YAAY,QAAQ;AAC5C;AAEA,SAAgB,cAAc,KAA0C;CACtE,IAAI,CAAC,SAAS,GAAG,GACf,OAAO;CAET,MAAM,QAAQ,OAAO,eAAe,GAAG;CACvC,OAAO,UAAU,OAAO,aAAa,UAAU;AACjD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { toRaw } from "../reactivity/reactive/shared.mjs";
|
|
2
|
+
import { isShallowReactive } from "../reactivity/reactive/shallow.mjs";
|
|
3
|
+
import { isReactive, reactive } from "../reactivity/reactive.mjs";
|
|
4
|
+
import { isRef } from "../reactivity/ref.mjs";
|
|
5
|
+
import { isPlainObject } from "./utils.mjs";
|
|
6
|
+
|
|
7
|
+
//#region src/store/view.ts
|
|
8
|
+
const views = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
/** 仅在 Store 边界解包 ref,所有读写仍转发到原始响应式来源。 */
|
|
10
|
+
function storeView(source) {
|
|
11
|
+
if (source["__r_skip"]) return source;
|
|
12
|
+
if (!isPlainObject(source) && !Array.isArray(source)) return source;
|
|
13
|
+
if (isReactive(source) && isShallowReactive(source)) return source;
|
|
14
|
+
const target = isReactive(source) ? source : reactive(source);
|
|
15
|
+
const cached = views.get(target);
|
|
16
|
+
if (cached) return cached;
|
|
17
|
+
const storeViewValue = (value) => isReactive(value) ? storeView(value) : value;
|
|
18
|
+
const view = new Proxy(target, {
|
|
19
|
+
get(object, key, receiver) {
|
|
20
|
+
const value = Reflect.get(object, key, receiver);
|
|
21
|
+
if (key === "__r_raw" || key === "__r_skip") return value;
|
|
22
|
+
if (isRef(value)) return Array.isArray(object) && typeof key === "string" && /^\d+$/.test(key) ? value : storeViewValue(value.value);
|
|
23
|
+
return storeViewValue(value);
|
|
24
|
+
},
|
|
25
|
+
set(object, key, value, receiver) {
|
|
26
|
+
const previous = Reflect.get(object, key, receiver);
|
|
27
|
+
if (isRef(previous) && !isRef(value) && !Array.isArray(object)) {
|
|
28
|
+
previous.value = value;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
return Reflect.set(object, key, value, receiver);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
views.set(target, view);
|
|
35
|
+
views.set(view, view);
|
|
36
|
+
return view;
|
|
37
|
+
}
|
|
38
|
+
/** 合并普通对象,数组替换;保留 ref 和已有响应式对象的写入语义。 */
|
|
39
|
+
function mergeState(target, patch) {
|
|
40
|
+
if (target instanceof Map && patch instanceof Map) patch.forEach((value, key) => target.set(key, value));
|
|
41
|
+
else if (target instanceof Set && patch instanceof Set) patch.forEach((value) => target.add(value));
|
|
42
|
+
for (const key of Object.keys(patch !== null && patch !== void 0 ? patch : {})) {
|
|
43
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") continue;
|
|
44
|
+
const value = patch[key];
|
|
45
|
+
if (isPlainObject(target[key]) && isPlainObject(value) && !isRef(value) && !isReactive(value)) mergeState(target[key], value);
|
|
46
|
+
else target[key] = value;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** 返回尚未解包的属性,供 storeToRefs 保留 state/getter 的来源。 */
|
|
50
|
+
function rawStore(store) {
|
|
51
|
+
return toRaw(store);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { mergeState, rawStore, storeView };
|
|
56
|
+
//# sourceMappingURL=view.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.mjs","names":[],"sources":["../../../src/store/view.ts"],"sourcesContent":["import { isReactive, isRef, isShallowReactive, reactive, toRaw } from '../reactivity'\nimport { ReactiveFlags } from '../reactivity/reactive/shared'\nimport { isPlainObject } from './utils'\n\nconst views = new WeakMap<object, any>()\n\n/** 仅在 Store 边界解包 ref,所有读写仍转发到原始响应式来源。 */\nexport function storeView<T extends object>(source: T): T {\n if ((source as any)[ReactiveFlags.SKIP]) {\n return source\n }\n if (!isPlainObject(source) && !Array.isArray(source)) {\n return source\n }\n if (isReactive(source) && isShallowReactive(source)) {\n return source\n }\n const target = isReactive(source) ? source : reactive(source)\n const cached = views.get(target)\n if (cached) {\n return cached\n }\n // 属性视图只解包既有响应式来源,不把 shallowRef 的普通值转成深层代理。\n const storeViewValue = (value: any): any => isReactive(value) ? storeView(value) : value\n const view = new Proxy(target, {\n get(object, key, receiver) {\n const value = Reflect.get(object, key, receiver)\n if (key === ReactiveFlags.RAW || key === ReactiveFlags.SKIP) {\n return value\n }\n if (isRef(value)) {\n return Array.isArray(object) && typeof key === 'string' && /^\\d+$/.test(key)\n ? value\n : storeViewValue(value.value)\n }\n return storeViewValue(value)\n },\n set(object, key, value, receiver) {\n const previous = Reflect.get(object, key, receiver)\n if (isRef(previous) && !isRef(value) && !Array.isArray(object)) {\n previous.value = value\n return true\n }\n return Reflect.set(object, key, value, receiver)\n },\n })\n views.set(target, view)\n views.set(view, view)\n return view\n}\n\n/** 合并普通对象,数组替换;保留 ref 和已有响应式对象的写入语义。 */\nexport function mergeState(target: Record<string, any>, patch: Record<string, any>) {\n if (target instanceof Map && patch instanceof Map) {\n patch.forEach((value, key) => target.set(key, value))\n }\n else if (target instanceof Set && patch instanceof Set) {\n patch.forEach(value => target.add(value))\n }\n for (const key of Object.keys(patch ?? {})) {\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n continue\n }\n const value = patch[key]\n if (isPlainObject(target[key]) && isPlainObject(value) && !isRef(value) && !isReactive(value)) {\n mergeState(target[key], value)\n }\n else {\n target[key] = value\n }\n }\n}\n\n/** 返回尚未解包的属性,供 storeToRefs 保留 state/getter 的来源。 */\nexport function rawStore(store: object): Record<string, any> {\n return toRaw(store)\n}\n"],"mappings":";;;;;;;AAIA,MAAM,wBAAQ,IAAI,QAAqB;;AAGvC,SAAgB,UAA4B,QAAc;CACxD,IAAK,oBACH,OAAO;CAET,IAAI,CAAC,cAAc,MAAM,KAAK,CAAC,MAAM,QAAQ,MAAM,GACjD,OAAO;CAET,IAAI,WAAW,MAAM,KAAK,kBAAkB,MAAM,GAChD,OAAO;CAET,MAAM,SAAS,WAAW,MAAM,IAAI,SAAS,SAAS,MAAM;CAC5D,MAAM,SAAS,MAAM,IAAI,MAAM;CAC/B,IAAI,QACF,OAAO;CAGT,MAAM,kBAAkB,UAAoB,WAAW,KAAK,IAAI,UAAU,KAAK,IAAI;CACnF,MAAM,OAAO,IAAI,MAAM,QAAQ;EAC7B,IAAI,QAAQ,KAAK,UAAU;GACzB,MAAM,QAAQ,QAAQ,IAAI,QAAQ,KAAK,QAAQ;GAC/C,IAAI,qBAA6B,oBAC/B,OAAO;GAET,IAAI,MAAM,KAAK,GACb,OAAO,MAAM,QAAQ,MAAM,KAAK,OAAO,QAAQ,YAAY,QAAQ,KAAK,GAAG,IACvE,QACA,eAAe,MAAM,KAAK;GAEhC,OAAO,eAAe,KAAK;EAC7B;EACA,IAAI,QAAQ,KAAK,OAAO,UAAU;GAChC,MAAM,WAAW,QAAQ,IAAI,QAAQ,KAAK,QAAQ;GAClD,IAAI,MAAM,QAAQ,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,QAAQ,MAAM,GAAG;IAC9D,SAAS,QAAQ;IACjB,OAAO;GACT;GACA,OAAO,QAAQ,IAAI,QAAQ,KAAK,OAAO,QAAQ;EACjD;CACF,CAAC;CACD,MAAM,IAAI,QAAQ,IAAI;CACtB,MAAM,IAAI,MAAM,IAAI;CACpB,OAAO;AACT;;AAGA,SAAgB,WAAW,QAA6B,OAA4B;CAClF,IAAI,kBAAkB,OAAO,iBAAiB,KAC5C,MAAM,SAAS,OAAO,QAAQ,OAAO,IAAI,KAAK,KAAK,CAAC;MAEjD,IAAI,kBAAkB,OAAO,iBAAiB,KACjD,MAAM,SAAQ,UAAS,OAAO,IAAI,KAAK,CAAC;CAE1C,KAAK,MAAM,OAAO,OAAO,KAAK,6CAAS,CAAC,CAAC,GAAG;EAC1C,IAAI,QAAQ,eAAe,QAAQ,iBAAiB,QAAQ,aAC1D;EAEF,MAAM,QAAQ,MAAM;EACpB,IAAI,cAAc,OAAO,IAAI,KAAK,cAAc,KAAK,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,WAAW,KAAK,GAC1F,WAAW,OAAO,MAAM,KAAK;OAG7B,OAAO,OAAO;CAElB;AACF;;AAGA,SAAgB,SAAS,OAAoC;CAC3D,OAAO,MAAM,KAAK;AACpB"}
|
package/dist/dev/store.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ActionContext, ActionSubscriber, DefineStoreOptions, MutationType, StoreManager, StoreSubscribeOptions, SubscriptionCallback } from "./store/types.mjs";
|
|
1
|
+
import { ActionContext, ActionSubscriber, DefineStoreOptions, MutationType, Pinia, PiniaCustomProperties, PiniaCustomStateProperties, PiniaPlugin, PiniaPluginContext, StateTree, StoreActions, StoreDefinition, StoreGeneric, StoreManager, StoreState, StoreSubscribeOptions, SubscriptionCallback, SubscriptionCallbackMutation } from "./store/types.mjs";
|
|
2
2
|
import { defineStore } from "./store/define.mjs";
|
|
3
|
-
import { createStore } from "./store/manager.mjs";
|
|
3
|
+
import { createPinia, createStore, disposePinia, getActivePinia, setActivePinia } from "./store/manager.mjs";
|
|
4
4
|
import { StoreToRefsResult, storeToRefs } from "./store/storeToRefs.mjs";
|
|
5
|
-
export { type ActionContext, type ActionSubscriber, type DefineStoreOptions, type
|
|
5
|
+
export { type ActionContext, type ActionSubscriber, type DefineStoreOptions, MutationType, type Pinia, type PiniaCustomProperties, type PiniaCustomStateProperties, type PiniaPlugin, type PiniaPluginContext, type StateTree, type StoreActions, type StoreDefinition, type StoreGeneric, type StoreManager, type StoreState, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, type SubscriptionCallbackMutation, createPinia, createStore, defineStore, disposePinia, getActivePinia, setActivePinia, storeToRefs };
|
package/dist/dev/store.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { createStore } from "./store/manager.mjs";
|
|
1
|
+
import { createPinia, createStore, disposePinia, getActivePinia, setActivePinia } from "./store/manager.mjs";
|
|
2
|
+
import { MutationType } from "./store/types.mjs";
|
|
2
3
|
import { defineStore } from "./store/define.mjs";
|
|
3
4
|
import { storeToRefs } from "./store/storeToRefs.mjs";
|
|
4
5
|
|
|
5
|
-
export { createStore, defineStore, storeToRefs };
|
|
6
|
+
export { MutationType, createPinia, createStore, defineStore, disposePinia, getActivePinia, setActivePinia, storeToRefs };
|
package/dist/dev/vue-demi.d.mts
CHANGED
|
@@ -58,9 +58,9 @@ import { useNativePageRouter, useNativeRouter } from "./runtime/vueCompat/router
|
|
|
58
58
|
import { TemplateRef, useTemplateRef } from "./runtime/vueCompat/templateRef.mjs";
|
|
59
59
|
import { ComponentTypeEmits, EmitFn, EmitsOptions } from "./macros/shared.mjs";
|
|
60
60
|
import { DefineModelModifiers, DefineModelTransformOptions, ModelRef, PageLayoutMeta, PageMeta, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, withDefaults } from "./macros.mjs";
|
|
61
|
-
import { ActionContext, ActionSubscriber, DefineStoreOptions, MutationType, StoreManager, StoreSubscribeOptions, SubscriptionCallback } from "./store/types.mjs";
|
|
61
|
+
import { ActionContext, ActionSubscriber, DefineStoreOptions, MutationType, Pinia, PiniaCustomProperties, PiniaCustomStateProperties, PiniaPlugin, PiniaPluginContext, StateTree, StoreActions, StoreDefinition, StoreGeneric, StoreManager, StoreState, StoreSubscribeOptions, SubscriptionCallback, SubscriptionCallbackMutation } from "./store/types.mjs";
|
|
62
62
|
import { defineStore } from "./store/define.mjs";
|
|
63
|
-
import { createStore } from "./store/manager.mjs";
|
|
63
|
+
import { createPinia, createStore, disposePinia, getActivePinia, setActivePinia } from "./store/manager.mjs";
|
|
64
64
|
import { StoreToRefsResult, storeToRefs } from "./store/storeToRefs.mjs";
|
|
65
65
|
import { version } from "./version.mjs";
|
|
66
66
|
import "./index.mjs";
|
|
@@ -83,5 +83,5 @@ export declare const Vue2: undefined;
|
|
|
83
83
|
*/
|
|
84
84
|
export declare function install(): void;
|
|
85
85
|
//#endregion
|
|
86
|
-
export { type ActionContext, type ActionSubscriber, type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type AsyncDerivation, type AsyncDerivationContext, type AsyncDerivationState, type AsyncDerivationStatus, type ComponentCustomProps, type ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComponentTypeEmits, type ComputedDefinitions, type ComputedGetter, type ComputedRef, type ComputedSetter, type CreateAppOptions, type CustomRefFactory, type CustomRefOptions, type CustomRefSource, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, type DefineComponentTypePropsOptions, type DefineComponentWithTypeProps, DefineModelModifiers, DefineModelTransformOptions, type DefineStoreOptions, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, type EffectScope, ElementIntersectionObserverCallback, type EmitFn, type EmitsOptions, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, type LayoutBridgeInstance, type LayoutHostBinding, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MaybeUndefined, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, ModelRef, type MultiWatchSources, type MutationKind, type MutationOp, type MutationRecord, type MutationType, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type OnCleanup, type PageFeatures, PageLayoutMeta, type PageLayoutState, PageMeta, PageStackSnapshot, type PrelinkReactiveTreeOptions, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type Ref, type RuntimeApp, type RuntimeInstance, type SetDataBindingDiagnostic, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextIntersectionObserver, type SetupContextIntersectionObserverOptions, type SetupContextNativeInstance, type SetupContextRouter, type SetupContextSelectorQuery, type SetupContextWithTypeProps, type SetupFunction, type SetupFunctionWithTypeProps, type ShallowRef, type ShallowUnwrapRef, type StoreManager, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, type TemplateRef, TemplateRefValue, TemplateRefs, type ToRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, type UseAsyncDerivationOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WatchCallback, type WatchEffect, type WatchEffectOptions, type WatchMultiSources, type WatchOptions, type WatchScheduler, type WatchSource, type WatchSourceValue, type WatchSources, type WatchStopHandle, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, type WevuComponentConstructor, type WevuDefaults, type WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, type WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, type WritableComputedOptions, type WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getNavigationBarMetrics, getReactiveVersion, hasInjectionContext, inject, injectGlobal, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncDerivation, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect, withDefaults };
|
|
86
|
+
export { type ActionContext, type ActionSubscriber, type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type AsyncDerivation, type AsyncDerivationContext, type AsyncDerivationState, type AsyncDerivationStatus, type ComponentCustomProps, type ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComponentTypeEmits, type ComputedDefinitions, type ComputedGetter, type ComputedRef, type ComputedSetter, type CreateAppOptions, type CustomRefFactory, type CustomRefOptions, type CustomRefSource, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, type DefineComponentTypePropsOptions, type DefineComponentWithTypeProps, DefineModelModifiers, DefineModelTransformOptions, type DefineStoreOptions, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, type EffectScope, ElementIntersectionObserverCallback, type EmitFn, type EmitsOptions, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, type LayoutBridgeInstance, type LayoutHostBinding, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MaybeUndefined, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, ModelRef, type MultiWatchSources, type MutationKind, type MutationOp, type MutationRecord, MutationType, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type OnCleanup, type PageFeatures, PageLayoutMeta, type PageLayoutState, PageMeta, PageStackSnapshot, type Pinia, type PiniaCustomProperties, type PiniaCustomStateProperties, type PiniaPlugin, type PiniaPluginContext, type PrelinkReactiveTreeOptions, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type Ref, type RuntimeApp, type RuntimeInstance, type SetDataBindingDiagnostic, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextIntersectionObserver, type SetupContextIntersectionObserverOptions, type SetupContextNativeInstance, type SetupContextRouter, type SetupContextSelectorQuery, type SetupContextWithTypeProps, type SetupFunction, type SetupFunctionWithTypeProps, type ShallowRef, type ShallowUnwrapRef, type StateTree, type StoreActions, type StoreDefinition, type StoreGeneric, type StoreManager, type StoreState, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, type SubscriptionCallbackMutation, type TemplateRef, TemplateRefValue, TemplateRefs, type ToRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, type UseAsyncDerivationOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WatchCallback, type WatchEffect, type WatchEffectOptions, type WatchMultiSources, type WatchOptions, type WatchScheduler, type WatchSource, type WatchSourceValue, type WatchSources, type WatchStopHandle, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, type WevuComponentConstructor, type WevuDefaults, type WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, type WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, type WritableComputedOptions, type WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createPinia, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, defineStore, disposePinia, effect, effectScope, endBatch, getActivePinia, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getNavigationBarMetrics, getReactiveVersion, hasInjectionContext, inject, injectGlobal, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setActivePinia, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncDerivation, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect, withDefaults };
|
|
87
87
|
//# sourceMappingURL=vue-demi.d.mts.map
|
package/dist/dev/vue-demi.mjs
CHANGED
|
@@ -41,7 +41,8 @@ import { useAttrs, useNativeInstance, useSlots } from "./runtime/vueCompat/conte
|
|
|
41
41
|
import { mergeModels, useBindModel, useChangeModel, useModel } from "./runtime/vueCompat/model.mjs";
|
|
42
42
|
import { useNativePageRouter, useNativeRouter } from "./runtime/vueCompat/router.mjs";
|
|
43
43
|
import { useTemplateRef } from "./runtime/vueCompat/templateRef.mjs";
|
|
44
|
-
import { createStore } from "./store/manager.mjs";
|
|
44
|
+
import { createPinia, createStore, disposePinia, getActivePinia, setActivePinia } from "./store/manager.mjs";
|
|
45
|
+
import { MutationType } from "./store/types.mjs";
|
|
45
46
|
import { defineStore } from "./store/define.mjs";
|
|
46
47
|
import { storeToRefs } from "./store/storeToRefs.mjs";
|
|
47
48
|
|
|
@@ -66,5 +67,5 @@ const Vue2 = void 0;
|
|
|
66
67
|
function install() {}
|
|
67
68
|
|
|
68
69
|
//#endregion
|
|
69
|
-
export { Vue2, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getNavigationBarMetrics, getReactiveVersion, hasInjectionContext, inject, injectGlobal, install, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, isVue2, isVue3, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncDerivation, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect };
|
|
70
|
+
export { MutationType, Vue2, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createPinia, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineStore, disposePinia, effect, effectScope, endBatch, getActivePinia, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getNavigationBarMetrics, getReactiveVersion, hasInjectionContext, inject, injectGlobal, install, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, isVue2, isVue3, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setActivePinia, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncDerivation, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect };
|
|
70
71
|
//# sourceMappingURL=vue-demi.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-demi.mjs","names":[],"sources":["../../src/vue-demi.ts"],"sourcesContent":["export * from './index'\nexport { version } from './version'\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue2 = false\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue3 = true\n\n/**\n * 与 `vue-demi` 保持一致,Vue 3 分支下不暴露 Vue 2 构造器。\n */\nexport const Vue2 = undefined\n\n/**\n * Vue 3 分支的 `vue-demi.install()` 为 no-op,这里保持同样语义。\n */\nexport function install() {}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vue-demi.mjs","names":[],"sources":["../../src/vue-demi.ts"],"sourcesContent":["export * from './index'\nexport { version } from './version'\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue2 = false\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue3 = true\n\n/**\n * 与 `vue-demi` 保持一致,Vue 3 分支下不暴露 Vue 2 构造器。\n */\nexport const Vue2 = undefined\n\n/**\n * Vue 3 分支的 `vue-demi.install()` 为 no-op,这里保持同样语义。\n */\nexport function install() {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAa,SAAS;;;;AAKtB,MAAa,SAAS;;;;AAKtB,MAAa,OAAO;;;;AAKpB,SAAgB,UAAU,CAAC"}
|
package/dist/index.d.mts
CHANGED
|
@@ -62,11 +62,11 @@ import { TemplateRef, useTemplateRef } from "./runtime/vueCompat/templateRef.mjs
|
|
|
62
62
|
import "./runtime/index.mjs";
|
|
63
63
|
import { ComponentTypeEmits, EmitFn, EmitsOptions } from "./macros/shared.mjs";
|
|
64
64
|
import { DefineModelModifiers, DefineModelTransformOptions, ModelRef, PageLayoutMeta, PageMeta, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, withDefaults } from "./macros.mjs";
|
|
65
|
-
import { ActionContext, ActionSubscriber, DefineStoreOptions, MutationType, StoreManager, StoreSubscribeOptions, SubscriptionCallback } from "./store/types.mjs";
|
|
65
|
+
import { ActionContext, ActionSubscriber, DefineStoreOptions, MutationType, Pinia, PiniaCustomProperties, PiniaCustomStateProperties, PiniaPlugin, PiniaPluginContext, StateTree, StoreActions, StoreDefinition, StoreGeneric, StoreManager, StoreState, StoreSubscribeOptions, SubscriptionCallback, SubscriptionCallbackMutation } from "./store/types.mjs";
|
|
66
66
|
import { defineStore } from "./store/define.mjs";
|
|
67
|
-
import { createStore } from "./store/manager.mjs";
|
|
67
|
+
import { createPinia, createStore, disposePinia, getActivePinia, setActivePinia } from "./store/manager.mjs";
|
|
68
68
|
import { StoreToRefsResult, storeToRefs } from "./store/storeToRefs.mjs";
|
|
69
69
|
import "./store.mjs";
|
|
70
70
|
import { version } from "./version.mjs";
|
|
71
71
|
export * from "@wevu/web-apis";
|
|
72
|
-
export { type ActionContext, type ActionSubscriber, type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type AsyncDerivation, type AsyncDerivationContext, type AsyncDerivationState, type AsyncDerivationStatus, type ComponentCustomProps, type ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComponentTypeEmits, type ComputedDefinitions, type ComputedGetter, type ComputedRef, type ComputedSetter, type CreateAppOptions, type CustomRefFactory, type CustomRefOptions, type CustomRefSource, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, type DefineComponentTypePropsOptions, type DefineComponentWithTypeProps, DefineModelModifiers, DefineModelTransformOptions, type DefineStoreOptions, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, type EffectScope, ElementIntersectionObserverCallback, type EmitFn, type EmitsOptions, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, type LayoutBridgeInstance, type LayoutHostBinding, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MaybeUndefined, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, ModelRef, type MultiWatchSources, type MutationKind, type MutationOp, type MutationRecord, type MutationType, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type OnCleanup, type PageFeatures, PageLayoutMeta, type PageLayoutState, PageMeta, PageStackSnapshot, type PrelinkReactiveTreeOptions, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type Ref, type RuntimeApp, type RuntimeInstance, type SetDataBindingDiagnostic, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextIntersectionObserver, type SetupContextIntersectionObserverOptions, type SetupContextNativeInstance, type SetupContextRouter, type SetupContextSelectorQuery, type SetupContextWithTypeProps, type SetupFunction, type SetupFunctionWithTypeProps, type ShallowRef, type ShallowUnwrapRef, type StoreManager, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, type TemplateRef, TemplateRefValue, TemplateRefs, type ToRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, type UseAsyncDerivationOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WatchCallback, type WatchEffect, type WatchEffectOptions, type WatchMultiSources, type WatchOptions, type WatchScheduler, type WatchSource, type WatchSourceValue, type WatchSources, type WatchStopHandle, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, type WevuComponentConstructor, type WevuDefaults, type WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, type WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, type WritableComputedOptions, type WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getNavigationBarMetrics, getReactiveVersion, hasInjectionContext, inject, injectGlobal, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncDerivation, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect, withDefaults };
|
|
72
|
+
export { type ActionContext, type ActionSubscriber, type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type AsyncDerivation, type AsyncDerivationContext, type AsyncDerivationState, type AsyncDerivationStatus, type ComponentCustomProps, type ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComponentTypeEmits, type ComputedDefinitions, type ComputedGetter, type ComputedRef, type ComputedSetter, type CreateAppOptions, type CustomRefFactory, type CustomRefOptions, type CustomRefSource, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, type DefineComponentTypePropsOptions, type DefineComponentWithTypeProps, DefineModelModifiers, DefineModelTransformOptions, type DefineStoreOptions, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, type EffectScope, ElementIntersectionObserverCallback, type EmitFn, type EmitsOptions, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, type LayoutBridgeInstance, type LayoutHostBinding, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MaybeUndefined, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, ModelRef, type MultiWatchSources, type MutationKind, type MutationOp, type MutationRecord, MutationType, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type OnCleanup, type PageFeatures, PageLayoutMeta, type PageLayoutState, PageMeta, PageStackSnapshot, type Pinia, type PiniaCustomProperties, type PiniaCustomStateProperties, type PiniaPlugin, type PiniaPluginContext, type PrelinkReactiveTreeOptions, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type Ref, type RuntimeApp, type RuntimeInstance, type SetDataBindingDiagnostic, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextIntersectionObserver, type SetupContextIntersectionObserverOptions, type SetupContextNativeInstance, type SetupContextRouter, type SetupContextSelectorQuery, type SetupContextWithTypeProps, type SetupFunction, type SetupFunctionWithTypeProps, type ShallowRef, type ShallowUnwrapRef, type StateTree, type StoreActions, type StoreDefinition, type StoreGeneric, type StoreManager, type StoreState, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, type SubscriptionCallbackMutation, type TemplateRef, TemplateRefValue, TemplateRefs, type ToRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, type UseAsyncDerivationOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WatchCallback, type WatchEffect, type WatchEffectOptions, type WatchMultiSources, type WatchOptions, type WatchScheduler, type WatchSource, type WatchSourceValue, type WatchSources, type WatchStopHandle, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, type WevuComponentConstructor, type WevuDefaults, type WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, type WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, type WritableComputedOptions, type WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createPinia, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, defineStore, disposePinia, effect, effectScope, endBatch, getActivePinia, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getNavigationBarMetrics, getReactiveVersion, hasInjectionContext, inject, injectGlobal, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setActivePinia, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncDerivation, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect, withDefaults };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{nextTick as e}from"./scheduler.mjs";import{batch as t,effect as n,effectScope as r,endBatch as i,getCurrentScope as a,onScopeDispose as o,startBatch as s,stop as c}from"./reactivity/core.mjs";import{addMutationRecorder as l,removeMutationRecorder as u}from"./reactivity/reactive/mutation.mjs";import{toRaw as d}from"./reactivity/reactive/shared.mjs";import{prelinkReactiveTree as f,touchReactive as p}from"./reactivity/reactive/patch.mjs";import{isShallowReactive as m,shallowReactive as h}from"./reactivity/reactive/shallow.mjs";import{getReactiveVersion as g,isRaw as _,isReactive as v,markRaw as y,reactive as b}from"./reactivity/reactive.mjs";import{customRef as x,isRef as S,ref as C,toValue as w,unref as T}from"./reactivity/ref.mjs";import{isProxy as E,isReadonly as D,readonly as O,shallowReadonly as k}from"./reactivity/readonly.mjs";import{useAsyncDerivation as A}from"./reactivity/asyncDerivation.mjs";import{computed as j}from"./reactivity/computed.mjs";import{isShallowRef as M,shallowRef as N,triggerRef as P}from"./reactivity/shallowRef.mjs";import{toRef as F,toRefs as I}from"./reactivity/toRefs.mjs";import{traverse as L}from"./reactivity/traverse.mjs";import{callHookList as R,callHookReturn as z,getCurrentInstance as B,getCurrentSetupContext as V,setCurrentInstance as H,setCurrentSetupContext as U}from"./runtime/hooks/base.mjs";import{onAddToFavorites as W,onAttached as G,onDetached as K,onError as q,onHide as J,onLaunch as Y,onLoad as X,onMemoryWarning as Z,onMoved as Q,onPageNotFound as $,onPageScroll as ee,onPullDownRefresh as te,onReachBottom as ne,onReady as re,onResize as ie,onRouteDone as ae,onSaveExitState as oe,onShareAppMessage as se,onShareTimeline as ce,onShow as le,onTabItemTap as ue,onThemeChange as de,onUnhandledRejection as fe,onUnload as pe}from"./runtime/hooks/register.mjs";import{callUpdateHooks as me,onActivated as he,onBeforeMount as ge,onBeforeUnmount as _e,onBeforeUpdate as ve,onDeactivated as ye,onErrorCaptured as be,onMounted as xe,onServerPrefetch as Se,onUnmounted as Ce,onUpdated as we}from"./runtime/hooks/vue.mjs";import{getDeepWatchStrategy as Te,setDeepWatchStrategy as Ee}from"./reactivity/watch/types.mjs";import{watch as De,watchEffect as Oe,watchPostEffect as ke,watchSyncEffect as Ae}from"./reactivity/watch.mjs";import{useCssModule as je}from"./runtime/css.mjs";import{resetWevuDefaults as Me}from"./runtime/defaults.mjs";import{useDisposables as Ne}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as Pe}from"./runtime/elementIntersectionObserver.mjs";import{isNoSetData as Fe,markNoSetData as Ie}from"./runtime/noSetData.mjs";import{registerPageLayoutBridge as Le,registerRuntimeLayoutHosts as Re,resolveLayoutBridge as ze,resolveLayoutHost as Be,resolveRuntimePageLayoutName as Ve,setPageLayout as He,syncRuntimePageLayoutState as Ue,syncRuntimePageLayoutStateFromRuntime as We,unregisterPageLayoutBridge as Ge,unregisterRuntimeLayoutHosts as Ke,useLayoutBridge as qe,useLayoutHosts as Je,usePageLayout as Ye,waitForLayoutHost as Xe}from"./runtime/features/publicLayout.mjs";import{useIntersectionObserver as Ze}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as Qe,getNavigationBarMetrics as $e,useNavigationBarMetrics as et,usePageStack as tt}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as nt}from"./runtime/pageScroll.mjs";import{setGlobalProvidedValue as rt}from"./runtime/provideStore.mjs";import{hasInjectionContext as it,inject as at,injectGlobal as ot,provide as st,provideGlobal as ct}from"./runtime/provide.mjs";import{version as lt}from"./version.mjs";import{runSetupFunction as ut}from"./runtime/register/setup.mjs";import{setRuntimeSetDataVisibility as dt,teardownRuntimeInstance as ft}from"./runtime/register/runtimeInstance.mjs";import{createApp as pt,createWevuComponent as mt,createWevuScopedSlotComponent as ht,defineComponent as gt,mountRuntimeInstance as _t,registerApp as vt,registerComponent as yt,setWevuDefaults as bt}from"./runtime/publicRuntime.mjs";import{useAsyncPullDownRefresh as xt}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as St,useScrollOffset as Ct,useSelectorFields as wt,useSelectorQuery as Tt}from"./runtime/selectorQuery.mjs";import{normalizeClass as Et,normalizeStyle as Dt,resolvePropValue as Ot}from"./runtime/template.mjs";import{useUpdatePerformanceListener as kt}from"./runtime/updatePerformance.mjs";import{defineAppSetup as At,use as jt}from"./runtime/use.mjs";import{useAttrs as Mt,useNativeInstance as Nt,useSlots as Pt}from"./runtime/vueCompat/context.mjs";import{mergeModels as Ft,useBindModel as It,useChangeModel as Lt,useModel as Rt}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as zt,useNativeRouter as Bt}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as Vt}from"./runtime/vueCompat/templateRef.mjs";import{createStore as
|
|
1
|
+
import{nextTick as e}from"./scheduler.mjs";import{batch as t,effect as n,effectScope as r,endBatch as i,getCurrentScope as a,onScopeDispose as o,startBatch as s,stop as c}from"./reactivity/core.mjs";import{addMutationRecorder as l,removeMutationRecorder as u}from"./reactivity/reactive/mutation.mjs";import{toRaw as d}from"./reactivity/reactive/shared.mjs";import{prelinkReactiveTree as f,touchReactive as p}from"./reactivity/reactive/patch.mjs";import{isShallowReactive as m,shallowReactive as h}from"./reactivity/reactive/shallow.mjs";import{getReactiveVersion as g,isRaw as _,isReactive as v,markRaw as y,reactive as b}from"./reactivity/reactive.mjs";import{customRef as x,isRef as S,ref as C,toValue as w,unref as T}from"./reactivity/ref.mjs";import{isProxy as E,isReadonly as D,readonly as O,shallowReadonly as k}from"./reactivity/readonly.mjs";import{useAsyncDerivation as A}from"./reactivity/asyncDerivation.mjs";import{computed as j}from"./reactivity/computed.mjs";import{isShallowRef as M,shallowRef as N,triggerRef as P}from"./reactivity/shallowRef.mjs";import{toRef as F,toRefs as I}from"./reactivity/toRefs.mjs";import{traverse as L}from"./reactivity/traverse.mjs";import{callHookList as R,callHookReturn as z,getCurrentInstance as B,getCurrentSetupContext as V,setCurrentInstance as H,setCurrentSetupContext as U}from"./runtime/hooks/base.mjs";import{onAddToFavorites as W,onAttached as G,onDetached as K,onError as q,onHide as J,onLaunch as Y,onLoad as X,onMemoryWarning as Z,onMoved as Q,onPageNotFound as $,onPageScroll as ee,onPullDownRefresh as te,onReachBottom as ne,onReady as re,onResize as ie,onRouteDone as ae,onSaveExitState as oe,onShareAppMessage as se,onShareTimeline as ce,onShow as le,onTabItemTap as ue,onThemeChange as de,onUnhandledRejection as fe,onUnload as pe}from"./runtime/hooks/register.mjs";import{callUpdateHooks as me,onActivated as he,onBeforeMount as ge,onBeforeUnmount as _e,onBeforeUpdate as ve,onDeactivated as ye,onErrorCaptured as be,onMounted as xe,onServerPrefetch as Se,onUnmounted as Ce,onUpdated as we}from"./runtime/hooks/vue.mjs";import{getDeepWatchStrategy as Te,setDeepWatchStrategy as Ee}from"./reactivity/watch/types.mjs";import{watch as De,watchEffect as Oe,watchPostEffect as ke,watchSyncEffect as Ae}from"./reactivity/watch.mjs";import{useCssModule as je}from"./runtime/css.mjs";import{resetWevuDefaults as Me}from"./runtime/defaults.mjs";import{useDisposables as Ne}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as Pe}from"./runtime/elementIntersectionObserver.mjs";import{isNoSetData as Fe,markNoSetData as Ie}from"./runtime/noSetData.mjs";import{registerPageLayoutBridge as Le,registerRuntimeLayoutHosts as Re,resolveLayoutBridge as ze,resolveLayoutHost as Be,resolveRuntimePageLayoutName as Ve,setPageLayout as He,syncRuntimePageLayoutState as Ue,syncRuntimePageLayoutStateFromRuntime as We,unregisterPageLayoutBridge as Ge,unregisterRuntimeLayoutHosts as Ke,useLayoutBridge as qe,useLayoutHosts as Je,usePageLayout as Ye,waitForLayoutHost as Xe}from"./runtime/features/publicLayout.mjs";import{useIntersectionObserver as Ze}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as Qe,getNavigationBarMetrics as $e,useNavigationBarMetrics as et,usePageStack as tt}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as nt}from"./runtime/pageScroll.mjs";import{setGlobalProvidedValue as rt}from"./runtime/provideStore.mjs";import{hasInjectionContext as it,inject as at,injectGlobal as ot,provide as st,provideGlobal as ct}from"./runtime/provide.mjs";import{version as lt}from"./version.mjs";import{runSetupFunction as ut}from"./runtime/register/setup.mjs";import{setRuntimeSetDataVisibility as dt,teardownRuntimeInstance as ft}from"./runtime/register/runtimeInstance.mjs";import{createApp as pt,createWevuComponent as mt,createWevuScopedSlotComponent as ht,defineComponent as gt,mountRuntimeInstance as _t,registerApp as vt,registerComponent as yt,setWevuDefaults as bt}from"./runtime/publicRuntime.mjs";import{useAsyncPullDownRefresh as xt}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as St,useScrollOffset as Ct,useSelectorFields as wt,useSelectorQuery as Tt}from"./runtime/selectorQuery.mjs";import{normalizeClass as Et,normalizeStyle as Dt,resolvePropValue as Ot}from"./runtime/template.mjs";import{useUpdatePerformanceListener as kt}from"./runtime/updatePerformance.mjs";import{defineAppSetup as At,use as jt}from"./runtime/use.mjs";import{useAttrs as Mt,useNativeInstance as Nt,useSlots as Pt}from"./runtime/vueCompat/context.mjs";import{mergeModels as Ft,useBindModel as It,useChangeModel as Lt,useModel as Rt}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as zt,useNativeRouter as Bt}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as Vt}from"./runtime/vueCompat/templateRef.mjs";import{createPinia as Ht,createStore as Ut,disposePinia as Wt,getActivePinia as Gt,setActivePinia as Kt}from"./store/manager.mjs";import{MutationType as qt}from"./store/types.mjs";import{defineStore as Jt}from"./store/define.mjs";import{storeToRefs as Yt}from"./store/storeToRefs.mjs";export*from"@wevu/web-apis";export{qt as MutationType,l as addMutationRecorder,t as batch,R as callHookList,z as callHookReturn,me as callUpdateHooks,j as computed,pt as createApp,Ht as createPinia,Ut as createStore,mt as createWevuComponent,ht as createWevuScopedSlotComponent,x as customRef,At as defineAppSetup,gt as defineComponent,Jt as defineStore,Wt as disposePinia,n as effect,r as effectScope,i as endBatch,Gt as getActivePinia,B as getCurrentInstance,Qe as getCurrentPageStackSnapshot,a as getCurrentScope,V as getCurrentSetupContext,Te as getDeepWatchStrategy,$e as getNavigationBarMetrics,g as getReactiveVersion,it as hasInjectionContext,at as inject,ot as injectGlobal,Fe as isNoSetData,E as isProxy,_ as isRaw,v as isReactive,D as isReadonly,S as isRef,m as isShallowReactive,M as isShallowRef,Ie as markNoSetData,y as markRaw,Ft as mergeModels,_t as mountRuntimeInstance,e as nextTick,Et as normalizeClass,Dt as normalizeStyle,he as onActivated,W as onAddToFavorites,G as onAttached,ge as onBeforeMount,_e as onBeforeUnmount,ve as onBeforeUpdate,ye as onDeactivated,K as onDetached,q as onError,be as onErrorCaptured,J as onHide,Y as onLaunch,X as onLoad,Z as onMemoryWarning,xe as onMounted,Q as onMoved,$ as onPageNotFound,ee as onPageScroll,te as onPullDownRefresh,ne as onReachBottom,re as onReady,ie as onResize,ae as onRouteDone,oe as onSaveExitState,o as onScopeDispose,Se as onServerPrefetch,se as onShareAppMessage,ce as onShareTimeline,le as onShow,ue as onTabItemTap,de as onThemeChange,fe as onUnhandledRejection,pe as onUnload,Ce as onUnmounted,we as onUpdated,f as prelinkReactiveTree,st as provide,ct as provideGlobal,b as reactive,O as readonly,C as ref,vt as registerApp,yt as registerComponent,Le as registerPageLayoutBridge,Re as registerRuntimeLayoutHosts,u as removeMutationRecorder,Me as resetWevuDefaults,ze as resolveLayoutBridge,Be as resolveLayoutHost,Ot as resolvePropValue,Ve as resolveRuntimePageLayoutName,ut as runSetupFunction,Kt as setActivePinia,H as setCurrentInstance,U as setCurrentSetupContext,Ee as setDeepWatchStrategy,rt as setGlobalProvidedValue,He as setPageLayout,dt as setRuntimeSetDataVisibility,bt as setWevuDefaults,h as shallowReactive,k as shallowReadonly,N as shallowRef,s as startBatch,c as stop,Yt as storeToRefs,Ue as syncRuntimePageLayoutState,We as syncRuntimePageLayoutStateFromRuntime,ft as teardownRuntimeInstance,d as toRaw,F as toRef,I as toRefs,w as toValue,p as touchReactive,L as traverse,P as triggerRef,T as unref,Ge as unregisterPageLayoutBridge,Ke as unregisterRuntimeLayoutHosts,jt as use,A as useAsyncDerivation,xt as useAsyncPullDownRefresh,Mt as useAttrs,It as useBindModel,St as useBoundingClientRect,Lt as useChangeModel,je as useCssModule,Ne as useDisposables,Pe as useElementIntersectionObserver,Ze as useIntersectionObserver,qe as useLayoutBridge,Je as useLayoutHosts,Rt as useModel,Nt as useNativeInstance,zt as useNativePageRouter,Bt as useNativeRouter,et as useNavigationBarMetrics,Ye as usePageLayout,nt as usePageScrollThrottle,tt as usePageStack,Ct as useScrollOffset,wt as useSelectorFields,Tt as useSelectorQuery,Pt as useSlots,Vt as useTemplateRef,kt as useUpdatePerformanceListener,lt as version,Xe as waitForLayoutHost,De as watch,Oe as watchEffect,ke as watchPostEffect,Ae as watchSyncEffect};
|
package/dist/package.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`7.
|
|
1
|
+
var e=`7.2.0`;export{e as version};
|
|
@@ -2,13 +2,17 @@ import { Ref } from "./ref.mjs";
|
|
|
2
2
|
//#region src/reactivity/computed.d.ts
|
|
3
3
|
export type ComputedGetter<T> = () => T;
|
|
4
4
|
export type ComputedSetter<T> = (value: T) => void;
|
|
5
|
+
declare const computedBrand: unique symbol;
|
|
6
|
+
declare const writableComputedBrand: unique symbol;
|
|
5
7
|
interface BaseComputedRef<T, S = T> extends Ref<T, S> {
|
|
6
8
|
[key: symbol]: any;
|
|
7
9
|
}
|
|
8
10
|
export interface ComputedRef<T = any> extends BaseComputedRef<T> {
|
|
11
|
+
readonly [computedBrand]: true;
|
|
9
12
|
readonly value: T;
|
|
10
13
|
}
|
|
11
14
|
export interface WritableComputedRef<T, S = T> extends BaseComputedRef<T, S> {
|
|
15
|
+
readonly [writableComputedBrand]: true;
|
|
12
16
|
value: T;
|
|
13
17
|
}
|
|
14
18
|
export interface WritableComputedOptions<T> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createComputedEffect as e,track as t,trigger as n}from"./core.mjs";import{
|
|
1
|
+
import{createComputedEffect as e,track as t,trigger as n}from"./core.mjs";import{markRaw as r}from"./reactive.mjs";import{markAsRef as i}from"./ref.mjs";const a=/* @__PURE__ */ new WeakSet;function o(e){return typeof e==`object`&&!!e&&a.has(e)}function s(o){let s,c,l=typeof o==`function`;l?(s=o,c=()=>{throw Error(`计算属性是只读的`)}):(s=o.get,c=o.set);let u,d=!0,f,p={get value(){return d&&(u=f(),d=!1),t(p,`value`),u},set value(e){c(e)}};return i(p),r(p),a.add(p),Object.defineProperty(p,"__r_isReadonly",{value:l}),f=e(s,{lazy:!0,scheduler:()=>{d||(d=!0,n(p,`value`))}}),p}export{s as computed,o as isComputedRef};
|