wevu 6.16.1 → 6.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/api.mjs +1 -2
- package/dist/chunk-CbfVNrr-.mjs +1 -0
- package/dist/compiler.mjs +1 -2
- package/dist/dev/api.mjs +3 -0
- package/dist/dev/compiler.mjs +3 -0
- package/dist/dev/fetch.mjs +3 -0
- package/dist/dev/index.mjs +8 -0
- package/dist/dev/jsx-runtime.mjs +1 -0
- package/dist/{ref-DuEgaxvT.mjs → dev/ref-BTTXccLL.mjs} +15 -0
- package/dist/dev/ref-BTTXccLL.mjs.map +1 -0
- package/dist/{router-Ck6g5XK5.mjs → dev/router-BZZnIx32.mjs} +14 -1
- package/dist/dev/router-BZZnIx32.mjs.map +1 -0
- package/dist/dev/router.mjs +1267 -0
- package/dist/dev/router.mjs.map +1 -0
- package/dist/{src-Bncvw6p2.mjs → dev/src-DjDCQerj.mjs} +348 -6
- package/dist/dev/src-DjDCQerj.mjs.map +1 -0
- package/dist/{store-BhbWIoTi.mjs → dev/store-Dr0zE_9B.mjs} +13 -1
- package/dist/dev/store-Dr0zE_9B.mjs.map +1 -0
- package/dist/dev/store.mjs +3 -0
- package/dist/dev/vue-demi.mjs +184 -0
- package/dist/dev/vue-demi.mjs.map +1 -0
- package/dist/dev/web-apis.mjs +5 -0
- package/dist/fetch.mjs +1 -2
- package/dist/{index-6sv3KnLP.d.mts → index-BKnpWfa6.d.mts} +132 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -6
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/ref-Bs--7iY3.mjs +1 -0
- package/dist/router-BtpVtHM4.mjs +1 -0
- package/dist/router.mjs +1 -1248
- package/dist/src-D9uUICz0.mjs +1 -0
- package/dist/store-B63-EIon.mjs +1 -0
- package/dist/store.mjs +1 -2
- package/dist/vue-demi.d.mts +3 -3
- package/dist/vue-demi.mjs +1 -24
- package/dist/web-apis.mjs +1 -3
- package/package.json +74 -2
- package/dist/chunk-D1SwGrFN.mjs +0 -27
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { A as track, C as effect, d as reactive, g as touchReactive, j as trigger, l as isReactive, n as isRef, r as markAsRef, w as effectScope, y as toRaw } from "./ref-
|
|
1
|
+
import { A as track, C as effect, d as reactive, g as touchReactive, j as trigger, l as isReactive, n as isRef, r as markAsRef, w as effectScope, y as toRaw } from "./ref-BTTXccLL.mjs";
|
|
2
|
+
|
|
2
3
|
//#region src/reactivity/computed.ts
|
|
3
4
|
function computed(getterOrOptions) {
|
|
4
5
|
let getter;
|
|
@@ -41,6 +42,7 @@ function computed(getterOrOptions) {
|
|
|
41
42
|
});
|
|
42
43
|
return onlyGetter ? obj : obj;
|
|
43
44
|
}
|
|
45
|
+
|
|
44
46
|
//#endregion
|
|
45
47
|
//#region src/store/actions.ts
|
|
46
48
|
function wrapAction(store, name, action, actionSubs) {
|
|
@@ -78,6 +80,7 @@ function wrapAction(store, name, action, actionSubs) {
|
|
|
78
80
|
return finalize(res);
|
|
79
81
|
};
|
|
80
82
|
}
|
|
83
|
+
|
|
81
84
|
//#endregion
|
|
82
85
|
//#region src/store/utils.ts
|
|
83
86
|
function isObject(val) {
|
|
@@ -124,6 +127,7 @@ function resetObject(target, snapshot) {
|
|
|
124
127
|
target[key] = cloneDeep(snapValue);
|
|
125
128
|
}
|
|
126
129
|
}
|
|
130
|
+
|
|
127
131
|
//#endregion
|
|
128
132
|
//#region src/store/base.ts
|
|
129
133
|
function createBaseApi(id, stateObj, notify, resetImpl) {
|
|
@@ -175,6 +179,7 @@ function createBaseApi(id, stateObj, notify, resetImpl) {
|
|
|
175
179
|
actionSubs
|
|
176
180
|
};
|
|
177
181
|
}
|
|
182
|
+
|
|
178
183
|
//#endregion
|
|
179
184
|
//#region src/store/define/shared.ts
|
|
180
185
|
const hasOwn = Object.prototype.hasOwnProperty;
|
|
@@ -206,6 +211,7 @@ function createSafeNotifier(storeId, subs, getState) {
|
|
|
206
211
|
}
|
|
207
212
|
};
|
|
208
213
|
}
|
|
214
|
+
|
|
209
215
|
//#endregion
|
|
210
216
|
//#region src/store/define/optionsStyle.ts
|
|
211
217
|
function createOptionsStyleStore(id, options, manager) {
|
|
@@ -315,6 +321,7 @@ function createOptionsStyleStore(id, options, manager) {
|
|
|
315
321
|
} catch (_unused) {}
|
|
316
322
|
return store;
|
|
317
323
|
}
|
|
324
|
+
|
|
318
325
|
//#endregion
|
|
319
326
|
//#region src/store/define/setupStyle.ts
|
|
320
327
|
function createSetupStyleStore(id, setupFactory, manager) {
|
|
@@ -446,6 +453,7 @@ function createSetupStyleStore(id, setupFactory, manager) {
|
|
|
446
453
|
} catch (_unused) {}
|
|
447
454
|
return instance;
|
|
448
455
|
}
|
|
456
|
+
|
|
449
457
|
//#endregion
|
|
450
458
|
//#region src/store/manager.ts
|
|
451
459
|
/**
|
|
@@ -464,6 +472,7 @@ function createStore() {
|
|
|
464
472
|
createStore._instance = manager;
|
|
465
473
|
return manager;
|
|
466
474
|
}
|
|
475
|
+
|
|
467
476
|
//#endregion
|
|
468
477
|
//#region src/store/define.ts
|
|
469
478
|
function defineStore(id, setupOrOptions) {
|
|
@@ -479,6 +488,7 @@ function defineStore(id, setupOrOptions) {
|
|
|
479
488
|
return instance;
|
|
480
489
|
};
|
|
481
490
|
}
|
|
491
|
+
|
|
482
492
|
//#endregion
|
|
483
493
|
//#region src/store/storeToRefs.ts
|
|
484
494
|
/**
|
|
@@ -502,5 +512,7 @@ function storeToRefs(store) {
|
|
|
502
512
|
}
|
|
503
513
|
return result;
|
|
504
514
|
}
|
|
515
|
+
|
|
505
516
|
//#endregion
|
|
506
517
|
export { computed as i, defineStore as n, createStore as r, storeToRefs as t };
|
|
518
|
+
//# sourceMappingURL=store-Dr0zE_9B.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-Dr0zE_9B.mjs","names":[],"sources":["../../src/reactivity/computed.ts","../../src/store/actions.ts","../../src/store/utils.ts","../../src/store/base.ts","../../src/store/define/shared.ts","../../src/store/define/optionsStyle.ts","../../src/store/define/setupStyle.ts","../../src/store/manager.ts","../../src/store/define.ts","../../src/store/storeToRefs.ts"],"sourcesContent":["import type { ReactiveEffect } from './core'\nimport type { Ref } from './ref'\nimport { effect, track, trigger } from './core'\nimport { markAsRef } from './ref'\n\nexport type ComputedGetter<T> = () => T\nexport type ComputedSetter<T> = (value: T) => void\n\ninterface BaseComputedRef<T, S = T> extends Ref<T, S> {\n [key: symbol]: any\n}\n\nexport interface ComputedRef<T = any> extends BaseComputedRef<T> {\n readonly value: T\n}\n\nexport interface WritableComputedRef<T, S = T> extends BaseComputedRef<T, S> {\n value: T\n}\n\nexport interface WritableComputedOptions<T> {\n get: ComputedGetter<T>\n set: ComputedSetter<T>\n}\n\nexport function computed<T>(getter: ComputedGetter<T>): ComputedRef<T>\nexport function computed<T>(options: WritableComputedOptions<T>): WritableComputedRef<T>\nexport function computed<T>(\n getterOrOptions: ComputedGetter<T> | WritableComputedOptions<T>,\n): ComputedRef<T> | WritableComputedRef<T> {\n let getter: ComputedGetter<T>\n let setter: ComputedSetter<T>\n const onlyGetter = typeof getterOrOptions === 'function'\n if (onlyGetter) {\n getter = getterOrOptions as ComputedGetter<T>\n setter = () => {\n throw new Error('计算属性是只读的')\n }\n }\n else {\n getter = (getterOrOptions as WritableComputedOptions<T>).get\n setter = (getterOrOptions as WritableComputedOptions<T>).set\n }\n let value: T\n let dirty = true\n let runner: ReactiveEffect<T>\n const obj: any = {\n get value() {\n if (dirty) {\n value = runner()\n dirty = false\n }\n track(obj, 'value')\n return value\n },\n set value(newValue: T) {\n setter(newValue)\n },\n }\n markAsRef(obj)\n runner = effect(getter, {\n lazy: true,\n scheduler: () => {\n if (!dirty) {\n dirty = true\n trigger(obj, 'value')\n }\n },\n })\n return (onlyGetter ? obj as ComputedRef<T> : obj as WritableComputedRef<T>)\n}\n","import type { ActionSubscriber } from './types'\n\nexport function wrapAction<TStore extends Record<string, any>>(\n store: TStore,\n name: string,\n action: (...args: any[]) => any,\n actionSubs: Set<ActionSubscriber<TStore>>,\n) {\n return function wrapped(this: any, ...args: any[]) {\n const afterCbs: Array<(r: any) => void> = []\n const errorCbs: Array<(e: any) => void> = []\n const after = (cb: (r: any) => void) => afterCbs.push(cb)\n const onError = (cb: (e: any) => void) => errorCbs.push(cb)\n actionSubs.forEach((sub) => {\n try {\n sub({ name, store, args, after, onError })\n }\n catch {\n // 捕获订阅者回调内部的异常,避免单个监听器出错影响其他订阅和原始 action 执行链\n }\n })\n let res: any\n try {\n res = action.apply(store, args)\n }\n catch (e) {\n errorCbs.forEach(cb => cb(e))\n throw e\n }\n const finalize = (r: any) => {\n afterCbs.forEach(cb => cb(r))\n return r\n }\n if (res && typeof (res as Promise<any>).then === 'function') {\n return (res as Promise<any>).then(\n r => finalize(r),\n (e) => {\n errorCbs.forEach(cb => cb(e))\n return Promise.reject(e)\n },\n )\n }\n return finalize(res)\n }\n}\n","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\nexport function mergeShallow(target: Record<string, any>, patch: Record<string, any>) {\n for (const k in patch) {\n target[k] = patch[k]\n }\n}\n\nexport function cloneDeep<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map(item => cloneDeep(item)) as T\n }\n if (isPlainObject(value)) {\n const result: Record<string, any> = {}\n for (const key in value) {\n result[key] = cloneDeep((value as any)[key])\n }\n return result as T\n }\n return value\n}\n\nexport function resetObject(target: Record<string, any>, snapshot: Record<string, any> | any[]) {\n if (Array.isArray(target) && Array.isArray(snapshot)) {\n target.length = 0\n snapshot.forEach((item, index) => {\n target[index] = cloneDeep(item)\n })\n return\n }\n if (!isObject(snapshot)) {\n return\n }\n for (const key in target) {\n if (!(key in snapshot)) {\n delete target[key]\n }\n }\n for (const key in snapshot) {\n const snapValue = (snapshot as any)[key]\n const currentValue = target[key]\n if (Array.isArray(snapValue) && Array.isArray(currentValue)) {\n resetObject(currentValue, snapValue)\n continue\n }\n if (isPlainObject(snapValue) && isPlainObject(currentValue)) {\n resetObject(currentValue, snapValue)\n continue\n }\n target[key] = cloneDeep(snapValue)\n }\n}\n","import type { ActionSubscriber, MutationType, SubscriptionCallback } from './types'\nimport { isObject, mergeShallow } from './utils'\n\nexport function createBaseApi<S extends Record<string, any>>(\n id: string,\n stateObj: S | undefined,\n notify: (type: MutationType) => void,\n resetImpl?: () => void,\n) {\n const api: any = {\n $id: id,\n }\n Object.defineProperty(api, '$state', {\n get() {\n return stateObj\n },\n set(v: any) {\n if (stateObj && isObject(v)) {\n mergeShallow(stateObj, v)\n notify('patch object')\n }\n },\n })\n api.$patch = (patch: Record<string, any> | ((state: S) => void)) => {\n if (!stateObj) {\n if (typeof patch === 'function') {\n patch(api as S)\n notify('patch function')\n }\n else {\n mergeShallow(api as any, patch)\n notify('patch object')\n }\n return\n }\n if (typeof patch === 'function') {\n patch(stateObj)\n notify('patch function')\n }\n else {\n mergeShallow(stateObj, patch)\n notify('patch object')\n }\n }\n if (resetImpl) {\n api.$reset = () => resetImpl()\n }\n const subs = new Set<SubscriptionCallback<S>>()\n api.$subscribe = (cb: SubscriptionCallback<S>, _opts?: { detached?: boolean }) => {\n subs.add(cb)\n return () => subs.delete(cb)\n }\n const actionSubs = new Set<ActionSubscriber<any>>()\n api.$onAction = (cb: ActionSubscriber<any>) => {\n actionSubs.add(cb)\n return () => actionSubs.delete(cb)\n }\n return { api, subs, actionSubs }\n}\n","import type { MutationType, SubscriptionCallback } from '../types'\nimport { isReactive, isRef, toRaw } from '../../reactivity'\nimport { cloneDeep } from '../utils'\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\nexport function isTrackableRef(value: unknown) {\n return isRef(value) && hasOwn.call(value, 'dep')\n}\n\nexport function snapshotValue(value: unknown) {\n if (isReactive(value)) {\n return cloneDeep(toRaw(value as any))\n }\n if (isTrackableRef(value)) {\n return cloneDeep((value as any).value)\n }\n return cloneDeep(value)\n}\n\nexport function createSafeNotifier<S>(\n storeId: string,\n subs: Set<SubscriptionCallback<S>>,\n getState: () => S,\n) {\n let notifying = false\n return (type: MutationType) => {\n if (notifying) {\n return\n }\n notifying = true\n try {\n const state = getState()\n subs.forEach((cb) => {\n try {\n cb({ type, storeId }, state)\n }\n catch {}\n })\n }\n finally {\n notifying = false\n }\n }\n}\n","import { computed, effect, reactive, toRaw, touchReactive } from '../../reactivity'\nimport { wrapAction } from '../actions'\nimport { createBaseApi } from '../base'\nimport { cloneDeep, resetObject } from '../utils'\nimport { createSafeNotifier } from './shared'\n\nexport function createOptionsStyleStore(id: string, options: any, manager: any) {\n const rawState = options.state ? options.state() : {}\n const state = reactive(rawState)\n const initialSnapshot = cloneDeep(toRaw(rawState))\n let notify: (type: any) => void = () => {}\n const base = createBaseApi<typeof state>(id, state, t => notify(t), () => {\n resetObject(state as any, initialSnapshot)\n notify('patch object')\n })\n\n let isPatching = false\n const rawPatch = base.api.$patch\n base.api.$patch = (patch: Partial<typeof state> | ((nextState: typeof state) => void)) => {\n isPatching = true\n try {\n rawPatch(patch as any)\n }\n finally {\n isPatching = false\n }\n }\n if (typeof base.api.$reset === 'function') {\n const rawReset = base.api.$reset\n base.api.$reset = () => {\n isPatching = true\n try {\n rawReset()\n }\n finally {\n isPatching = false\n }\n }\n }\n\n notify = createSafeNotifier(id, base.subs, () => state as any)\n\n const store: Record<string, any> = {}\n for (const key of Object.getOwnPropertyNames(base.api)) {\n const d = Object.getOwnPropertyDescriptor(base.api, key)\n if (d) {\n if (key === '$state') {\n Object.defineProperty(store, key, {\n enumerable: d.enumerable,\n configurable: d.configurable,\n get() {\n return (base.api as any).$state\n },\n set(v: any) {\n isPatching = true\n try {\n ;(base.api as any).$state = v\n }\n finally {\n isPatching = false\n }\n },\n })\n }\n else {\n Object.defineProperty(store, key, d)\n }\n }\n }\n\n const getterDefs = options.getters ?? {}\n Object.keys(getterDefs).forEach((key) => {\n const getter = (getterDefs as any)[key]\n if (typeof getter === 'function') {\n const c = computed(() => getter.call(store, state))\n Object.defineProperty(store, key, {\n enumerable: true,\n configurable: true,\n get() {\n return c.value\n },\n })\n }\n })\n\n const actionDefs = options.actions ?? {}\n Object.keys(actionDefs).forEach((key) => {\n const act = (actionDefs as any)[key]\n if (typeof act === 'function') {\n const wrapped = wrapAction(store as any, key, (...args: any[]) => {\n return act.apply(store as any, args)\n }, base.actionSubs)\n store[key] = wrapped\n }\n })\n\n Object.keys(state).forEach((k) => {\n Object.defineProperty(store, k, {\n enumerable: true,\n configurable: true,\n get() {\n return (state as any)[k]\n },\n set(v: any) {\n ;(state as any)[k] = v\n },\n })\n })\n\n let initialized = false\n let dispatchingDirect = false\n effect(() => {\n touchReactive(state)\n if (!initialized) {\n initialized = true\n return\n }\n if (isPatching || dispatchingDirect) {\n return\n }\n dispatchingDirect = true\n try {\n notify('direct')\n }\n finally {\n dispatchingDirect = false\n }\n })\n\n const plugins = manager?._plugins ?? []\n for (const plugin of plugins) {\n try {\n plugin({ store })\n }\n catch {}\n }\n\n return store\n}\n","import { effect, isReactive, isRef, touchReactive } from '../../reactivity'\nimport { wrapAction } from '../actions'\nimport { createBaseApi } from '../base'\nimport { cloneDeep, resetObject } from '../utils'\nimport { createSafeNotifier, isTrackableRef, snapshotValue } from './shared'\n\nexport function createSetupStyleStore(id: string, setupFactory: () => Record<string, any>, manager: any) {\n const result = setupFactory()\n let notify: (type: any) => void = () => {}\n const initialSnapshot = new Map<string, any>()\n Object.keys(result).forEach((k) => {\n const val = (result as any)[k]\n if (typeof val === 'function' || k.startsWith('$')) {\n return\n }\n if (isRef(val) && !isTrackableRef(val)) {\n return\n }\n initialSnapshot.set(k, snapshotValue(val))\n })\n\n let instance: Record<string, any> = {}\n const resetImpl = () => {\n initialSnapshot.forEach((snapValue, key) => {\n const current = (instance as any)[key]\n if (isTrackableRef(current)) {\n current.value = cloneDeep(snapValue)\n return\n }\n if (isReactive(current)) {\n resetObject(current as any, snapValue)\n return\n }\n if (isRef(current)) {\n return\n }\n ;(instance as any)[key] = cloneDeep(snapValue)\n })\n notify('patch object')\n }\n\n const base = createBaseApi<any>(id, undefined, t => notify(t), resetImpl)\n let isPatching = false\n const rawPatch = base.api.$patch\n base.api.$patch = (patch: Record<string, any> | ((state: any) => void)) => {\n isPatching = true\n try {\n rawPatch(patch)\n }\n finally {\n isPatching = false\n }\n }\n if (typeof base.api.$reset === 'function') {\n const rawReset = base.api.$reset\n base.api.$reset = () => {\n isPatching = true\n try {\n rawReset()\n }\n finally {\n isPatching = false\n }\n }\n }\n\n instance = { ...result }\n notify = createSafeNotifier(id, base.subs, () => instance)\n\n // 将 setup 返回值与基础 API 合并,同时保留每个 getter/setter 的描述符,避免覆写访问器行为\n for (const key of Object.getOwnPropertyNames(base.api)) {\n const d = Object.getOwnPropertyDescriptor(base.api, key)\n if (d) {\n if (key === '$state') {\n Object.defineProperty(instance, key, {\n enumerable: d.enumerable,\n configurable: d.configurable,\n get() {\n return (base.api as any).$state\n },\n set(v: any) {\n isPatching = true\n try {\n ;(base.api as any).$state = v\n }\n finally {\n isPatching = false\n }\n },\n })\n }\n else {\n Object.defineProperty(instance, key, d)\n }\n }\n }\n\n const directSources: any[] = []\n Object.keys(result).forEach((k) => {\n const val = (result as any)[k]\n if (typeof val === 'function' && !k.startsWith('$')) {\n ;(instance as any)[k] = wrapAction(instance, k, val, base.actionSubs)\n return\n }\n if (isTrackableRef(val)) {\n directSources.push(val)\n return\n }\n if (isReactive(val)) {\n directSources.push(val)\n return\n }\n if (isRef(val)) {\n return\n }\n if (!k.startsWith('$')) {\n let innerValue = val\n Object.defineProperty(instance, k, {\n enumerable: true,\n configurable: true,\n get() {\n return innerValue\n },\n set(next: any) {\n innerValue = next\n if (!isPatching) {\n notify('direct')\n }\n },\n })\n }\n })\n\n let dispatchingDirect = false\n if (directSources.length > 0) {\n let initialized = false\n effect(() => {\n directSources.forEach((source) => {\n if (isTrackableRef(source)) {\n void source.value\n }\n else {\n touchReactive(source)\n }\n })\n if (!initialized) {\n initialized = true\n return\n }\n if (isPatching || dispatchingDirect) {\n return\n }\n dispatchingDirect = true\n try {\n notify('direct')\n }\n finally {\n dispatchingDirect = false\n }\n })\n }\n\n const plugins = manager?._plugins ?? []\n for (const plugin of plugins) {\n try {\n plugin({ store: instance })\n }\n catch {}\n }\n\n return instance\n}\n","import type { StoreManager } from './types'\n\n/**\n * @description 创建 store 管理器(插件与共享实例入口)\n */\nexport function createStore(): StoreManager {\n const manager: StoreManager = {\n _stores: new Map(),\n _plugins: [],\n install(_app: any) {\n // 小程序场景不需要注册全局插件入口,这里保留 API 但不执行任何操作\n },\n use(plugin: (context: { store: any }) => void) {\n if (typeof plugin === 'function') {\n manager._plugins.push(plugin)\n }\n return manager\n },\n }\n ;(createStore as any)._instance = manager\n return manager\n}\n","import type {\n ActionSubscriber,\n DefineStoreOptions,\n StoreGetters,\n StoreManager,\n StoreSubscribeOptions,\n SubscriptionCallback,\n} from './types'\nimport { effectScope } from '../reactivity'\nimport { createOptionsStyleStore } from './define/optionsStyle'\nimport { createSetupStyleStore } from './define/setupStyle'\nimport { createStore } from './manager'\n\ntype SetupDefinition<T> = () => T\n\n/**\n * @description 定义一个 setup 风格的 store\n */\nexport function defineStore<T extends Record<string, any>>(id: string, setup: SetupDefinition<T>): () => T & {\n $id: string\n $patch: (patch: Record<string, any> | ((state: any) => void)) => void\n $reset: () => void\n $subscribe: (cb: SubscriptionCallback<any>, opts?: StoreSubscribeOptions) => () => void\n $onAction: (cb: ActionSubscriber<any>) => () => void\n}\n/**\n * @description 定义一个 options 风格的 store\n */\nexport function defineStore<S extends Record<string, any>, G extends Record<string, any>, A extends Record<string, any>>(\n id: string,\n options: DefineStoreOptions<S, G, A>,\n): () => S & StoreGetters<G> & A & {\n $id: string\n $state: S\n $patch: (patch: Partial<S> | ((state: S) => void)) => void\n $reset: () => void\n $subscribe: (cb: SubscriptionCallback<S>, opts?: StoreSubscribeOptions) => () => void\n $onAction: (cb: ActionSubscriber<S & StoreGetters<G> & A>) => () => void\n}\nexport function defineStore(id: string, setupOrOptions: any) {\n let instance: any\n let created = false\n const manager = (createStore as any)._instance as StoreManager | undefined\n\n return function useStore(): any {\n if (created && instance) {\n return instance\n }\n created = true\n\n const storeScope = effectScope(true)\n instance = storeScope.run(() => {\n return typeof setupOrOptions === 'function'\n ? createSetupStyleStore(id, setupOrOptions, manager)\n : createOptionsStyleStore(id, setupOrOptions as DefineStoreOptions<any, any, any>, manager)\n })\n\n return instance\n }\n}\n","import type { Ref } from '../reactivity'\nimport { computed, isRef } from '../reactivity'\n\n/**\n * @description storeToRefs 返回类型推导\n */\nexport type StoreToRefsResult<T extends Record<string, any>> = {\n [K in keyof T]:\n T[K] extends (...args: any[]) => any\n ? T[K]\n : T[K] extends Ref<infer V>\n ? Ref<V>\n : Ref<T[K]>\n}\n\n/**\n * @description 将 store 状态转换为 Ref\n */\nexport function storeToRefs<T extends Record<string, any>>(store: T): StoreToRefsResult<T> {\n const result: Record<string, any> = {}\n for (const key in store) {\n const value = (store as any)[key]\n if (typeof value === 'function') {\n result[key] = value\n continue\n }\n if (isRef(value)) {\n result[key] = value\n }\n else {\n result[key] = computed({\n get: () => (store as any)[key],\n set: (v: any) => {\n ;(store as any)[key] = v\n },\n })\n }\n }\n return result as StoreToRefsResult<T>\n}\n"],"mappings":";;;AA2BA,SAAgB,SACd,iBACyC;CACzC,IAAI;CACJ,IAAI;CACJ,MAAM,aAAa,OAAO,oBAAoB;AAC9C,KAAI,YAAY;AACd,WAAS;AACT,iBAAe;AACb,SAAM,IAAI,MAAM,WAAW;;QAG1B;AACH,WAAU,gBAA+C;AACzD,WAAU,gBAA+C;;CAE3D,IAAI;CACJ,IAAI,QAAQ;CACZ,IAAI;CACJ,MAAM,MAAW;EACf,IAAI,QAAQ;AACV,OAAI,OAAO;AACT,YAAQ,QAAQ;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AAET,YAAU;AAGV,aADmB,YAAY,KACV,CAAC,UAAU;AAC9B,UAAO,OAAO,mBAAmB,aAC7B,sBAAsB,IAAI,gBAAgB,QAAQ,GAClD,wBAAwB,IAAI,gBAAqD,QAAQ;IAC7F;AAEF,SAAO;;;;;;;;;ACvCX,SAAgB,YAA2C,OAAgC;CACzF,MAAM,SAA8B,EAAE;AACtC,MAAK,MAAM,OAAO,OAAO;EACvB,MAAM,QAAS,MAAc;AAC7B,MAAI,OAAO,UAAU,YAAY;AAC/B,UAAO,OAAO;AACd;;AAEF,MAAI,MAAM,MAAM,CACd,QAAO,OAAO;MAGd,QAAO,OAAO,SAAS;GACrB,WAAY,MAAc;GAC1B,MAAM,MAAW;AACd,IAAC,MAAc,OAAO;;GAE1B,CAAC;;AAGN,QAAO"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { $ as isNoSetData, A as createApp, B as waitForLayoutHost, C as usePageStack, Ct as shallowRef, D as createWevuComponent, E as useDisposables, Et as __reExport, F as resolveLayoutHost, G as runSetupFunction, H as mountRuntimeInstance, I as unregisterPageLayoutBridge, J as syncRuntimePageLayoutState, K as resolveRuntimePageLayoutName, L as unregisterRuntimeLayoutHosts, M as registerPageLayoutBridge, N as registerRuntimeLayoutHosts, O as createWevuScopedSlotComponent, P as resolveLayoutBridge, Q as setWevuDefaults, R as useLayoutBridge, S as useNavigationBarMetrics, St as isShallowRef, T as useElementIntersectionObserver, Tt as __exportAll, U as setRuntimeSetDataVisibility, V as registerApp, W as teardownRuntimeInstance, X as usePageLayout, Y as syncRuntimePageLayoutStateFromRuntime, Z as resetWevuDefaults, _ as useSelectorQuery, _t as onUnmounted, a as useModel, at as watchSyncEffect, b as getCurrentPageStackSnapshot, bt as toRef, c as useSlots, ct as callUpdateHooks, d as useUpdatePerformanceListener, dt as onBeforeUnmount, et as markNoSetData, f as normalizeClass, ft as onBeforeUpdate, g as useSelectorFields, gt as onServerPrefetch, h as useScrollOffset, ht as onMounted, i as useChangeModel, it as watchPostEffect, j as registerComponent, k as defineComponent, l as defineAppSetup, lt as onActivated, m as useBoundingClientRect, mt as onErrorCaptured, n as mergeModels, nt as watch, o as useAttrs, ot as getDeepWatchStrategy, p as normalizeStyle, pt as onDeactivated, q as setPageLayout, r as useBindModel, rt as watchEffect, s as useNativeInstance, st as setDeepWatchStrategy, t as useTemplateRef, tt as version, u as use, ut as onBeforeMount, v as useAsyncPullDownRefresh, vt as onUpdated, w as useIntersectionObserver, wt as triggerRef, x as getNavigationBarMetrics, xt as toRefs, y as usePageScrollThrottle, yt as traverse, z as useLayoutHosts } from "./src-DjDCQerj.mjs";
|
|
2
|
+
import { C as effect, D as onScopeDispose, E as getCurrentScope, N as nextTick, O as startBatch, S as batch, T as endBatch, a as toValue, b as addMutationRecorder, c as isRaw, d as reactive, f as isShallowReactive, g as touchReactive, h as prelinkReactiveTree, i as ref, k as stop, l as isReactive, n as isRef, o as unref, p as shallowReactive, s as getReactiveVersion, t as customRef, u as markRaw, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-BTTXccLL.mjs";
|
|
3
|
+
import { i as computed, n as defineStore, r as createStore, t as storeToRefs } from "./store-Dr0zE_9B.mjs";
|
|
4
|
+
import { A as onLoad, B as onSaveExitState, C as setGlobalProvidedValue, D as onError, E as onDetached, F as onPullDownRefresh, G as onThemeChange, H as onShareTimeline, I as onReachBottom, K as onUnhandledRejection, L as onReady, M as onMoved, N as onPageNotFound, O as onHide, P as onPageScroll, Q as getCurrentSetupContext, R as onResize, T as onAttached, U as onShow, V as onShareAppMessage, W as onTabItemTap, X as callHookReturn, Y as callHookList, Z as getCurrentInstance, _ as provide, ct as isProxy, dt as shallowReadonly, et as setCurrentInstance, g as injectGlobal, h as inject, j as onMemoryWarning, k as onLaunch, lt as isReadonly, m as hasInjectionContext, n as useNativeRouter, q as onUnload, t as useNativePageRouter, tt as setCurrentSetupContext, ut as readonly, v as provideGlobal, w as onAddToFavorites, z as onRouteDone } from "./router-BZZnIx32.mjs";
|
|
5
|
+
|
|
6
|
+
export * from "@wevu/web-apis"
|
|
7
|
+
|
|
8
|
+
//#region src/vue-demi.ts
|
|
9
|
+
var vue_demi_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Vue2: () => void 0,
|
|
11
|
+
addMutationRecorder: () => addMutationRecorder,
|
|
12
|
+
batch: () => batch,
|
|
13
|
+
callHookList: () => callHookList,
|
|
14
|
+
callHookReturn: () => callHookReturn,
|
|
15
|
+
callUpdateHooks: () => callUpdateHooks,
|
|
16
|
+
computed: () => computed,
|
|
17
|
+
createApp: () => createApp,
|
|
18
|
+
createStore: () => createStore,
|
|
19
|
+
createWevuComponent: () => createWevuComponent,
|
|
20
|
+
createWevuScopedSlotComponent: () => createWevuScopedSlotComponent,
|
|
21
|
+
customRef: () => customRef,
|
|
22
|
+
defineAppSetup: () => defineAppSetup,
|
|
23
|
+
defineComponent: () => defineComponent,
|
|
24
|
+
defineStore: () => defineStore,
|
|
25
|
+
effect: () => effect,
|
|
26
|
+
effectScope: () => effectScope,
|
|
27
|
+
endBatch: () => endBatch,
|
|
28
|
+
getCurrentInstance: () => getCurrentInstance,
|
|
29
|
+
getCurrentPageStackSnapshot: () => getCurrentPageStackSnapshot,
|
|
30
|
+
getCurrentScope: () => getCurrentScope,
|
|
31
|
+
getCurrentSetupContext: () => getCurrentSetupContext,
|
|
32
|
+
getDeepWatchStrategy: () => getDeepWatchStrategy,
|
|
33
|
+
getNavigationBarMetrics: () => getNavigationBarMetrics,
|
|
34
|
+
getReactiveVersion: () => getReactiveVersion,
|
|
35
|
+
hasInjectionContext: () => hasInjectionContext,
|
|
36
|
+
inject: () => inject,
|
|
37
|
+
injectGlobal: () => injectGlobal,
|
|
38
|
+
install: () => install,
|
|
39
|
+
isNoSetData: () => isNoSetData,
|
|
40
|
+
isProxy: () => isProxy,
|
|
41
|
+
isRaw: () => isRaw,
|
|
42
|
+
isReactive: () => isReactive,
|
|
43
|
+
isReadonly: () => isReadonly,
|
|
44
|
+
isRef: () => isRef,
|
|
45
|
+
isShallowReactive: () => isShallowReactive,
|
|
46
|
+
isShallowRef: () => isShallowRef,
|
|
47
|
+
isVue2: () => false,
|
|
48
|
+
isVue3: () => true,
|
|
49
|
+
markNoSetData: () => markNoSetData,
|
|
50
|
+
markRaw: () => markRaw,
|
|
51
|
+
mergeModels: () => mergeModels,
|
|
52
|
+
mountRuntimeInstance: () => mountRuntimeInstance,
|
|
53
|
+
nextTick: () => nextTick,
|
|
54
|
+
normalizeClass: () => normalizeClass,
|
|
55
|
+
normalizeStyle: () => normalizeStyle,
|
|
56
|
+
onActivated: () => onActivated,
|
|
57
|
+
onAddToFavorites: () => onAddToFavorites,
|
|
58
|
+
onAttached: () => onAttached,
|
|
59
|
+
onBeforeMount: () => onBeforeMount,
|
|
60
|
+
onBeforeUnmount: () => onBeforeUnmount,
|
|
61
|
+
onBeforeUpdate: () => onBeforeUpdate,
|
|
62
|
+
onDeactivated: () => onDeactivated,
|
|
63
|
+
onDetached: () => onDetached,
|
|
64
|
+
onError: () => onError,
|
|
65
|
+
onErrorCaptured: () => onErrorCaptured,
|
|
66
|
+
onHide: () => onHide,
|
|
67
|
+
onLaunch: () => onLaunch,
|
|
68
|
+
onLoad: () => onLoad,
|
|
69
|
+
onMemoryWarning: () => onMemoryWarning,
|
|
70
|
+
onMounted: () => onMounted,
|
|
71
|
+
onMoved: () => onMoved,
|
|
72
|
+
onPageNotFound: () => onPageNotFound,
|
|
73
|
+
onPageScroll: () => onPageScroll,
|
|
74
|
+
onPullDownRefresh: () => onPullDownRefresh,
|
|
75
|
+
onReachBottom: () => onReachBottom,
|
|
76
|
+
onReady: () => onReady,
|
|
77
|
+
onResize: () => onResize,
|
|
78
|
+
onRouteDone: () => onRouteDone,
|
|
79
|
+
onSaveExitState: () => onSaveExitState,
|
|
80
|
+
onScopeDispose: () => onScopeDispose,
|
|
81
|
+
onServerPrefetch: () => onServerPrefetch,
|
|
82
|
+
onShareAppMessage: () => onShareAppMessage,
|
|
83
|
+
onShareTimeline: () => onShareTimeline,
|
|
84
|
+
onShow: () => onShow,
|
|
85
|
+
onTabItemTap: () => onTabItemTap,
|
|
86
|
+
onThemeChange: () => onThemeChange,
|
|
87
|
+
onUnhandledRejection: () => onUnhandledRejection,
|
|
88
|
+
onUnload: () => onUnload,
|
|
89
|
+
onUnmounted: () => onUnmounted,
|
|
90
|
+
onUpdated: () => onUpdated,
|
|
91
|
+
prelinkReactiveTree: () => prelinkReactiveTree,
|
|
92
|
+
provide: () => provide,
|
|
93
|
+
provideGlobal: () => provideGlobal,
|
|
94
|
+
reactive: () => reactive,
|
|
95
|
+
readonly: () => readonly,
|
|
96
|
+
ref: () => ref,
|
|
97
|
+
registerApp: () => registerApp,
|
|
98
|
+
registerComponent: () => registerComponent,
|
|
99
|
+
registerPageLayoutBridge: () => registerPageLayoutBridge,
|
|
100
|
+
registerRuntimeLayoutHosts: () => registerRuntimeLayoutHosts,
|
|
101
|
+
removeMutationRecorder: () => removeMutationRecorder,
|
|
102
|
+
resetWevuDefaults: () => resetWevuDefaults,
|
|
103
|
+
resolveLayoutBridge: () => resolveLayoutBridge,
|
|
104
|
+
resolveLayoutHost: () => resolveLayoutHost,
|
|
105
|
+
resolveRuntimePageLayoutName: () => resolveRuntimePageLayoutName,
|
|
106
|
+
runSetupFunction: () => runSetupFunction,
|
|
107
|
+
setCurrentInstance: () => setCurrentInstance,
|
|
108
|
+
setCurrentSetupContext: () => setCurrentSetupContext,
|
|
109
|
+
setDeepWatchStrategy: () => setDeepWatchStrategy,
|
|
110
|
+
setGlobalProvidedValue: () => setGlobalProvidedValue,
|
|
111
|
+
setPageLayout: () => setPageLayout,
|
|
112
|
+
setRuntimeSetDataVisibility: () => setRuntimeSetDataVisibility,
|
|
113
|
+
setWevuDefaults: () => setWevuDefaults,
|
|
114
|
+
shallowReactive: () => shallowReactive,
|
|
115
|
+
shallowReadonly: () => shallowReadonly,
|
|
116
|
+
shallowRef: () => shallowRef,
|
|
117
|
+
startBatch: () => startBatch,
|
|
118
|
+
stop: () => stop,
|
|
119
|
+
storeToRefs: () => storeToRefs,
|
|
120
|
+
syncRuntimePageLayoutState: () => syncRuntimePageLayoutState,
|
|
121
|
+
syncRuntimePageLayoutStateFromRuntime: () => syncRuntimePageLayoutStateFromRuntime,
|
|
122
|
+
teardownRuntimeInstance: () => teardownRuntimeInstance,
|
|
123
|
+
toRaw: () => toRaw,
|
|
124
|
+
toRef: () => toRef,
|
|
125
|
+
toRefs: () => toRefs,
|
|
126
|
+
toValue: () => toValue,
|
|
127
|
+
touchReactive: () => touchReactive,
|
|
128
|
+
traverse: () => traverse,
|
|
129
|
+
triggerRef: () => triggerRef,
|
|
130
|
+
unref: () => unref,
|
|
131
|
+
unregisterPageLayoutBridge: () => unregisterPageLayoutBridge,
|
|
132
|
+
unregisterRuntimeLayoutHosts: () => unregisterRuntimeLayoutHosts,
|
|
133
|
+
use: () => use,
|
|
134
|
+
useAsyncPullDownRefresh: () => useAsyncPullDownRefresh,
|
|
135
|
+
useAttrs: () => useAttrs,
|
|
136
|
+
useBindModel: () => useBindModel,
|
|
137
|
+
useBoundingClientRect: () => useBoundingClientRect,
|
|
138
|
+
useChangeModel: () => useChangeModel,
|
|
139
|
+
useDisposables: () => useDisposables,
|
|
140
|
+
useElementIntersectionObserver: () => useElementIntersectionObserver,
|
|
141
|
+
useIntersectionObserver: () => useIntersectionObserver,
|
|
142
|
+
useLayoutBridge: () => useLayoutBridge,
|
|
143
|
+
useLayoutHosts: () => useLayoutHosts,
|
|
144
|
+
useModel: () => useModel,
|
|
145
|
+
useNativeInstance: () => useNativeInstance,
|
|
146
|
+
useNativePageRouter: () => useNativePageRouter,
|
|
147
|
+
useNativeRouter: () => useNativeRouter,
|
|
148
|
+
useNavigationBarMetrics: () => useNavigationBarMetrics,
|
|
149
|
+
usePageLayout: () => usePageLayout,
|
|
150
|
+
usePageScrollThrottle: () => usePageScrollThrottle,
|
|
151
|
+
usePageStack: () => usePageStack,
|
|
152
|
+
useScrollOffset: () => useScrollOffset,
|
|
153
|
+
useSelectorFields: () => useSelectorFields,
|
|
154
|
+
useSelectorQuery: () => useSelectorQuery,
|
|
155
|
+
useSlots: () => useSlots,
|
|
156
|
+
useTemplateRef: () => useTemplateRef,
|
|
157
|
+
useUpdatePerformanceListener: () => useUpdatePerformanceListener,
|
|
158
|
+
version: () => version,
|
|
159
|
+
waitForLayoutHost: () => waitForLayoutHost,
|
|
160
|
+
watch: () => watch,
|
|
161
|
+
watchEffect: () => watchEffect,
|
|
162
|
+
watchPostEffect: () => watchPostEffect,
|
|
163
|
+
watchSyncEffect: () => watchSyncEffect
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* 标记当前兼容层运行在 Vue 3 风格分支。
|
|
167
|
+
*/
|
|
168
|
+
const isVue2 = false;
|
|
169
|
+
/**
|
|
170
|
+
* 标记当前兼容层运行在 Vue 3 风格分支。
|
|
171
|
+
*/
|
|
172
|
+
const isVue3 = true;
|
|
173
|
+
/**
|
|
174
|
+
* 与 `vue-demi` 保持一致,Vue 3 分支下不暴露 Vue 2 构造器。
|
|
175
|
+
*/
|
|
176
|
+
const Vue2 = void 0;
|
|
177
|
+
/**
|
|
178
|
+
* Vue 3 分支的 `vue-demi.install()` 为 no-op,这里保持同样语义。
|
|
179
|
+
*/
|
|
180
|
+
function install() {}
|
|
181
|
+
|
|
182
|
+
//#endregion
|
|
183
|
+
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, 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, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, 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 };
|
|
184
|
+
//# sourceMappingURL=vue-demi.mjs.map
|
|
@@ -0,0 +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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAa,SAAS;;;;AAKtB,MAAa,SAAS;;;;AAKtB,MAAa,OAAO;;;;AAKpB,SAAgB,UAAU"}
|
package/dist/fetch.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { fetch };
|
|
1
|
+
import{fetch as e}from"@wevu/web-apis/fetch";export{e as fetch};
|
|
@@ -472,6 +472,26 @@ interface DisposableBag {
|
|
|
472
472
|
*/
|
|
473
473
|
declare function useDisposables(): DisposableBag;
|
|
474
474
|
//#endregion
|
|
475
|
+
//#region src/runtime/elementIntersectionObserver.d.ts
|
|
476
|
+
type ElementIntersectionObserverCallback<T = unknown> = (result: T) => void;
|
|
477
|
+
interface UseElementIntersectionObserverOptions<T = unknown> {
|
|
478
|
+
context?: InternalRuntimeState | null;
|
|
479
|
+
enabled?: MaybeRefOrGetter<boolean>;
|
|
480
|
+
observerOptions?: MaybeRefOrGetter<HostMiniProgramIntersectionObserverOptions>;
|
|
481
|
+
onObserve?: ElementIntersectionObserverCallback<T>;
|
|
482
|
+
relativeToViewport?: boolean | Record<string, number>;
|
|
483
|
+
selector: MaybeRefOrGetter<string | null | undefined>;
|
|
484
|
+
}
|
|
485
|
+
interface UseElementIntersectionObserverReturn {
|
|
486
|
+
disconnect: () => void;
|
|
487
|
+
observe: () => HostMiniProgramIntersectionObserver | null;
|
|
488
|
+
readonly observer: HostMiniProgramIntersectionObserver | null;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* 观察当前组件或页面内的节点可见性,并在卸载时自动断开。
|
|
492
|
+
*/
|
|
493
|
+
declare function useElementIntersectionObserver<T = unknown>(options: UseElementIntersectionObserverOptions<T>): UseElementIntersectionObserverReturn;
|
|
494
|
+
//#endregion
|
|
475
495
|
//#region src/runtime/hooks/base.d.ts
|
|
476
496
|
declare function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined;
|
|
477
497
|
/**
|
|
@@ -646,6 +666,52 @@ declare function useLayoutHosts(hosts: LayoutHostMap): void;
|
|
|
646
666
|
declare function markNoSetData<T extends object>(value: T): T;
|
|
647
667
|
declare function isNoSetData(value: unknown): boolean;
|
|
648
668
|
//#endregion
|
|
669
|
+
//#region src/runtime/pageEnvironment.d.ts
|
|
670
|
+
interface PageStackSnapshot {
|
|
671
|
+
canGoBack: boolean;
|
|
672
|
+
currentRoute: string;
|
|
673
|
+
stackLength: number;
|
|
674
|
+
}
|
|
675
|
+
interface UsePageStackOptions {
|
|
676
|
+
autoRefresh?: boolean;
|
|
677
|
+
}
|
|
678
|
+
interface NavigationBarMetrics {
|
|
679
|
+
navigationBarHeight: number;
|
|
680
|
+
navigationHeight: number;
|
|
681
|
+
statusBarHeight: number;
|
|
682
|
+
}
|
|
683
|
+
interface UseNavigationBarMetricsOptions {
|
|
684
|
+
autoRefresh?: boolean;
|
|
685
|
+
defaultNavigationBarHeight?: number;
|
|
686
|
+
defaultStatusBarHeight?: number;
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* 获取当前小程序页面栈的稳定快照。
|
|
690
|
+
*/
|
|
691
|
+
declare function getCurrentPageStackSnapshot(): PageStackSnapshot;
|
|
692
|
+
/**
|
|
693
|
+
* 在 setup 中跟踪当前小程序页面栈状态。
|
|
694
|
+
*/
|
|
695
|
+
declare function usePageStack(options?: UsePageStackOptions): {
|
|
696
|
+
canGoBack: ComputedRef<boolean>;
|
|
697
|
+
currentRoute: Ref<string, string>;
|
|
698
|
+
refresh: () => void;
|
|
699
|
+
stackLength: Ref<number, number>;
|
|
700
|
+
};
|
|
701
|
+
/**
|
|
702
|
+
* 计算自定义导航栏所需的状态栏和胶囊占位高度。
|
|
703
|
+
*/
|
|
704
|
+
declare function getNavigationBarMetrics(options?: Omit<UseNavigationBarMetricsOptions, 'autoRefresh'>): NavigationBarMetrics;
|
|
705
|
+
/**
|
|
706
|
+
* 在 setup 中跟踪自定义导航栏尺寸。
|
|
707
|
+
*/
|
|
708
|
+
declare function useNavigationBarMetrics(options?: UseNavigationBarMetricsOptions): {
|
|
709
|
+
navigationBarHeight: Ref<number, number>;
|
|
710
|
+
navigationHeight: ComputedRef<number>;
|
|
711
|
+
refresh: () => void;
|
|
712
|
+
statusBarHeight: Ref<number, number>;
|
|
713
|
+
};
|
|
714
|
+
//#endregion
|
|
649
715
|
//#region src/runtime/pageLayout.d.ts
|
|
650
716
|
interface WevuPageLayoutMap {}
|
|
651
717
|
type ResolveTypedPageLayoutName = keyof WevuPageLayoutMap extends never ? string : Extract<keyof WevuPageLayoutMap, string>;
|
|
@@ -760,6 +826,17 @@ declare function provideGlobal<T>(key: any, value: T): void;
|
|
|
760
826
|
*/
|
|
761
827
|
declare function injectGlobal<T>(key: any, defaultValue?: T): T;
|
|
762
828
|
//#endregion
|
|
829
|
+
//#region src/runtime/pullDownRefresh.d.ts
|
|
830
|
+
type PullDownRefreshHandler = () => void | Promise<void>;
|
|
831
|
+
interface UseAsyncPullDownRefreshOptions {
|
|
832
|
+
onError?: (error: unknown) => void | Promise<void>;
|
|
833
|
+
stopPullDownRefresh?: () => unknown | Promise<unknown>;
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* 注册下拉刷新回调,并在回调结束后自动停止宿主下拉刷新状态。
|
|
837
|
+
*/
|
|
838
|
+
declare function useAsyncPullDownRefresh(refresh: PullDownRefreshHandler, options?: UseAsyncPullDownRefreshOptions): void;
|
|
839
|
+
//#endregion
|
|
763
840
|
//#region src/runtime/register/watch.d.ts
|
|
764
841
|
type WatchHandler = (this: any, value: any, oldValue: any) => void;
|
|
765
842
|
type WatchDescriptor = WatchHandler | string | {
|
|
@@ -809,6 +886,56 @@ type SetupRunner = {
|
|
|
809
886
|
*/
|
|
810
887
|
declare function runSetupFunction(setup: SetupRunner | undefined, props: Record<string, any>, context: any): unknown;
|
|
811
888
|
//#endregion
|
|
889
|
+
//#region src/runtime/selectorQuery.d.ts
|
|
890
|
+
interface UseSelectorQueryOptions {
|
|
891
|
+
context?: InternalRuntimeState | null;
|
|
892
|
+
}
|
|
893
|
+
interface UseBoundingClientRectOptions extends UseSelectorQueryOptions {
|
|
894
|
+
all?: boolean;
|
|
895
|
+
}
|
|
896
|
+
interface UseSelectorFieldsOptions extends UseSelectorQueryOptions {
|
|
897
|
+
all?: boolean;
|
|
898
|
+
fields: HostMiniProgramNodesRefFields;
|
|
899
|
+
}
|
|
900
|
+
interface UseScrollOffsetOptions extends UseSelectorQueryOptions {
|
|
901
|
+
all?: boolean;
|
|
902
|
+
}
|
|
903
|
+
interface UseAllBoundingClientRectOptions extends UseSelectorQueryOptions {
|
|
904
|
+
all: true;
|
|
905
|
+
}
|
|
906
|
+
interface UseAllSelectorFieldsOptions extends UseSelectorQueryOptions {
|
|
907
|
+
all: true;
|
|
908
|
+
fields: HostMiniProgramNodesRefFields;
|
|
909
|
+
}
|
|
910
|
+
interface UseAllScrollOffsetOptions extends UseSelectorQueryOptions {
|
|
911
|
+
all: true;
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* 创建绑定当前小程序实例的选择器查询工厂。
|
|
915
|
+
*/
|
|
916
|
+
declare function useSelectorQuery(options?: UseSelectorQueryOptions): () => HostMiniProgramSelectorQuery | null;
|
|
917
|
+
/**
|
|
918
|
+
* 创建绑定当前小程序实例的节点布局查询函数。
|
|
919
|
+
*/
|
|
920
|
+
declare function useBoundingClientRect(options?: UseBoundingClientRectOptions & {
|
|
921
|
+
all?: false;
|
|
922
|
+
}): (selector: string) => Promise<HostMiniProgramBoundingClientRectResult | null>;
|
|
923
|
+
declare function useBoundingClientRect(options: UseAllBoundingClientRectOptions): (selector: string) => Promise<HostMiniProgramBoundingClientRectResult[] | null>;
|
|
924
|
+
/**
|
|
925
|
+
* 创建绑定当前小程序实例的节点字段查询函数。
|
|
926
|
+
*/
|
|
927
|
+
declare function useSelectorFields(options: UseSelectorFieldsOptions & {
|
|
928
|
+
all?: false;
|
|
929
|
+
}): (selector: string) => Promise<Record<string, any> | null>;
|
|
930
|
+
declare function useSelectorFields(options: UseAllSelectorFieldsOptions): (selector: string) => Promise<Array<Record<string, any>> | null>;
|
|
931
|
+
/**
|
|
932
|
+
* 创建绑定当前小程序实例的滚动位置查询函数。
|
|
933
|
+
*/
|
|
934
|
+
declare function useScrollOffset(options?: UseScrollOffsetOptions & {
|
|
935
|
+
all?: false;
|
|
936
|
+
}): (selector: string) => Promise<HostMiniProgramScrollOffsetResult | null>;
|
|
937
|
+
declare function useScrollOffset(options: UseAllScrollOffsetOptions): (selector: string) => Promise<HostMiniProgramScrollOffsetResult[] | null>;
|
|
938
|
+
//#endregion
|
|
812
939
|
//#region src/runtime/template.d.ts
|
|
813
940
|
declare function normalizeStyle(value: any): string;
|
|
814
941
|
declare function normalizeClass(value: any): string;
|
|
@@ -859,6 +986,10 @@ type BindModelWithHelper<DefaultEvent extends string = 'input', DefaultValueProp
|
|
|
859
986
|
on: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => (event: any) => void;
|
|
860
987
|
};
|
|
861
988
|
declare function useBindModel<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'>(defaultOptions?: ModelBindingOptions<any, DefaultEvent, DefaultValueProp, any>): BindModelWithHelper<DefaultEvent, DefaultValueProp>;
|
|
989
|
+
/**
|
|
990
|
+
* useChangeModel 返回以 change 事件为默认更新事件的 model 绑定助手。
|
|
991
|
+
*/
|
|
992
|
+
declare function useChangeModel(): <T = any, ValueProp extends string = "value", Formatted = T>(path: string, options?: ModelBindingOptions<T, "change", ValueProp, Formatted>) => ModelBindingPayload<T, "change", ValueProp, Formatted>;
|
|
862
993
|
declare function mergeModels<T>(a: T, b: T): T;
|
|
863
994
|
//#endregion
|
|
864
995
|
//#region src/runtime/vueCompat/router.d.ts
|
|
@@ -1030,4 +1161,4 @@ declare function defineModel<T = any, M extends PropertyKey = string, G = T, S =
|
|
|
1030
1161
|
//#region src/version.d.ts
|
|
1031
1162
|
declare const version: string;
|
|
1032
1163
|
//#endregion
|
|
1033
|
-
export {
|
|
1164
|
+
export { teardownRuntimeInstance as $, setWevuDefaults as $n, onServerPrefetch as $t, useSlots as A, setCurrentInstance as An, markNoSetData as At, UseAllScrollOffsetOptions as B, useDisposables as Bn, useLayoutHosts as Bt, UseModelOptions as C, onThemeChange as Cn, UseNavigationBarMetricsOptions as Ct, useModel as D, callHookReturn as Dn, useNavigationBarMetrics as Dt, useChangeModel as E, callHookList as En, getNavigationBarMetrics as Et, UseUpdatePerformanceListenerStopHandle as F, useElementIntersectionObserver as Fn, resolveLayoutBridge as Ft, UseSelectorQueryOptions as G, SetupFunctionWithTypeProps as Gn, callUpdateHooks as Gt, UseBoundingClientRectOptions as H, DefineComponentTypePropsOptions as Hn, UseIntersectionObserverOptions as Ht, useUpdatePerformanceListener as I, DisposableBag as In, resolveLayoutHost as It, useSelectorFields as J, createWevuComponent as Jn, onBeforeUnmount as Jt, useBoundingClientRect as K, WevuComponentConstructor as Kn, onActivated as Kt, normalizeClass as L, DisposableLike as Ln, unregisterPageLayoutBridge as Lt, use as M, ElementIntersectionObserverCallback as Mn, LayoutHostBinding as Mt, UpdatePerformanceListener as N, UseElementIntersectionObserverOptions as Nn, registerPageLayoutBridge as Nt, useAttrs as O, getCurrentInstance as On, usePageStack as Ot, UpdatePerformanceListenerResult as P, UseElementIntersectionObserverReturn as Pn, registerRuntimeLayoutHosts as Pt, setRuntimeSetDataVisibility as Q, resetWevuDefaults as Qn, onMounted as Qt, normalizeStyle as R, DisposableMethodName as Rn, unregisterRuntimeLayoutHosts as Rt, ModelModifiers as S, onTabItemTap as Sn, PageStackSnapshot as St, useBindModel as T, onUnload as Tn, getCurrentPageStackSnapshot as Tt, UseScrollOffsetOptions as U, DefineComponentWithTypeProps as Un, UseIntersectionObserverResult as Ut, UseAllSelectorFieldsOptions as V, ComponentDefinition as Vn, waitForLayoutHost as Vt, UseSelectorFieldsOptions as W, SetupContextWithTypeProps as Wn, useIntersectionObserver as Wt, runSetupFunction as X, defineComponent as Xn, onDeactivated as Xt, useSelectorQuery as Y, createWevuScopedSlotComponent as Yn, onBeforeUpdate as Yt, mountRuntimeInstance as Z, WevuDefaults as Zn, onErrorCaptured as Zt, EmitsOptions as _, onRouteDone as _n, setPageLayout as _t, PageLayoutMeta as a, onError as an, TemplateRefs as ar, hasInjectionContext as at, useNativePageRouter as b, onShareTimeline as bn, usePageLayout as bt, defineExpose as c, onLoad as cn, CreateAppOptions as cr, provide as ct, definePageMeta as d, onPageNotFound as dn, DefineComponentOptions as dr, UsePageScrollThrottleOptions as dt, onUnmounted as en, createApp as er, registerComponent as et, defineProps as f, onPageScroll as fn, PageFeatures as fr, UsePageScrollThrottleStopHandle as ft, EmitFn as g, onResize as gn, resolveRuntimePageLayoutName as gt, ComponentTypeEmits as h, onReady as hn, WevuPageLayoutMap as ht, ModelRef as i, onDetached as in, TemplateRefValue as ir, useAsyncPullDownRefresh as it, defineAppSetup as j, setCurrentSetupContext as jn, LayoutBridgeInstance as jt, useNativeInstance as k, getCurrentSetupContext as kn, isNoSetData as kt, defineModel as l, onMemoryWarning as ln, DataOption as lr, provideGlobal as lt, withDefaults as m, onReachBottom as mn, SetDataSnapshotOptions as mr, PageLayoutState as mt, DefineModelModifiers as n, onAddToFavorites as nn, GlobalDirectives as nr, PullDownRefreshHandler as nt, PageMeta as o, onHide as on, WevuGlobalComponents as or, inject as ot, defineSlots as p, onPullDownRefresh as pn, SetDataDebugInfo as pr, usePageScrollThrottle as pt, useScrollOffset as q, WevuDefinedComponent as qn, onBeforeMount as qt, DefineModelTransformOptions as r, onAttached as rn, MiniProgramTemplateRefValue as rr, UseAsyncPullDownRefreshOptions as rt, defineEmits as s, onLaunch as sn, WevuGlobalDirectives as sr, injectGlobal as st, version as t, onUpdated as tn, GlobalComponents as tr, registerApp as tt, defineOptions as u, onMoved as un, DefineAppOptions as ur, setGlobalProvidedValue as ut, TemplateRef as v, onSaveExitState as vn, syncRuntimePageLayoutState as vt, mergeModels as w, onUnhandledRejection as wn, UsePageStackOptions as wt, useNativeRouter as x, onShow as xn, NavigationBarMetrics as xt, useTemplateRef as y, onShareAppMessage as yn, syncRuntimePageLayoutStateFromRuntime as yt, UseAllBoundingClientRectOptions as z, DisposableObject as zn, useLayoutBridge as zt };
|