@wevu/query 0.0.9 → 0.1.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.
@@ -1,5 +1,4 @@
1
1
  import { QueryHost } from "../bindings/plugin.mjs";
2
- //#region src/adapters/wechat.d.ts
3
2
  /** 微信网络类型读取结果。 */
4
3
  export interface WechatNetworkTypeResult {
5
4
  readonly networkType: string;
@@ -23,5 +22,4 @@ export interface WechatQueryHost {
23
22
  }
24
23
  /** 将显式传入的微信宿主适配为查询插件的宿主状态源。 */
25
24
  export declare function createWechatQueryHost(host: WechatQueryHost): QueryHost;
26
- //#endregion
27
25
  //# sourceMappingURL=wechat.d.mts.map
@@ -1,7 +1,6 @@
1
1
  import { Unsubscribe } from "../core/types.mjs";
2
2
  import { QueryClient } from "../core/client.mjs";
3
3
  import { WevuPlugin } from "wevu";
4
- //#region src/bindings/plugin.d.ts
5
4
  /** 查询客户端的 Wevu 注入键。 */
6
5
  export declare const QueryClientKey: unique symbol;
7
6
  /** 查询客户端需要的宿主状态订阅接口。 */
@@ -17,5 +16,4 @@ export interface CreateQueryPluginOptions {
17
16
  export declare function createQueryPlugin(client: QueryClient, options?: CreateQueryPluginOptions): WevuPlugin;
18
17
  /** 获取显式传入或当前应用提供的查询客户端。 */
19
18
  export declare function useQueryClient(client?: QueryClient): QueryClient;
20
- //#endregion
21
19
  //# sourceMappingURL=plugin.d.mts.map
@@ -1,6 +1,5 @@
1
1
  import { DataStatus, FetchStatus, FetchType, InfiniteData, InfiniteQueryOptions, MutationOptions, QueryKey, QueryOptions, RefetchOnShow } from "../core/types.mjs";
2
2
  import { ComputedRef, MaybeRefOrGetter } from "wevu";
3
- //#region src/bindings/types.d.ts
4
3
  /** 查询绑定共享的只读状态引用。 */
5
4
  export interface QueryStateRefs<TData> {
6
5
  readonly data: ComputedRef<TData | undefined>;
@@ -55,5 +54,4 @@ export interface UseMutationResult<TData, TVariables> {
55
54
  readonly mutateAsync: (variables: TVariables) => Promise<TData>;
56
55
  readonly reset: () => void;
57
56
  }
58
- //#endregion
59
57
  //# sourceMappingURL=types.d.mts.map
@@ -1,7 +1,5 @@
1
1
  import { QueryClient } from "../core/client.mjs";
2
2
  import { UseInfiniteQueryOptions, UseInfiniteQueryResult } from "./types.mjs";
3
- //#region src/bindings/useInfiniteQuery.d.ts
4
3
  /** 在当前 Wevu 页面中观察分页查询。 */
5
4
  export declare function useInfiniteQuery<TPage, TPageParam, TKey extends readonly unknown[] = readonly unknown[]>(options: UseInfiniteQueryOptions<TPage, TPageParam, TKey>, client?: QueryClient): UseInfiniteQueryResult<TPage, TPageParam>;
6
- //#endregion
7
5
  //# sourceMappingURL=useInfiniteQuery.d.mts.map
@@ -1,7 +1,5 @@
1
1
  import { QueryClient } from "../core/client.mjs";
2
2
  import { UseMutationOptions, UseMutationResult } from "./types.mjs";
3
- //#region src/bindings/useMutation.d.ts
4
3
  /** 在当前 Wevu 作用域中创建变更控制器。 */
5
4
  export declare function useMutation<TData, TVariables = void>(options: UseMutationOptions<TData, TVariables>, client?: QueryClient): UseMutationResult<TData, TVariables>;
6
- //#endregion
7
5
  //# sourceMappingURL=useMutation.d.mts.map
@@ -1,7 +1,5 @@
1
1
  import { QueryClient } from "../core/client.mjs";
2
2
  import { UseQueryOptions, UseQueryResult } from "./types.mjs";
3
- //#region src/bindings/useQuery.d.ts
4
3
  /** 在当前 Wevu 页面中观察普通查询。 */
5
4
  export declare function useQuery<TQueryData, TData = TQueryData, TKey extends readonly unknown[] = readonly unknown[]>(options: UseQueryOptions<TQueryData, TData, TKey>, client?: QueryClient): UseQueryResult<TQueryData, TData>;
6
- //#endregion
7
5
  //# sourceMappingURL=useQuery.d.mts.map
package/dist/client.d.mts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { QueryClientOptions } from "./core/types.mjs";
2
2
  import { QueryClient } from "./core/client.mjs";
3
- //#region src/client.d.ts
4
3
  /** 创建独立的查询客户端,显式复用小程序取消兼容层,不安装宿主全局。 */
5
4
  export declare function createQueryClient(options?: QueryClientOptions): QueryClient;
6
- //#endregion
7
5
  //# sourceMappingURL=client.d.mts.map
@@ -1,2 +1,2 @@
1
- import e from"../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.mjs";import{QueryEntry as t}from"./entry.mjs";const n=2147483647;function r(e,t,n){let r=e==null?t:e;if(r!==1/0&&(!Number.isFinite(r)||r<0))throw RangeError(`${n} 必须是非负有限数或 Infinity`);return r}var i=class{constructor(t,n){e(this,`entries`,/* @__PURE__ */ new Map),e(this,`defaultStaleTime`,void 0),e(this,`defaultGcTime`,void 0),e(this,`closed`,!1),this.defaultStaleTime=r(t,5e3,`staleTime`),this.defaultGcTime=r(n,3e5,`gcTime`)}get(e){return this.entries.get(e)}snapshot(){return[...this.entries.values()]}isCurrent(e){return!this.closed&&this.entries.get(e.hash)===e}ensure(e,n){let r=this.entries.get(e);if(r)return r;let i=new t(e,n,this.defaultStaleTime,this.defaultGcTime);return this.entries.set(e,i),i}configure(e,n){let i=r(n.staleTime,this.defaultStaleTime,`staleTime`),a=r(n.gcTime,this.defaultGcTime,`gcTime`),o=this.entries.get(e);if(o)return o.updateTiming(i,a),o;let s=new t(e,n.key,i,a);return this.entries.set(e,s),s}update(e,t){let n=r(t.staleTime,this.defaultStaleTime,`staleTime`),i=r(t.gcTime,this.defaultGcTime,`gcTime`);e.updateTiming(n,i)}scheduleGc(e){if(this.clearGc(e),this.closed||e.pending||e.observers.size>0||e.gcTime===1/0||this.entries.get(e.hash)!==e)return;let t=()=>{e.cancelGc=void 0,!e.pending&&e.observers.size===0&&this.entries.get(e.hash)===e&&this.entries.delete(e.hash)};if(e.gcTime<=n){let n=setTimeout(t,e.gcTime);e.cancelGc=()=>clearTimeout(n);return}let r=e.gcTime-n,i=setTimeout(function e(){let a=Math.min(r,n);r-=a,i=setTimeout(r>0?e:t,a)},n);e.cancelGc=()=>clearTimeout(i)}clearGc(e){var t;(t=e.cancelGc)==null||t.call(e),e.cancelGc=void 0}takeEntries(e=!1){let t=this.snapshot();this.entries.clear(),this.closed=e;for(let e of t)this.clearGc(e);return t}};export{i as QueryCache};
1
+ import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/defineProperty.mjs";import{QueryEntry as t}from"./entry.mjs";const n=2147483647;function r(e,t,n){let r=e==null?t:e;if(r!==1/0&&(!Number.isFinite(r)||r<0))throw RangeError(`${n} 必须是非负有限数或 Infinity`);return r}var i=class{constructor(t,n){e(this,`entries`,/* @__PURE__ */ new Map),e(this,`defaultStaleTime`,void 0),e(this,`defaultGcTime`,void 0),e(this,`closed`,!1),this.defaultStaleTime=r(t,5e3,`staleTime`),this.defaultGcTime=r(n,3e5,`gcTime`)}get(e){return this.entries.get(e)}snapshot(){return[...this.entries.values()]}isCurrent(e){return!this.closed&&this.entries.get(e.hash)===e}ensure(e,n){let r=this.entries.get(e);if(r)return r;let i=new t(e,n,this.defaultStaleTime,this.defaultGcTime);return this.entries.set(e,i),i}configure(e,n){let i=r(n.staleTime,this.defaultStaleTime,`staleTime`),a=r(n.gcTime,this.defaultGcTime,`gcTime`),o=this.entries.get(e);if(o)return o.updateTiming(i,a),o;let s=new t(e,n.key,i,a);return this.entries.set(e,s),s}update(e,t){let n=r(t.staleTime,this.defaultStaleTime,`staleTime`),i=r(t.gcTime,this.defaultGcTime,`gcTime`);e.updateTiming(n,i)}scheduleGc(e){if(this.clearGc(e),this.closed||e.pending||e.observers.size>0||e.gcTime===1/0||this.entries.get(e.hash)!==e)return;let t=()=>{e.cancelGc=void 0,!e.pending&&e.observers.size===0&&this.entries.get(e.hash)===e&&this.entries.delete(e.hash)};if(e.gcTime<=n){let n=setTimeout(t,e.gcTime);e.cancelGc=()=>clearTimeout(n);return}let r=e.gcTime-n,i=setTimeout(function e(){let a=Math.min(r,n);r-=a,i=setTimeout(r>0?e:t,a)},n);e.cancelGc=()=>clearTimeout(i)}clearGc(e){var t;(t=e.cancelGc)==null||t.call(e),e.cancelGc=void 0}takeEntries(e=!1){let t=this.snapshot();this.entries.clear(),this.closed=e;for(let e of t)this.clearGc(e);return t}};export{i as QueryCache};
2
2
  //# sourceMappingURL=cache.mjs.map
@@ -1,5 +1,4 @@
1
1
  import { FetchOptions, QueryClientConfig, QueryDataOf, QueryFilter, QueryKey, QueryObserver, QueryObserverOptions, QueryOptions, QueryState, Unsubscribe, UntaggedQueryKey } from "./types.mjs";
2
- //#region src/core/client.d.ts
3
2
  type QueryDataUpdater<TData> = TData | ((old: TData | undefined) => TData);
4
3
  /** 保存查询缓存,并协调请求、观察者、作用域和宿主活动状态。 */
5
4
  export declare class QueryClient {
@@ -41,6 +40,5 @@ export declare class QueryClient {
41
40
  private ensureWriteCurrent;
42
41
  private ensureActive;
43
42
  }
44
- //#endregion
45
43
  export {};
46
44
  //# sourceMappingURL=client.d.mts.map
@@ -1,2 +1,2 @@
1
- import{QueryCancelledError as e}from"./errors.mjs";import{createQueryMatcher as t,hashQueryKey as n,snapshotAndHashQueryKey as r}from"./keys.mjs";import i from"../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.mjs";import{ListenerStore as a}from"./listeners.mjs";import{QueryCache as o}from"./cache.mjs";import{cancelEntry as s,fetchEntry as c,resumeEntry as l}from"./fetch.mjs";import{QueryObserverManager as u}from"./observerManager.mjs";var d=class{constructor(e){var t,n;if(i(this,`cache`,void 0),i(this,`observerManager`,void 0),i(this,`scopeListeners`,new a),i(this,`clock`,void 0),i(this,`controllerFactory`,void 0),i(this,`fetchRuntime`,void 0),i(this,`online`,!0),i(this,`foreground`,!0),i(this,`scope`,void 0),i(this,`scopeVersion`,0),i(this,`disposed`,!1),typeof e.createAbortController!=`function`)throw TypeError(`QueryClient 需要 createAbortController`);this.cache=new o(e.staleTime,e.gcTime),this.clock=(t=e.now)==null?(()=>Date.now()):t,this.controllerFactory=e.createAbortController,this.scope=(n=e.scope)==null?`default`:n,this.fetchRuntime={createAbortController:()=>this.controllerFactory(),getEpoch:()=>this.scopeVersion,isEntryCurrent:e=>!this.disposed&&this.cache.isCurrent(e),isOnline:()=>this.online,now:()=>this.clock(),onEntrySettled:e=>this.cache.scheduleGc(e)},this.observerManager=new u(this.cache,this.fetchRuntime,()=>this.ensureActive(),()=>this.foreground)}observeQuery(e,t){return this.observerManager.create(e,t)}fetchQuery(e,t={}){this.ensureActive();let n=r(e.key),i={...e,key:n.key},a=this.cache.configure(n.hash,i);return this.cache.clearGc(a),c(this.fetchRuntime,a,i,t,!0,!0)}prefetchQuery(e){return this.fetchQuery(e).then(()=>void 0)}getQueryState(e){let t=this.cache.get(n(e));return t==null?void 0:t.state}getQueryData(e){var t;return(t=this.getQueryState(e))==null?void 0:t.data}setQueryData(e,t){this.ensureActive();let n=this.scopeVersion,i=r(e),a=this.cache.ensure(i.hash,i.key),o=a.state.hasData?a.state.data:void 0,c=++a.writeVersion;a.writeDepth++;try{if(a.pending&&s(a),this.ensureWriteCurrent(a,n),a.committedWriteVersion>c)return a.state.data;let e=typeof t==`function`?t(o):t;if(this.ensureWriteCurrent(a,n),a.committedWriteVersion>c)return a.state.data;let r=this.clock();return this.ensureWriteCurrent(a,n),a.committedWriteVersion>c?a.state.data:(a.committedWriteVersion=c,a.setState({data:e,error:null,fetchStatus:`idle`,fetchType:null,hasData:!0,invalidated:!1,status:`success`,updatedAt:r}),this.ensureWriteCurrent(a,n),this.cache.scheduleGc(a),a.committedWriteVersion>c?a.state.data:e)}catch(e){throw a.writeDepth===1&&a.committedWriteVersion<=c&&this.scopeVersion===n&&this.cache.isCurrent(a)&&this.cache.scheduleGc(a),e}finally{a.writeDepth--}}invalidateQueries(n={}){this.ensureActive();let r=t(n),i=[];for(let t of this.cache.snapshot()){if(!this.cache.isCurrent(t)||!r(t.key,t.hash))continue;s(t,new e,{invalidated:!0});let n=this.observerManager.findInvalidationObserver(t);n?i.push(n.refreshFromInvalidation()):this.cache.scheduleGc(t)}return Promise.all(i).then(()=>void 0)}cancelQueries(e={}){this.ensureActive();let n=t(e);for(let e of this.cache.snapshot())e.pending&&this.cache.isCurrent(e)&&n(e.key,e.hash)&&(s(e),this.cache.scheduleGc(e))}clear(){this.ensureActive(),this.advanceScope()}setScope(e){this.ensureActive(),e!==this.scope&&(this.scope=e,this.advanceScope())}getScopeVersion(){return this.scopeVersion}isDisposed(){return this.disposed}subscribeScope(e){return this.ensureActive(),this.scopeListeners.add(e)}setOnline(e){if(this.ensureActive(),this.online!==e&&(this.online=e,e))for(let e of this.cache.snapshot()){let t=e.pending;t&&!t.started&&(t.imperative||t.resumeOffline||this.observerManager.canResume(e))&&l(this.fetchRuntime,e)}}setForeground(e){this.ensureActive(),this.foreground!==e&&(this.foreground=e,e&&this.observerManager.foregroundEntered())}dispose(){this.disposed||(this.disposed=!0,this.scopeVersion++,this.releaseEntries(!0),this.observerManager.dispose(),this.scopeListeners.close(this.scopeVersion))}advanceScope(){let e=++this.scopeVersion;this.releaseEntries(!1),this.observerManager.rebindAfterScope(()=>!this.disposed&&this.scopeVersion===e),!this.disposed&&this.scopeVersion===e&&this.scopeListeners.emit(e)}releaseEntries(t){for(let n of this.cache.takeEntries(t))n.observers.clear(),n.pending&&s(n,new e,{},!1)}ensureWriteCurrent(t,n){if(this.disposed||this.scopeVersion!==n||!this.cache.isCurrent(t))throw new e}ensureActive(){if(this.disposed)throw Error(`QueryClient 已销毁`)}};export{d as QueryClient};
1
+ import{QueryCancelledError as e}from"./errors.mjs";import{createQueryMatcher as t,hashQueryKey as n,snapshotAndHashQueryKey as r}from"./keys.mjs";import i from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/defineProperty.mjs";import{ListenerStore as a}from"./listeners.mjs";import{QueryCache as o}from"./cache.mjs";import{cancelEntry as s,fetchEntry as c,resumeEntry as l}from"./fetch.mjs";import{QueryObserverManager as u}from"./observerManager.mjs";var d=class{constructor(e){var t,n;if(i(this,`cache`,void 0),i(this,`observerManager`,void 0),i(this,`scopeListeners`,new a),i(this,`clock`,void 0),i(this,`controllerFactory`,void 0),i(this,`fetchRuntime`,void 0),i(this,`online`,!0),i(this,`foreground`,!0),i(this,`scope`,void 0),i(this,`scopeVersion`,0),i(this,`disposed`,!1),typeof e.createAbortController!=`function`)throw TypeError(`QueryClient 需要 createAbortController`);this.cache=new o(e.staleTime,e.gcTime),this.clock=(t=e.now)==null?(()=>Date.now()):t,this.controllerFactory=e.createAbortController,this.scope=(n=e.scope)==null?`default`:n,this.fetchRuntime={createAbortController:()=>this.controllerFactory(),getEpoch:()=>this.scopeVersion,isEntryCurrent:e=>!this.disposed&&this.cache.isCurrent(e),isOnline:()=>this.online,now:()=>this.clock(),onEntrySettled:e=>this.cache.scheduleGc(e)},this.observerManager=new u(this.cache,this.fetchRuntime,()=>this.ensureActive(),()=>this.foreground)}observeQuery(e,t){return this.observerManager.create(e,t)}fetchQuery(e,t={}){this.ensureActive();let n=r(e.key),i={...e,key:n.key},a=this.cache.configure(n.hash,i);return this.cache.clearGc(a),c(this.fetchRuntime,a,i,t,!0,!0)}prefetchQuery(e){return this.fetchQuery(e).then(()=>void 0)}getQueryState(e){let t=this.cache.get(n(e));return t==null?void 0:t.state}getQueryData(e){var t;return(t=this.getQueryState(e))==null?void 0:t.data}setQueryData(e,t){this.ensureActive();let n=this.scopeVersion,i=r(e),a=this.cache.ensure(i.hash,i.key),o=a.state.hasData?a.state.data:void 0,c=++a.writeVersion;a.writeDepth++;try{if(a.pending&&s(a),this.ensureWriteCurrent(a,n),a.committedWriteVersion>c)return a.state.data;let e=typeof t==`function`?t(o):t;if(this.ensureWriteCurrent(a,n),a.committedWriteVersion>c)return a.state.data;let r=this.clock();return this.ensureWriteCurrent(a,n),a.committedWriteVersion>c?a.state.data:(a.committedWriteVersion=c,a.setState({data:e,error:null,fetchStatus:`idle`,fetchType:null,hasData:!0,invalidated:!1,status:`success`,updatedAt:r}),this.ensureWriteCurrent(a,n),this.cache.scheduleGc(a),a.committedWriteVersion>c?a.state.data:e)}catch(e){throw a.writeDepth===1&&a.committedWriteVersion<=c&&this.scopeVersion===n&&this.cache.isCurrent(a)&&this.cache.scheduleGc(a),e}finally{a.writeDepth--}}invalidateQueries(n={}){this.ensureActive();let r=t(n),i=[];for(let t of this.cache.snapshot()){if(!this.cache.isCurrent(t)||!r(t.key,t.hash))continue;s(t,new e,{invalidated:!0});let n=this.observerManager.findInvalidationObserver(t);n?i.push(n.refreshFromInvalidation()):this.cache.scheduleGc(t)}return Promise.all(i).then(()=>void 0)}cancelQueries(e={}){this.ensureActive();let n=t(e);for(let e of this.cache.snapshot())e.pending&&this.cache.isCurrent(e)&&n(e.key,e.hash)&&(s(e),this.cache.scheduleGc(e))}clear(){this.ensureActive(),this.advanceScope()}setScope(e){this.ensureActive(),e!==this.scope&&(this.scope=e,this.advanceScope())}getScopeVersion(){return this.scopeVersion}isDisposed(){return this.disposed}subscribeScope(e){return this.ensureActive(),this.scopeListeners.add(e)}setOnline(e){if(this.ensureActive(),this.online!==e&&(this.online=e,e))for(let e of this.cache.snapshot()){let t=e.pending;t&&!t.started&&(t.imperative||t.resumeOffline||this.observerManager.canResume(e))&&l(this.fetchRuntime,e)}}setForeground(e){this.ensureActive(),this.foreground!==e&&(this.foreground=e,e&&this.observerManager.foregroundEntered())}dispose(){this.disposed||(this.disposed=!0,this.scopeVersion++,this.releaseEntries(!0),this.observerManager.dispose(),this.scopeListeners.close(this.scopeVersion))}advanceScope(){let e=++this.scopeVersion;this.releaseEntries(!1),this.observerManager.rebindAfterScope(()=>!this.disposed&&this.scopeVersion===e),!this.disposed&&this.scopeVersion===e&&this.scopeListeners.emit(e)}releaseEntries(t){for(let n of this.cache.takeEntries(t))n.observers.clear(),n.pending&&s(n,new e,{},!1)}ensureWriteCurrent(t,n){if(this.disposed||this.scopeVersion!==n||!this.cache.isCurrent(t))throw new e}ensureActive(){if(this.disposed)throw Error(`QueryClient 已销毁`)}};export{d as QueryClient};
2
2
  //# sourceMappingURL=client.mjs.map
@@ -1,2 +1,2 @@
1
- import e from"../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.mjs";function t(){return Object.freeze({data:void 0,error:null,fetchStatus:`idle`,fetchType:null,hasData:!1,invalidated:!1,status:`pending`,updatedAt:0})}var n=class{constructor(n,r,i,a){e(this,`state`,t()),e(this,`observers`,/* @__PURE__ */ new Set),e(this,`hash`,void 0),e(this,`key`,void 0),e(this,`cancelGc`,void 0),e(this,`staleTime`,void 0),e(this,`gcTime`,void 0),e(this,`pending`,void 0),e(this,`writeDepth`,0),e(this,`writeVersion`,0),e(this,`committedWriteVersion`,0),e(this,`stateRevision`,0),e(this,`notifying`,!1),e(this,`notifyAgain`,!1),this.hash=n,this.key=r,this.staleTime=i,this.gcTime=a}updateTiming(e,t){this.staleTime=e,this.gcTime=Math.max(this.gcTime,t)}isFresh(e){return this.state.hasData&&!this.state.invalidated&&e-this.state.updatedAt<this.staleTime}setState(e,t=!0){this.state=Object.freeze({...this.state,...e}),this.stateRevision++,t&&this.notifyObservers()}notifyObservers(){if(this.observers.size!==0){if(this.notifying)this.notifyAgain=!0;else{this.notifying=!0;try{do{this.notifyAgain=!1;let e=this.stateRevision,t=this.state,n=[...this.observers];for(let r of n){if(e!==this.stateRevision){this.notifyAgain=!0;break}this.observers.has(r)&&r.onEntryState(this,t)}}while(this.notifyAgain)}finally{this.notifying=!1}}}}};function r(e,t,n,r,i,a){let o,s;return{controller:void 0,aborted:!1,epoch:r,fetchType:n,imperative:i,resumeOffline:a,settled:!1,key:t,promise:new Promise((e,t)=>{o=e,s=t}),query:e,reject:s,resolve:o,started:!1}}export{n as QueryEntry,r as createPendingQuery};
1
+ import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/defineProperty.mjs";function t(){return Object.freeze({data:void 0,error:null,fetchStatus:`idle`,fetchType:null,hasData:!1,invalidated:!1,status:`pending`,updatedAt:0})}var n=class{constructor(n,r,i,a){e(this,`state`,t()),e(this,`observers`,/* @__PURE__ */ new Set),e(this,`hash`,void 0),e(this,`key`,void 0),e(this,`cancelGc`,void 0),e(this,`staleTime`,void 0),e(this,`gcTime`,void 0),e(this,`pending`,void 0),e(this,`writeDepth`,0),e(this,`writeVersion`,0),e(this,`committedWriteVersion`,0),e(this,`stateRevision`,0),e(this,`notifying`,!1),e(this,`notifyAgain`,!1),this.hash=n,this.key=r,this.staleTime=i,this.gcTime=a}updateTiming(e,t){this.staleTime=e,this.gcTime=Math.max(this.gcTime,t)}isFresh(e){return this.state.hasData&&!this.state.invalidated&&e-this.state.updatedAt<this.staleTime}setState(e,t=!0){this.state=Object.freeze({...this.state,...e}),this.stateRevision++,t&&this.notifyObservers()}notifyObservers(){if(this.observers.size!==0){if(this.notifying)this.notifyAgain=!0;else{this.notifying=!0;try{do{this.notifyAgain=!1;let e=this.stateRevision,t=this.state,n=[...this.observers];for(let r of n){if(e!==this.stateRevision){this.notifyAgain=!0;break}this.observers.has(r)&&r.onEntryState(this,t)}}while(this.notifyAgain)}finally{this.notifying=!1}}}}};function r(e,t,n,r,i,a){let o,s;return{controller:void 0,aborted:!1,epoch:r,fetchType:n,imperative:i,resumeOffline:a,settled:!1,key:t,promise:new Promise((e,t)=>{o=e,s=t}),query:e,reject:s,resolve:o,started:!1}}export{n as QueryEntry,r as createPendingQuery};
2
2
  //# sourceMappingURL=entry.mjs.map
@@ -1,9 +1,7 @@
1
- //#region src/core/errors.d.ts
2
1
  /** 查询被客户端显式撤销时返回的错误。 */
3
2
  export declare class QueryCancelledError extends Error {
4
3
  constructor(message?: string);
5
4
  }
6
5
  /** 判断错误是否来自查询客户端的取消流程。 */
7
6
  export declare function isQueryCancelled(error: unknown): error is QueryCancelledError;
8
- //#endregion
9
7
  //# sourceMappingURL=errors.d.mts.map
@@ -1,10 +1,8 @@
1
1
  import { InfiniteQueryObserver, InfiniteQueryOptions, QueryObserverOptions } from "./types.mjs";
2
2
  import { QueryClient } from "./client.mjs";
3
- //#region src/core/infinite.d.ts
4
3
  /**
5
4
  * 在 QueryClient 的同一缓存条目上观察分页数据。
6
5
  * 普通刷新重置首页,追加请求通过一次性查询覆盖共享去重。
7
6
  */
8
7
  export declare function observeInfiniteQuery<TPage, TPageParam, TKey extends readonly unknown[]>(client: QueryClient, options: InfiniteQueryOptions<TPage, TPageParam, TKey>, observerOptions?: QueryObserverOptions): InfiniteQueryObserver<TPage, TPageParam, TKey>;
9
- //#endregion
10
8
  //# sourceMappingURL=infinite.d.mts.map
@@ -1,2 +1,2 @@
1
- import e from"../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.mjs";function t(e){setTimeout(()=>{throw e},0)}var n=class{constructor(){e(this,`listeners`,/* @__PURE__ */ new Set),e(this,`notifying`,!1),e(this,`pending`,!1),e(this,`pendingValue`,void 0),e(this,`closeWhenIdle`,!1)}add(e){this.listeners.add(e);let t=!0;return()=>{t&&(t=!1,this.listeners.delete(e))}}emit(e,n){if(this.listeners.size!==0&&(this.pendingValue=e,this.pending=!0,!this.notifying)){this.notifying=!0;try{do{let e=this.pendingValue;this.pending=!1;let r=[...this.listeners];for(let i of r){if(this.pending||n&&!n())break;if(this.listeners.has(i)){try{i(e)}catch(e){t(e)}if(n&&!n())break}}}while(this.pending)}finally{this.notifying=!1,this.closeWhenIdle&&this.finishClose()}}}close(e,t){this.closeWhenIdle=!0,this.emit(e,t),!this.notifying&&this.closeWhenIdle&&this.finishClose()}clear(){this.listeners.clear(),this.pending=!1,this.closeWhenIdle=!1}finishClose(){this.listeners.clear(),this.pending=!1,this.closeWhenIdle=!1}};export{n as ListenerStore,t as reportCallbackError};
1
+ import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/defineProperty.mjs";function t(e){setTimeout(()=>{throw e},0)}var n=class{constructor(){e(this,`listeners`,/* @__PURE__ */ new Set),e(this,`notifying`,!1),e(this,`pending`,!1),e(this,`pendingValue`,void 0),e(this,`closeWhenIdle`,!1)}add(e){this.listeners.add(e);let t=!0;return()=>{t&&(t=!1,this.listeners.delete(e))}}emit(e,n){if(this.listeners.size!==0&&(this.pendingValue=e,this.pending=!0,!this.notifying)){this.notifying=!0;try{do{let e=this.pendingValue;this.pending=!1;let r=[...this.listeners];for(let i of r){if(this.pending||n&&!n())break;if(this.listeners.has(i)){try{i(e)}catch(e){t(e)}if(n&&!n())break}}}while(this.pending)}finally{this.notifying=!1,this.closeWhenIdle&&this.finishClose()}}}close(e,t){this.closeWhenIdle=!0,this.emit(e,t),!this.notifying&&this.closeWhenIdle&&this.finishClose()}clear(){this.listeners.clear(),this.pending=!1,this.closeWhenIdle=!1}finishClose(){this.listeners.clear(),this.pending=!1,this.closeWhenIdle=!1}};export{n as ListenerStore,t as reportCallbackError};
2
2
  //# sourceMappingURL=listeners.mjs.map
@@ -1,10 +1,8 @@
1
1
  import { MutationController, MutationOptions } from "./types.mjs";
2
2
  import { QueryClient } from "./client.mjs";
3
- //#region src/core/mutation.d.ts
4
3
  /**
5
4
  * 创建不重试、不合并调用的 mutation 控制器。
6
5
  * 每次调用独立执行回调,只有最新调用可以更新展示状态。
7
6
  */
8
7
  export declare function createMutation<TData, TVariables>(client: QueryClient, options: MutationOptions<TData, TVariables>): MutationController<TData, TVariables>;
9
- //#endregion
10
8
  //# sourceMappingURL=mutation.d.mts.map
@@ -1,2 +1,2 @@
1
- import{QueryCancelledError as e}from"./errors.mjs";import{snapshotAndHashQueryKey as t}from"./keys.mjs";import n from"../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.mjs";import{ListenerStore as r}from"./listeners.mjs";import{automaticRefetchFetchOptions as i,consumeAutomatic as a,refetchFetchOptions as o,refreshFetchOptions as s}from"./observerHost.mjs";var c=class{constructor(e,i,o={}){var c,l,u;n(this,`host`,void 0),n(this,`listeners`,new r),n(this,`options`,void 0),n(this,`entry`,void 0),n(this,`hash`,void 0),n(this,`state`,void 0),n(this,`enabled`,void 0),n(this,`active`,void 0),n(this,`refetchOnShow`,void 0),n(this,`armed`,!0),n(this,`destroyed`,!1),n(this,`bindingVersion`,0),n(this,`emittedState`,void 0),n(this,`emissionIsCurrent`,()=>!this.destroyed&&this.emittedState===this.state&&this.entry.state===this.emittedState),this.host=e;let d=t(i.key);this.options={...i,key:d.key},this.hash=d.hash,this.enabled=(c=o.enabled)==null||c,this.active=(l=o.active)==null||l,this.refetchOnShow=(u=o.refetchOnShow)==null?`stale`:u,this.entry=e.registerObserver(this,this.options,this.hash),this.state=this.entry.state,this.canRefreshAutomatically()&&a(this.host.fetchObserver(this,s,!1))}getState(){return this.state}subscribe(e){this.ensureAlive();let t=this.listeners.add(e);try{e(this.state)}catch(e){throw t(),e}return t}setOptions(e,n={}){var r,i,o;this.ensureAlive();let c=++this.bindingVersion,l=t(e.key),u={...e,key:l.key},d=l.hash!==this.hash,f=this.enabled,p=this.active,m=(r=n.enabled)==null?this.enabled:r,h=(i=n.active)==null?this.active:i,g=(o=n.refetchOnShow)==null?this.refetchOnShow:o;if(d){if(this.host.rebindObserver(this,this.entry,u,l.hash,c,m,h,g),!this.isBindingCurrent(c))return;this.emittedState=this.state,this.listeners.emit(this.state,this.emissionIsCurrent),this.canRefreshAutomatically()&&a(this.host.fetchObserver(this,s,!1))}else this.host.updateObserver(this.entry,u),this.isBindingCurrent(c)&&(this.options=u,this.enabled=m,this.active=h,this.refetchOnShow=g,!f&&this.enabled?(this.armed=!0,this.canRefreshAutomatically()&&a(this.host.fetchObserver(this,s,!1))):!p&&this.active?this.refreshForVisibility():f&&this.enabled&&p&&this.active&&this.armed&&this.host.isForeground()&&a(this.host.fetchObserver(this,s,!1)))}setActive(e){this.ensureAlive(),this.active!==e&&(this.active=e,e&&this.refreshForVisibility())}setEnabled(e){this.ensureAlive(),this.enabled!==e&&(this.enabled=e,e&&(this.armed=!0,this.canRefreshAutomatically()&&a(this.host.fetchObserver(this,s,!1))))}refresh(){return this.ensureAlive(),this.armed=!0,this.host.fetchObserver(this,s,!0)}refetch(){return this.ensureAlive(),this.armed=!0,this.host.fetchObserver(this,o,!0)}destroy(){this.destroyed||(this.destroyed=!0,this.bindingVersion++,this.listeners.clear(),this.host.removeObserver(this,this.entry))}onEntryState(e,t){this.destroyed||e!==this.entry||(this.state=t,this.emittedState=this.state,this.listeners.emit(this.state,this.emissionIsCurrent))}getOptions(){return this.options}getHash(){return this.hash}fetchObserved(t){return this.destroyed?Promise.reject(new e):this.host.fetchObserver(this,t,!0)}commitRebind(e,t,n,r,i,a,o){return this.isBindingCurrent(r)?(this.entry=e,this.options=t,this.hash=n,this.enabled=i,this.active=a,this.refetchOnShow=o,this.state=e.state,this.armed=!0,!0):!1}isBindingCurrent(e){return!this.destroyed&&this.bindingVersion===e}canRefreshAutomatically(){return!this.destroyed&&this.armed&&this.enabled&&this.active&&this.host.isForeground()}canRefreshFromInvalidation(){return!this.destroyed&&this.enabled&&this.active&&this.host.isForeground()}refreshFromInvalidation(){return this.armed=!0,this.host.fetchObserver(this,s,!1)}foregroundEntered(){this.refreshForVisibility()}replaceEntryAfterScope(e){this.destroyed||(this.entry=e,this.state=e.state,this.armed=!1,this.emittedState=this.state,this.listeners.emit(this.state,this.emissionIsCurrent))}disposeFromClient(){this.destroyed||(this.destroyed=!0,this.bindingVersion++,this.listeners.clear())}refreshForVisibility(){this.canRefreshAutomatically()&&(this.state.hasData?this.refetchOnShow===`always`?a(this.host.fetchObserver(this,i,!1)):this.refetchOnShow===`stale`&&a(this.host.fetchObserver(this,s,!1)):a(this.host.fetchObserver(this,s,!1)))}ensureAlive(){if(this.destroyed)throw Error(`查询观察者已销毁`)}};function l(t,n){return t instanceof c?t.fetchObserved(n):Promise.reject(new e)}export{c as QueryObserverImpl,l as fetchObservedQuery};
1
+ import{QueryCancelledError as e}from"./errors.mjs";import{snapshotAndHashQueryKey as t}from"./keys.mjs";import n from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/defineProperty.mjs";import{ListenerStore as r}from"./listeners.mjs";import{automaticRefetchFetchOptions as i,consumeAutomatic as a,refetchFetchOptions as o,refreshFetchOptions as s}from"./observerHost.mjs";var c=class{constructor(e,i,o={}){var c,l,u;n(this,`host`,void 0),n(this,`listeners`,new r),n(this,`options`,void 0),n(this,`entry`,void 0),n(this,`hash`,void 0),n(this,`state`,void 0),n(this,`enabled`,void 0),n(this,`active`,void 0),n(this,`refetchOnShow`,void 0),n(this,`armed`,!0),n(this,`destroyed`,!1),n(this,`bindingVersion`,0),n(this,`emittedState`,void 0),n(this,`emissionIsCurrent`,()=>!this.destroyed&&this.emittedState===this.state&&this.entry.state===this.emittedState),this.host=e;let d=t(i.key);this.options={...i,key:d.key},this.hash=d.hash,this.enabled=(c=o.enabled)==null||c,this.active=(l=o.active)==null||l,this.refetchOnShow=(u=o.refetchOnShow)==null?`stale`:u,this.entry=e.registerObserver(this,this.options,this.hash),this.state=this.entry.state,this.canRefreshAutomatically()&&a(this.host.fetchObserver(this,s,!1))}getState(){return this.state}subscribe(e){this.ensureAlive();let t=this.listeners.add(e);try{e(this.state)}catch(e){throw t(),e}return t}setOptions(e,n={}){var r,i,o;this.ensureAlive();let c=++this.bindingVersion,l=t(e.key),u={...e,key:l.key},d=l.hash!==this.hash,f=this.enabled,p=this.active,m=(r=n.enabled)==null?this.enabled:r,h=(i=n.active)==null?this.active:i,g=(o=n.refetchOnShow)==null?this.refetchOnShow:o;if(d){if(this.host.rebindObserver(this,this.entry,u,l.hash,c,m,h,g),!this.isBindingCurrent(c))return;this.emittedState=this.state,this.listeners.emit(this.state,this.emissionIsCurrent),this.canRefreshAutomatically()&&a(this.host.fetchObserver(this,s,!1))}else this.host.updateObserver(this.entry,u),this.isBindingCurrent(c)&&(this.options=u,this.enabled=m,this.active=h,this.refetchOnShow=g,!f&&this.enabled?(this.armed=!0,this.canRefreshAutomatically()&&a(this.host.fetchObserver(this,s,!1))):!p&&this.active?this.refreshForVisibility():f&&this.enabled&&p&&this.active&&this.armed&&this.host.isForeground()&&a(this.host.fetchObserver(this,s,!1)))}setActive(e){this.ensureAlive(),this.active!==e&&(this.active=e,e&&this.refreshForVisibility())}setEnabled(e){this.ensureAlive(),this.enabled!==e&&(this.enabled=e,e&&(this.armed=!0,this.canRefreshAutomatically()&&a(this.host.fetchObserver(this,s,!1))))}refresh(){return this.ensureAlive(),this.armed=!0,this.host.fetchObserver(this,s,!0)}refetch(){return this.ensureAlive(),this.armed=!0,this.host.fetchObserver(this,o,!0)}destroy(){this.destroyed||(this.destroyed=!0,this.bindingVersion++,this.listeners.clear(),this.host.removeObserver(this,this.entry))}onEntryState(e,t){this.destroyed||e!==this.entry||(this.state=t,this.emittedState=this.state,this.listeners.emit(this.state,this.emissionIsCurrent))}getOptions(){return this.options}getHash(){return this.hash}fetchObserved(t){return this.destroyed?Promise.reject(new e):this.host.fetchObserver(this,t,!0)}commitRebind(e,t,n,r,i,a,o){return this.isBindingCurrent(r)?(this.entry=e,this.options=t,this.hash=n,this.enabled=i,this.active=a,this.refetchOnShow=o,this.state=e.state,this.armed=!0,!0):!1}isBindingCurrent(e){return!this.destroyed&&this.bindingVersion===e}canRefreshAutomatically(){return!this.destroyed&&this.armed&&this.enabled&&this.active&&this.host.isForeground()}canRefreshFromInvalidation(){return!this.destroyed&&this.enabled&&this.active&&this.host.isForeground()}refreshFromInvalidation(){return this.armed=!0,this.host.fetchObserver(this,s,!1)}foregroundEntered(){this.refreshForVisibility()}replaceEntryAfterScope(e){this.destroyed||(this.entry=e,this.state=e.state,this.armed=!1,this.emittedState=this.state,this.listeners.emit(this.state,this.emissionIsCurrent))}disposeFromClient(){this.destroyed||(this.destroyed=!0,this.bindingVersion++,this.listeners.clear())}refreshForVisibility(){this.canRefreshAutomatically()&&(this.state.hasData?this.refetchOnShow===`always`?a(this.host.fetchObserver(this,i,!1)):this.refetchOnShow===`stale`&&a(this.host.fetchObserver(this,s,!1)):a(this.host.fetchObserver(this,s,!1)))}ensureAlive(){if(this.destroyed)throw Error(`查询观察者已销毁`)}};function l(t,n){return t instanceof c?t.fetchObserved(n):Promise.reject(new e)}export{c as QueryObserverImpl,l as fetchObservedQuery};
2
2
  //# sourceMappingURL=observer.mjs.map
@@ -1,2 +1,2 @@
1
- import{QueryCancelledError as e}from"./errors.mjs";import t from"../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.mjs";import{QueryObserverImpl as n}from"./observer.mjs";import{cancelEntry as r,fetchEntry as i}from"./fetch.mjs";var a=class{constructor(e,n,r,i){t(this,`cache`,void 0),t(this,`fetchRuntime`,void 0),t(this,`ensureClientActive`,void 0),t(this,`observers`,/* @__PURE__ */ new Set),t(this,`host`,void 0),this.cache=e,this.fetchRuntime=n,this.ensureClientActive=r,this.host={fetchObserver:(e,t,n)=>this.fetchObserver(e,t,n),isForeground:i,rebindObserver:(e,t,n,r,i,a,o,s)=>this.rebindObserver(e,t,n,r,i,a,o,s),registerObserver:(e,t,n)=>this.registerObserver(e,t,n),removeObserver:(e,t)=>this.removeObserver(e,t),updateObserver:(e,t)=>this.cache.update(e,t)}}create(e,t){return this.ensureClientActive(),new n(this.host,e,t)}findInvalidationObserver(e){for(let t of e.observers){let e=t;if(e.canRefreshFromInvalidation())return e}}canResume(e){for(let t of e.observers)if(t.canRefreshAutomatically())return!0;return!1}foregroundEntered(){for(let e of[...this.observers])this.observers.has(e)&&e.foregroundEntered()}rebindAfterScope(e){for(let t of[...this.observers]){if(!e())return;if(!this.observers.has(t))continue;let n=t.getOptions(),r=this.cache.configure(t.getHash(),n);r.observers.add(t),t.replaceEntryAfterScope(r)}}dispose(){for(let e of this.observers)e.disposeFromClient();this.observers.clear()}registerObserver(e,t,n){let r=this.cache.configure(n,t);return this.cache.clearGc(r),r.observers.add(e),this.observers.add(e),r}rebindObserver(t,n,r,i,a,o,s,c){let l=this.cache.configure(i,r);if(!this.cache.isCurrent(l))throw new e;let u=t;if(!this.observers.has(u))return this.cache.scheduleGc(l),l;if(n.observers.delete(t),this.cache.clearGc(l),l.observers.add(t),t.commitRebind(l,r,i,a,o,s,c)||l.observers.delete(t),this.releaseUnobserved(n),!this.cache.isCurrent(l))throw new e;return l.observers.has(t)||this.cache.scheduleGc(l),l}removeObserver(e,t){t.observers.delete(e),this.observers.delete(e),this.releaseUnobserved(t)}fetchObserver(t,n,r){this.ensureClientActive();let a=t.getOptions(),o=this.cache.get(t.getHash());return!o||!o.observers.has(t)?Promise.reject(new e):(this.cache.update(o,a),this.cache.clearGc(o),i(this.fetchRuntime,o,a,n,!1,r))}releaseUnobserved(e){e.observers.size>0||(e.pending&&!e.pending.imperative&&r(e),this.cache.scheduleGc(e))}};export{a as QueryObserverManager};
1
+ import{QueryCancelledError as e}from"./errors.mjs";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/defineProperty.mjs";import{QueryObserverImpl as n}from"./observer.mjs";import{cancelEntry as r,fetchEntry as i}from"./fetch.mjs";var a=class{constructor(e,n,r,i){t(this,`cache`,void 0),t(this,`fetchRuntime`,void 0),t(this,`ensureClientActive`,void 0),t(this,`observers`,/* @__PURE__ */ new Set),t(this,`host`,void 0),this.cache=e,this.fetchRuntime=n,this.ensureClientActive=r,this.host={fetchObserver:(e,t,n)=>this.fetchObserver(e,t,n),isForeground:i,rebindObserver:(e,t,n,r,i,a,o,s)=>this.rebindObserver(e,t,n,r,i,a,o,s),registerObserver:(e,t,n)=>this.registerObserver(e,t,n),removeObserver:(e,t)=>this.removeObserver(e,t),updateObserver:(e,t)=>this.cache.update(e,t)}}create(e,t){return this.ensureClientActive(),new n(this.host,e,t)}findInvalidationObserver(e){for(let t of e.observers){let e=t;if(e.canRefreshFromInvalidation())return e}}canResume(e){for(let t of e.observers)if(t.canRefreshAutomatically())return!0;return!1}foregroundEntered(){for(let e of[...this.observers])this.observers.has(e)&&e.foregroundEntered()}rebindAfterScope(e){for(let t of[...this.observers]){if(!e())return;if(!this.observers.has(t))continue;let n=t.getOptions(),r=this.cache.configure(t.getHash(),n);r.observers.add(t),t.replaceEntryAfterScope(r)}}dispose(){for(let e of this.observers)e.disposeFromClient();this.observers.clear()}registerObserver(e,t,n){let r=this.cache.configure(n,t);return this.cache.clearGc(r),r.observers.add(e),this.observers.add(e),r}rebindObserver(t,n,r,i,a,o,s,c){let l=this.cache.configure(i,r);if(!this.cache.isCurrent(l))throw new e;let u=t;if(!this.observers.has(u))return this.cache.scheduleGc(l),l;if(n.observers.delete(t),this.cache.clearGc(l),l.observers.add(t),t.commitRebind(l,r,i,a,o,s,c)||l.observers.delete(t),this.releaseUnobserved(n),!this.cache.isCurrent(l))throw new e;return l.observers.has(t)||this.cache.scheduleGc(l),l}removeObserver(e,t){t.observers.delete(e),this.observers.delete(e),this.releaseUnobserved(t)}fetchObserver(t,n,r){this.ensureClientActive();let a=t.getOptions(),o=this.cache.get(t.getHash());return!o||!o.observers.has(t)?Promise.reject(new e):(this.cache.update(o,a),this.cache.clearGc(o),i(this.fetchRuntime,o,a,n,!1,r))}releaseUnobserved(e){e.observers.size>0||(e.pending&&!e.pending.imperative&&r(e),this.cache.scheduleGc(e))}};export{a as QueryObserverManager};
2
2
  //# sourceMappingURL=observerManager.mjs.map
@@ -1,4 +1,3 @@
1
- //#region src/core/types.d.ts
2
1
  export type QueryKey = readonly unknown[];
3
2
  declare const queryDataTag: unique symbol;
4
3
  interface QueryDataTag<TData> {
@@ -130,6 +129,5 @@ export interface InfiniteQueryObserver<TPage, TPageParam, TKey extends QueryKey
130
129
  hasNextPage: () => boolean;
131
130
  destroy: () => void;
132
131
  }
133
- //#endregion
134
132
  export {};
135
133
  //# sourceMappingURL=types.d.mts.map
@@ -1,8 +1,6 @@
1
1
  import { QueryOptions, TaggedQueryKey, UntaggedQueryKey } from "./core/types.mjs";
2
- //#region src/options.d.ts
3
2
  /** 为可复用查询定义关联缓存键和数据类型,不引入运行时包装。 */
4
3
  export declare function defineQueryOptions<TData, TKey extends UntaggedQueryKey>(options: QueryOptions<TData, TKey>): Omit<QueryOptions<TData, TKey>, 'key'> & {
5
4
  key: TaggedQueryKey<TKey, TData>;
6
5
  };
7
- //#endregion
8
6
  //# sourceMappingURL=options.d.mts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wevu/query",
3
3
  "type": "module",
4
- "version": "0.0.9",
4
+ "version": "0.1.0",
5
5
  "description": "面向 Wevu 小程序的查询缓存、变更与分页状态管理",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/weapp-vite/weapp-vite#readme",
@@ -38,18 +38,18 @@
38
38
  "dist"
39
39
  ],
40
40
  "engines": {
41
- "node": "^20.19.0 || >=22.12.0"
41
+ "node": "^22.23.4 || ^24.22.1 || >=26.12.1"
42
42
  },
43
43
  "peerDependencies": {
44
- "wevu": "7.6.0"
44
+ "wevu": "7.7.0"
45
45
  },
46
46
  "dependencies": {
47
- "@wevu/web-apis": "1.3.6"
47
+ "@wevu/web-apis": "1.4.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@wevu/test-utils": "1.0.1",
50
+ "@wevu/test-utils": "1.1.0",
51
51
  "miniprogram-api-typings": "^5.2.3",
52
- "wevu": "7.6.0"
52
+ "wevu": "7.7.0"
53
53
  },
54
54
  "tsd": {
55
55
  "compilerOptions": {