@echojs-ecosystem/query 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.
@@ -0,0 +1,822 @@
1
+ import * as _echojs_ecosystem_reactivity from '@echojs-ecosystem/reactivity';
2
+ import { ReadonlySignal } from '@echojs-ecosystem/reactivity';
3
+
4
+ type Listener<TEvent> = (event: TEvent) => void;
5
+ declare class Subscribable<TEvent> {
6
+ protected listeners: Set<Listener<TEvent>>;
7
+ subscribe(listener: Listener<TEvent>): () => void;
8
+ protected notify(event: TEvent): void;
9
+ hasListeners(): boolean;
10
+ }
11
+
12
+ type AbortInput$1 = AbortController | AbortSignal | (() => AbortController | AbortSignal);
13
+ type FetchAbortSource = {
14
+ abortController?: AbortInput$1;
15
+ signal?: AbortInput$1;
16
+ };
17
+ type FetchAbortHandle = {
18
+ readonly controller: AbortController;
19
+ readonly signal: AbortSignal;
20
+ /** `false` when user passed their own AbortController */
21
+ readonly ownsController: boolean;
22
+ abort(reason?: unknown): void;
23
+ dispose(): void;
24
+ };
25
+ type CancelOptions$2 = {
26
+ silent?: boolean;
27
+ reason?: unknown;
28
+ };
29
+ declare const resolveAbortInput: (input?: AbortInput$1) => AbortController | AbortSignal | undefined;
30
+ declare const abortWithReason: (controller: AbortController | undefined, reason?: unknown) => void;
31
+ declare const mergeFetchAbortSource: (...sources: (FetchAbortSource | undefined)[]) => FetchAbortSource;
32
+ /** Creates the effective AbortController/signal for one fetch or mutation run. */
33
+ declare const createFetchAbortHandle: (source?: FetchAbortSource) => FetchAbortHandle;
34
+
35
+ type InfiniteQueryState<TPage, TPageParam, TError> = {
36
+ data: InfiniteQueryData<TPage, TPageParam> | undefined;
37
+ error: TError | null;
38
+ status: QueryStatus;
39
+ fetchStatus: QueryFetchStatus;
40
+ dataUpdatedAt: number;
41
+ errorUpdatedAt: number;
42
+ fetchFailureCount: number;
43
+ isInvalidated: boolean;
44
+ hadSuccess: boolean;
45
+ fetchingNextPage: boolean;
46
+ fetchingPreviousPage: boolean;
47
+ };
48
+
49
+ declare class Removable {
50
+ protected gcTimeoutId: ReturnType<typeof setTimeout> | undefined;
51
+ protected gcTimeMs: number;
52
+ protected scheduleGc(onRemove: () => void): void;
53
+ protected clearGcTimeout(): void;
54
+ updateGcTime(cacheTimeMs: number): void;
55
+ }
56
+
57
+ type InfiniteQueryObserverLike = {
58
+ onInfiniteQueryUpdate(): void;
59
+ };
60
+ type InfiniteQueryConfig<TPage, TParams = void, TPageParam = unknown, TError = unknown> = {
61
+ client: QueryClient$1;
62
+ cache: InfiniteQueryCache;
63
+ definition: InfiniteQueryDefinition<TPage, TParams, TPageParam, TError>;
64
+ params: TParams;
65
+ queryKey: QueryKey;
66
+ options: ResolvedInfiniteInstanceOptions<TPage, TParams, TPageParam, TError>;
67
+ };
68
+ declare const hasInfiniteNextPage: <TPage, TPageParam>(data: InfiniteQueryData<TPage, TPageParam> | undefined, getNextPageParam: (lastPage: TPage, allPages: TPage[]) => TPageParam | undefined | null) => boolean;
69
+ declare const hasInfinitePreviousPage: <TPage, TPageParam>(data: InfiniteQueryData<TPage, TPageParam> | undefined, getPreviousPageParam: ((firstPage: TPage, allPages: TPage[]) => TPageParam | undefined | null) | undefined) => boolean;
70
+ declare class InfiniteQuery<TPage, TParams = void, TPageParam = unknown, TError = unknown> extends Removable {
71
+ #private;
72
+ readonly queryKey: QueryKey;
73
+ readonly queryHash: string;
74
+ readonly definition: InfiniteQueryDefinition<TPage, TParams, TPageParam, TError>;
75
+ readonly client: QueryClient$1;
76
+ params: TParams;
77
+ options: ResolvedInfiniteInstanceOptions<TPage, TParams, TPageParam, TError>;
78
+ state: InfiniteQueryState<TPage, TPageParam, TError>;
79
+ observers: Set<InfiniteQueryObserverLike>;
80
+ readonly $data: _echojs_ecosystem_reactivity.Signal<InfiniteQueryData<TPage, TPageParam> | undefined>;
81
+ readonly $error: _echojs_ecosystem_reactivity.Signal<TError | null>;
82
+ readonly $status: _echojs_ecosystem_reactivity.Signal<QueryStatus>;
83
+ readonly $fetchStatus: _echojs_ecosystem_reactivity.Signal<QueryFetchStatus>;
84
+ readonly $pendingCount: _echojs_ecosystem_reactivity.Signal<number>;
85
+ readonly $updatedAt: _echojs_ecosystem_reactivity.Signal<number | null>;
86
+ readonly $isInvalidated: _echojs_ecosystem_reactivity.Signal<boolean>;
87
+ readonly $fetchingNextPage: _echojs_ecosystem_reactivity.Signal<boolean>;
88
+ readonly $fetchingPreviousPage: _echojs_ecosystem_reactivity.Signal<boolean>;
89
+ constructor(config: InfiniteQueryConfig<TPage, TParams, TPageParam, TError>);
90
+ isActive(): boolean;
91
+ isStale(): boolean;
92
+ hasData(): boolean;
93
+ hasNextPage(): boolean;
94
+ hasPreviousPage(): boolean;
95
+ addObserver(observer: InfiniteQueryObserverLike): void;
96
+ removeObserver(observer: InfiniteQueryObserverLike): void;
97
+ reset(): void;
98
+ getAbortController(): AbortController | undefined;
99
+ getAbortSignal(): AbortSignal | undefined;
100
+ cancel(options?: CancelOptions$2): Promise<void>;
101
+ refetch(options?: RefetchOptions): Promise<InfiniteQueryData<TPage, TPageParam>>;
102
+ fetchNextPage(options?: FetchAbortSource): Promise<TPage | null>;
103
+ fetchPreviousPage(options?: FetchAbortSource): Promise<TPage | null>;
104
+ fetchPage(direction: InfiniteQueryFetchDirection, abortSource?: FetchAbortSource): Promise<TPage | null>;
105
+ onFocus(): void;
106
+ onOnline(): void;
107
+ private syncSignals;
108
+ }
109
+
110
+ type QueryFilters = {
111
+ exact?: boolean;
112
+ queryKey?: QueryKey;
113
+ stale?: boolean;
114
+ fetchStatus?: QueryFetchStatus;
115
+ status?: QueryStatus;
116
+ predicate?: (query: QueryLike) => boolean;
117
+ };
118
+ type QueryLike = {
119
+ queryKey: QueryKey;
120
+ queryHash: string;
121
+ isStale(): boolean;
122
+ isActive(): boolean;
123
+ state: {
124
+ fetchStatus: QueryFetchStatus;
125
+ status: QueryStatus;
126
+ };
127
+ };
128
+ /** TanStack Query matchQuery — filter queries in cache. */
129
+ declare const matchQuery: (filters: QueryFilters, query: QueryLike) => boolean;
130
+
131
+ declare class InfiniteQueryCache extends Subscribable<InfiniteQueryCacheEvent> {
132
+ #private;
133
+ get(queryHash: string): InfiniteQuery<unknown, void, unknown, unknown> | undefined;
134
+ getByKey(queryKey: QueryKey): InfiniteQuery<unknown, void, unknown, unknown> | undefined;
135
+ getAll(): InfiniteQuery<unknown, void, unknown, unknown>[];
136
+ build<TPage, TParams = void, TPageParam = unknown, TError = unknown>(config: InfiniteQueryConfig<TPage, TParams, TPageParam, TError>): InfiniteQuery<TPage, TParams, TPageParam, TError>;
137
+ add<TPage, TParams = void, TPageParam = unknown, TError = unknown>(query: InfiniteQuery<TPage, TParams, TPageParam, TError>): void;
138
+ remove<TPage, TParams = void, TPageParam = unknown, TError = unknown>(query: InfiniteQuery<TPage, TParams, TPageParam, TError>): void;
139
+ find(filters: QueryFilters): InfiniteQuery<unknown, void, unknown, unknown> | undefined;
140
+ findAll(filter?: QueryFilter): InfiniteQuery<unknown, void, unknown, unknown>[];
141
+ clear(): void;
142
+ emit(event: InfiniteQueryCacheEvent): void;
143
+ onFocus(): void;
144
+ onOnline(): void;
145
+ }
146
+
147
+ type QueryState<Data, Error> = {
148
+ data: Data | undefined;
149
+ error: Error | null;
150
+ status: QueryStatus;
151
+ fetchStatus: QueryFetchStatus;
152
+ dataUpdatedAt: number;
153
+ errorUpdatedAt: number;
154
+ fetchFailureCount: number;
155
+ isInvalidated: boolean;
156
+ hadSuccess: boolean;
157
+ };
158
+
159
+ type QueryObserverLike = {
160
+ onQueryUpdate(): void;
161
+ };
162
+ type QueryConfig<TData, TParams = void, TError = unknown, TQueryData = TData> = {
163
+ client: QueryClient$1;
164
+ cache: QueryCache;
165
+ definition: QueryDefinition<TData, TParams, TError, TQueryData>;
166
+ params: TParams;
167
+ queryKey: QueryKey;
168
+ options: ResolvedInstanceOptions<TData, TParams, TError>;
169
+ };
170
+ declare class Query<TData, TParams = void, TError = unknown, TQueryData = TData> extends Removable {
171
+ #private;
172
+ readonly queryKey: QueryKey;
173
+ readonly queryHash: string;
174
+ readonly definition: QueryDefinition<TData, TParams, TError, TQueryData>;
175
+ readonly client: QueryClient$1;
176
+ params: TParams;
177
+ options: ResolvedInstanceOptions<TData, TParams, TError>;
178
+ state: QueryState<TData, TError>;
179
+ observers: Set<QueryObserverLike>;
180
+ readonly $data: _echojs_ecosystem_reactivity.Signal<TData | undefined>;
181
+ readonly $error: _echojs_ecosystem_reactivity.Signal<TError | null>;
182
+ readonly $status: _echojs_ecosystem_reactivity.Signal<QueryStatus>;
183
+ readonly $fetchStatus: _echojs_ecosystem_reactivity.Signal<QueryFetchStatus>;
184
+ readonly $pendingCount: _echojs_ecosystem_reactivity.Signal<number>;
185
+ readonly $updatedAt: _echojs_ecosystem_reactivity.Signal<number | null>;
186
+ readonly $isInvalidated: _echojs_ecosystem_reactivity.Signal<boolean>;
187
+ constructor(config: QueryConfig<TData, TParams, TError, TQueryData>);
188
+ get promise(): Promise<TData> | undefined;
189
+ isActive(): boolean;
190
+ isStale(): boolean;
191
+ isStaleByTime(staleTimeMs?: number): boolean;
192
+ hasData(): boolean;
193
+ addObserver(observer: QueryObserverLike): void;
194
+ removeObserver(observer: QueryObserverLike): void;
195
+ setData(updater: TData | ((prev: TData | undefined) => TData | undefined)): TData | undefined;
196
+ invalidate(): void;
197
+ getAbortController(): AbortController | undefined;
198
+ getAbortSignal(): AbortSignal | undefined;
199
+ cancel(options?: CancelOptions$2): Promise<void>;
200
+ fetch(options?: {
201
+ cancelRefetch?: boolean;
202
+ } & FetchAbortSource): Promise<TData>;
203
+ onFocus(): void;
204
+ onOnline(): void;
205
+ private syncSignals;
206
+ }
207
+
208
+ declare class QueryCache extends Subscribable<QueryCacheEvent> {
209
+ #private;
210
+ get(queryHash: string): Query<unknown, void, unknown> | undefined;
211
+ getByKey(queryKey: QueryKey): Query<unknown, void, unknown> | undefined;
212
+ getAll(): Query<unknown, void, unknown>[];
213
+ build<TData, TParams = void, TError = unknown, TQueryData = TData>(config: QueryConfig<TData, TParams, TError, TQueryData>): Query<TData, TParams, TError, TQueryData>;
214
+ add<TData, TParams = void, TError = unknown, TQueryData = TData>(query: Query<TData, TParams, TError, TQueryData>): void;
215
+ remove<TData, TParams = void, TError = unknown, TQueryData = TData>(query: Query<TData, TParams, TError, TQueryData>): void;
216
+ find(filters: QueryFilters): Query<unknown, void, unknown> | undefined;
217
+ findAll(filter?: QueryFilter): Query<unknown, void, unknown>[];
218
+ clear(): void;
219
+ emit(event: QueryCacheEvent): void;
220
+ onFocus(): void;
221
+ onOnline(): void;
222
+ }
223
+
224
+ declare class MutationCache extends Subscribable<MutationCacheEvent> {
225
+ emit(event: MutationCacheEvent): void;
226
+ clear(): void;
227
+ }
228
+
229
+ type QueryKey = readonly unknown[];
230
+ type AbortInput = AbortController | AbortSignal | (() => AbortController | AbortSignal);
231
+ /** Per-fetch / per-run abort wiring — external controller, external signal, or auto (default). */
232
+ type AbortControlOptions = {
233
+ /** User-owned controller — `cancel()` / `abort()` also call `.abort()` on it */
234
+ abortController?: AbortInput;
235
+ /** External signal — when it aborts, the in-flight operation stops */
236
+ signal?: AbortInput;
237
+ };
238
+ type CancelOptions$1 = {
239
+ silent?: boolean;
240
+ reason?: unknown;
241
+ };
242
+ type FetchPageOptions = AbortControlOptions;
243
+ type MutationRunOptions = AbortControlOptions;
244
+ type AbortCapable = {
245
+ /** Current in-flight AbortController, if any */
246
+ abortController(): AbortController | null;
247
+ /** Current in-flight AbortSignal, if any */
248
+ abortSignal(): AbortSignal | null;
249
+ /** Abort the in-flight operation (alias for cancel with reason) */
250
+ abort(reason?: unknown): void;
251
+ };
252
+ type QueryStatus = 'idle' | 'pending' | 'success' | 'error';
253
+ type QueryFetchStatus = 'idle' | 'fetching' | 'paused';
254
+ type MutationStatus = 'idle' | 'pending' | 'success' | 'error';
255
+ type StoreLike<Value> = {
256
+ value(): Value;
257
+ subscribe(listener: (value: Value, prevValue: Value) => void): () => void;
258
+ };
259
+ type QueryClientConfig = {
260
+ defaultOptions?: {
261
+ queries?: Partial<QueryOptions<unknown, void>>;
262
+ mutations?: Partial<MutationOptions<unknown, unknown>>;
263
+ };
264
+ };
265
+ /**
266
+ * Query generics:
267
+ * - `TData` — тип данных в кэше / instance (после `transform`)
268
+ * - `TParams` — параметры запроса (аргумент `queryKey` / `.with()`)
269
+ * - `TError` — тип ошибки
270
+ * - `TQueryData` — сырой ответ `queryFn` (до `transform`, по умолчанию = `TData`)
271
+ */
272
+ type QueryFnContext<TParams, TQueryData, TError = unknown> = {
273
+ params: TParams;
274
+ signal: AbortSignal;
275
+ abortController: AbortController;
276
+ queryClient: QueryClient$1;
277
+ queryKey: QueryKey;
278
+ };
279
+ type QueryLifecycleContext<TData, TParams, TError = unknown> = {
280
+ data?: TData;
281
+ error?: TError | null;
282
+ params: TParams;
283
+ queryKey: QueryKey;
284
+ queryClient: QueryClient$1;
285
+ };
286
+ type QueryOptions<TData, TParams = void, TError = unknown, TQueryData = TData> = {
287
+ name?: string;
288
+ queryKey: (params: TParams) => QueryKey;
289
+ queryFn: (ctx: QueryFnContext<TParams, TQueryData, TError>) => Promise<TQueryData>;
290
+ transform?: (data: TQueryData) => TData | Promise<TData>;
291
+ staleTime?: number;
292
+ cacheTime?: number;
293
+ retry?: number | false | ((failureCount: number, error: unknown) => boolean);
294
+ retryDelay?: number | ((failureCount: number, error: unknown) => number);
295
+ keepPreviousData?: boolean;
296
+ abortPrevious?: boolean;
297
+ abortController?: AbortInput;
298
+ signal?: AbortInput;
299
+ enabled?: boolean | (() => boolean);
300
+ refetchOnMount?: boolean | 'stale';
301
+ refetchOnWindowFocus?: boolean;
302
+ refetchOnReconnect?: boolean;
303
+ onStart?: (ctx: QueryLifecycleContext<TData, TParams, TError>) => void;
304
+ onSuccess?: (ctx: QueryLifecycleContext<TData, TParams, TError>) => void;
305
+ onError?: (ctx: QueryLifecycleContext<TData, TParams, TError>) => void;
306
+ onSettled?: (ctx: QueryLifecycleContext<TData, TParams, TError>) => void;
307
+ };
308
+ type QueryInstanceOptions<TData = unknown, TParams = void, TError = unknown> = {
309
+ client?: QueryClient$1;
310
+ enabled?: boolean | (() => boolean);
311
+ refetchOnMount?: boolean | 'stale';
312
+ refetchOnWindowFocus?: boolean;
313
+ refetchOnReconnect?: boolean;
314
+ keepPreviousData?: boolean;
315
+ abortPrevious?: boolean;
316
+ abortController?: AbortInput;
317
+ signal?: AbortInput;
318
+ staleTime?: number;
319
+ cacheTime?: number;
320
+ retry?: number | false | ((failureCount: number, error: unknown) => boolean);
321
+ retryDelay?: number | ((failureCount: number, error: unknown) => number);
322
+ onStart?: (ctx: QueryLifecycleContext<TData, TParams, TError>) => void;
323
+ onSuccess?: (ctx: QueryLifecycleContext<TData, TParams, TError>) => void;
324
+ onError?: (ctx: QueryLifecycleContext<TData, TParams, TError>) => void;
325
+ onSettled?: (ctx: QueryLifecycleContext<TData, TParams, TError>) => void;
326
+ };
327
+ type RefetchOptions = {
328
+ throwOnError?: boolean;
329
+ } & AbortControlOptions;
330
+ type InvalidateQueriesOptions = {
331
+ exact?: boolean;
332
+ /** Default: `'active'` — refetch only queries with observers */
333
+ refetch?: boolean | 'active' | 'all' | 'none';
334
+ };
335
+ type QueryDefinition<TData, TParams = void, TError = unknown, TQueryData = TData> = {
336
+ readonly kind: 'query-definition';
337
+ readonly name?: string;
338
+ readonly options: QueryOptions<TData, TParams, TError, TQueryData>;
339
+ queryKey(params: TParams): QueryKey;
340
+ with(params: TParams | (() => TParams), options?: QueryInstanceOptions<TData, TParams, TError>): QueryInstance<TData, TParams, TError>;
341
+ withStore<StoreValue>(store: StoreLike<StoreValue>, map: (value: StoreValue) => TParams, options?: QueryInstanceOptions<TData, TParams, TError>): QueryInstance<TData, TParams, TError>;
342
+ };
343
+ type QueryInstance<TData, TParams = void, TError = unknown> = AbortCapable & {
344
+ readonly kind: 'query-instance';
345
+ value(): TData | undefined;
346
+ data(): TData | undefined;
347
+ error(): TError | null;
348
+ params(): TParams;
349
+ status(): QueryStatus;
350
+ fetchStatus(): QueryFetchStatus;
351
+ pending(): boolean;
352
+ isPending(): boolean;
353
+ isFirstPending(): boolean;
354
+ isFetching(): boolean;
355
+ isRefetching(): boolean;
356
+ isSuccess(): boolean;
357
+ isError(): boolean;
358
+ isIdle(): boolean;
359
+ isStale(): boolean;
360
+ isPaused(): boolean;
361
+ hasData(): boolean;
362
+ hasError(): boolean;
363
+ refetch(options?: RefetchOptions): Promise<TData>;
364
+ invalidate(): void;
365
+ cancel(options?: CancelOptions$1): void;
366
+ remove(): void;
367
+ subscribe(listener: (data: TData | undefined) => void): () => void;
368
+ $data: ReadonlySignal<TData | undefined>;
369
+ $error: ReadonlySignal<TError | null>;
370
+ $params: ReadonlySignal<TParams>;
371
+ $status: ReadonlySignal<QueryStatus>;
372
+ $fetchStatus: ReadonlySignal<QueryFetchStatus>;
373
+ $pendingCount: ReadonlySignal<number>;
374
+ $isStale: ReadonlySignal<boolean>;
375
+ $updatedAt: ReadonlySignal<number | null>;
376
+ $abortSignal: ReadonlySignal<AbortSignal | null>;
377
+ };
378
+ type QueryFilter = QueryKey | {
379
+ queryKey: QueryKey;
380
+ exact?: boolean;
381
+ };
382
+ type InfiniteQueryData<TPage, TPageParam> = {
383
+ pages: TPage[];
384
+ pageParams: TPageParam[];
385
+ };
386
+ type InfiniteQueryFetchDirection = 'initial' | 'next' | 'previous';
387
+ /**
388
+ * Infinite query generics:
389
+ * - `TPage` — одна страница ответа `queryFn`
390
+ * - `TPageParam` — cursor / page param для пагинации
391
+ * - `TParams` — параметры `.with()` / `queryKey`
392
+ * - `TError` — тип ошибки
393
+ */
394
+ type InfiniteQueryFnContext<TParams, TPageParam, TPage, TError = unknown> = {
395
+ params: TParams;
396
+ pageParam: TPageParam;
397
+ signal: AbortSignal;
398
+ abortController: AbortController;
399
+ queryClient: QueryClient$1;
400
+ queryKey: QueryKey;
401
+ };
402
+ type InfiniteQueryLifecycleContext<TPage, TParams, TPageParam, TError = unknown> = {
403
+ data?: InfiniteQueryData<TPage, TPageParam>;
404
+ error?: TError | null;
405
+ params: TParams;
406
+ queryKey: QueryKey;
407
+ queryClient: QueryClient$1;
408
+ };
409
+ type InfiniteQueryOptions<TPage, TParams = void, TPageParam = unknown, TError = unknown> = {
410
+ name?: string;
411
+ queryKey: (params: TParams) => QueryKey;
412
+ queryFn: (ctx: InfiniteQueryFnContext<TParams, TPageParam, TPage, TError>) => Promise<TPage>;
413
+ initialPageParam: TPageParam;
414
+ getNextPageParam: (lastPage: TPage, allPages: TPage[]) => TPageParam | undefined | null;
415
+ getPreviousPageParam?: (firstPage: TPage, allPages: TPage[]) => TPageParam | undefined | null;
416
+ staleTime?: number;
417
+ cacheTime?: number;
418
+ retry?: number | false | ((failureCount: number, error: unknown) => boolean);
419
+ retryDelay?: number | ((failureCount: number, error: unknown) => number);
420
+ keepPreviousData?: boolean;
421
+ abortPrevious?: boolean;
422
+ abortController?: AbortInput;
423
+ signal?: AbortInput;
424
+ enabled?: boolean | (() => boolean);
425
+ refetchOnMount?: boolean | 'stale';
426
+ refetchOnWindowFocus?: boolean;
427
+ refetchOnReconnect?: boolean;
428
+ onStart?: (ctx: InfiniteQueryLifecycleContext<TPage, TParams, TPageParam, TError>) => void;
429
+ onSuccess?: (ctx: InfiniteQueryLifecycleContext<TPage, TParams, TPageParam, TError>) => void;
430
+ onError?: (ctx: InfiniteQueryLifecycleContext<TPage, TParams, TPageParam, TError>) => void;
431
+ onSettled?: (ctx: InfiniteQueryLifecycleContext<TPage, TParams, TPageParam, TError>) => void;
432
+ };
433
+ type InfiniteQueryInstanceOptions<TPage = unknown, TParams = void, TPageParam = unknown, TError = unknown> = {
434
+ client?: QueryClient$1;
435
+ enabled?: boolean | (() => boolean);
436
+ refetchOnMount?: boolean | 'stale';
437
+ refetchOnWindowFocus?: boolean;
438
+ refetchOnReconnect?: boolean;
439
+ keepPreviousData?: boolean;
440
+ abortPrevious?: boolean;
441
+ abortController?: AbortInput;
442
+ signal?: AbortInput;
443
+ staleTime?: number;
444
+ cacheTime?: number;
445
+ retry?: number | false | ((failureCount: number, error: unknown) => boolean);
446
+ retryDelay?: number | ((failureCount: number, error: unknown) => number);
447
+ onStart?: (ctx: InfiniteQueryLifecycleContext<TPage, TParams, TPageParam, TError>) => void;
448
+ onSuccess?: (ctx: InfiniteQueryLifecycleContext<TPage, TParams, TPageParam, TError>) => void;
449
+ onError?: (ctx: InfiniteQueryLifecycleContext<TPage, TParams, TPageParam, TError>) => void;
450
+ onSettled?: (ctx: InfiniteQueryLifecycleContext<TPage, TParams, TPageParam, TError>) => void;
451
+ };
452
+ type InfiniteQueryDefinition<TPage, TParams = void, TPageParam = unknown, TError = unknown> = {
453
+ readonly kind: 'infinite-query-definition';
454
+ readonly name?: string;
455
+ readonly options: InfiniteQueryOptions<TPage, TParams, TPageParam, TError>;
456
+ queryKey(params: TParams): QueryKey;
457
+ with(params: TParams | (() => TParams), options?: InfiniteQueryInstanceOptions<TPage, TParams, TPageParam, TError>): InfiniteQueryInstance<TPage, TPageParam, TParams, TError>;
458
+ withStore<StoreValue>(store: StoreLike<StoreValue>, map: (value: StoreValue) => TParams, options?: InfiniteQueryInstanceOptions<TPage, TParams, TPageParam, TError>): InfiniteQueryInstance<TPage, TPageParam, TParams, TError>;
459
+ };
460
+ type InfiniteQueryInstance<TPage, TPageParam = unknown, TParams = void, TError = unknown> = AbortCapable & {
461
+ readonly kind: 'infinite-query';
462
+ pages(): TPage[];
463
+ pageParams(): TPageParam[];
464
+ data(): InfiniteQueryData<TPage, TPageParam> | null;
465
+ flatMap<TItem>(selector: (page: TPage) => TItem[]): TItem[];
466
+ fetchNextPage(options?: FetchPageOptions): Promise<TPage | null>;
467
+ fetchPreviousPage(options?: FetchPageOptions): Promise<TPage | null>;
468
+ refetch(options?: RefetchOptions): Promise<InfiniteQueryData<TPage, TPageParam>>;
469
+ reset(): void;
470
+ cancel(options?: CancelOptions$1): void;
471
+ remove(): void;
472
+ hasNextPage(): boolean;
473
+ hasPreviousPage(): boolean;
474
+ pending(): boolean;
475
+ fetching(): boolean;
476
+ fetchingNextPage(): boolean;
477
+ fetchingPreviousPage(): boolean;
478
+ error(): TError | null;
479
+ params(): TParams;
480
+ subscribe(listener: (data: InfiniteQueryData<TPage, TPageParam> | null) => void): () => void;
481
+ $data: ReadonlySignal<InfiniteQueryData<TPage, TPageParam> | null>;
482
+ $pages: ReadonlySignal<TPage[]>;
483
+ $pageParams: ReadonlySignal<TPageParam[]>;
484
+ $pending: ReadonlySignal<boolean>;
485
+ $fetching: ReadonlySignal<boolean>;
486
+ $fetchingNextPage: ReadonlySignal<boolean>;
487
+ $fetchingPreviousPage: ReadonlySignal<boolean>;
488
+ $error: ReadonlySignal<TError | null>;
489
+ $params: ReadonlySignal<TParams>;
490
+ $abortSignal: ReadonlySignal<AbortSignal | null>;
491
+ };
492
+ type InfiniteQueryCacheEvent = {
493
+ type: 'infiniteQueryAdded';
494
+ queryKey: QueryKey;
495
+ hash: string;
496
+ } | {
497
+ type: 'infiniteQueryRemoved';
498
+ queryKey: QueryKey;
499
+ hash: string;
500
+ } | {
501
+ type: 'infiniteQueryUpdated';
502
+ queryKey: QueryKey;
503
+ hash: string;
504
+ } | {
505
+ type: 'infiniteQueryFetched';
506
+ queryKey: QueryKey;
507
+ hash: string;
508
+ };
509
+ type ResolvedInfiniteInstanceOptions<TPage, TParams = void, TPageParam = unknown, TError = unknown> = InfiniteQueryInstanceOptions<TPage, TParams, TPageParam, TError> & Required<Pick<InfiniteQueryInstanceOptions<TPage, TParams, TPageParam, TError>, 'enabled' | 'refetchOnMount' | 'refetchOnWindowFocus' | 'refetchOnReconnect' | 'keepPreviousData' | 'abortPrevious'>> & {
510
+ staleTimeMs: number;
511
+ cacheTimeMs: number;
512
+ retry: number | false | ((failureCount: number, error: unknown) => boolean);
513
+ retryDelay: number | ((failureCount: number, error: unknown) => number);
514
+ };
515
+ /**
516
+ * Mutation generics:
517
+ * - `TData` — результат mutation
518
+ * - `TVariables` — входные переменные `.run()`
519
+ * - `TError` — тип ошибки
520
+ * - `TRollback` — контекст отката из `onMutate`
521
+ */
522
+ type MutationFnContext<TVariables, TData, TError = unknown> = {
523
+ variables: TVariables;
524
+ signal: AbortSignal;
525
+ abortController: AbortController;
526
+ queryClient: QueryClient$1;
527
+ };
528
+ type MutationLifecycleContext<TData, TVariables, TError = unknown, TRollback = unknown> = {
529
+ data?: TData;
530
+ error?: TError | null;
531
+ variables: TVariables;
532
+ queryClient: QueryClient$1;
533
+ rollback?: TRollback;
534
+ };
535
+ type MutationOptions<TData, TVariables, TError = unknown, TRollback = unknown> = {
536
+ name?: string;
537
+ mutationFn: (ctx: MutationFnContext<TVariables, TData, TError>) => Promise<TData>;
538
+ abortController?: AbortInput;
539
+ signal?: AbortInput;
540
+ retry?: number | false | ((failureCount: number, error: unknown) => boolean);
541
+ retryDelay?: number | ((failureCount: number, error: unknown) => number);
542
+ onMutate?: (ctx: MutationLifecycleContext<TData, TVariables, TError, TRollback>) => Promise<TRollback | void> | TRollback | void;
543
+ onSuccess?: (ctx: MutationLifecycleContext<TData, TVariables, TError, TRollback>) => void;
544
+ onError?: (ctx: MutationLifecycleContext<TData, TVariables, TError, TRollback>) => void;
545
+ onSettled?: (ctx: MutationLifecycleContext<TData, TVariables, TError, TRollback>) => void;
546
+ };
547
+ type MutationDefinition<TData, TVariables, TError = unknown, TRollback = unknown> = {
548
+ readonly kind: 'mutation-definition';
549
+ readonly name?: string;
550
+ readonly options: MutationOptions<TData, TVariables, TError, TRollback>;
551
+ create(options?: {
552
+ client?: QueryClient$1;
553
+ }): MutationInstance<TData, TVariables, TError>;
554
+ };
555
+ type MutationInstance<TData, TVariables, TError = unknown> = AbortCapable & {
556
+ readonly kind: 'mutation-instance';
557
+ run(variables: TVariables, options?: MutationRunOptions): Promise<TData>;
558
+ reset(): void;
559
+ cancel(options?: CancelOptions$1): void;
560
+ data(): TData | undefined;
561
+ error(): TError | null;
562
+ variables(): TVariables | undefined;
563
+ status(): MutationStatus;
564
+ pending(): boolean;
565
+ isPending(): boolean;
566
+ isSuccess(): boolean;
567
+ isError(): boolean;
568
+ isIdle(): boolean;
569
+ $data: ReadonlySignal<TData | undefined>;
570
+ $error: ReadonlySignal<TError | null>;
571
+ $variables: ReadonlySignal<TVariables | undefined>;
572
+ $status: ReadonlySignal<MutationStatus>;
573
+ $pendingCount: ReadonlySignal<number>;
574
+ $abortSignal: ReadonlySignal<AbortSignal | null>;
575
+ };
576
+ type QueryCacheEvent = {
577
+ type: 'queryAdded';
578
+ queryKey: QueryKey;
579
+ hash: string;
580
+ } | {
581
+ type: 'queryRemoved';
582
+ queryKey: QueryKey;
583
+ hash: string;
584
+ } | {
585
+ type: 'queryUpdated';
586
+ queryKey: QueryKey;
587
+ hash: string;
588
+ } | {
589
+ type: 'queryInvalidated';
590
+ queryKey: QueryKey;
591
+ hash: string;
592
+ } | {
593
+ type: 'queryFetched';
594
+ queryKey: QueryKey;
595
+ hash: string;
596
+ data?: unknown;
597
+ };
598
+ type MutationCacheEvent = {
599
+ type: 'mutationAdded';
600
+ mutationId: number;
601
+ } | {
602
+ type: 'mutationUpdated';
603
+ mutationId: number;
604
+ };
605
+ type QueryClient$1 = {
606
+ readonly queryCache: QueryCache;
607
+ readonly infiniteQueryCache: InfiniteQueryCache;
608
+ readonly mutationCache: MutationCache;
609
+ fetchQuery<TData, TParams = void, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, TParams, TError, TQueryData>, params?: TParams, options?: QueryInstanceOptions<TData, TParams, TError>): Promise<TData>;
610
+ prefetchQuery<TData, TParams = void, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, TParams, TError, TQueryData>, params?: TParams, options?: QueryInstanceOptions<TData, TParams, TError>): Promise<void>;
611
+ ensureQueryData<TData, TParams = void, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, TParams, TError, TQueryData>, params?: TParams, options?: QueryInstanceOptions<TData, TParams, TError>): Promise<TData>;
612
+ getQueryData<TData>(keyOrDefinition: QueryKey): TData | undefined;
613
+ getQueryData<TData, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, void, TError, TQueryData>): TData | undefined;
614
+ getQueryData<TData, TParams, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, TParams, TError, TQueryData>, params: TParams): TData | undefined;
615
+ setQueryData<TData>(keyOrDefinition: QueryKey, updater: TData | ((prev: TData | undefined) => TData | undefined)): void;
616
+ setQueryData<TData>(definition: QueryDefinition<TData, void, unknown, unknown>, updater: TData | ((prev: TData | undefined) => TData | undefined)): void;
617
+ setQueryData<TData, TParams, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, TParams, TError, TQueryData>, params: TParams, updater: TData | ((prev: TData | undefined) => TData | undefined)): void;
618
+ invalidateQueries(filter: QueryFilter, options?: InvalidateQueriesOptions): void;
619
+ refetchQueries(filter: QueryFilter): Promise<void>;
620
+ cancelQueries(filter: QueryFilter): void;
621
+ removeQueries(filter: QueryFilter): void;
622
+ clear(): void;
623
+ };
624
+ type ResolvedInstanceOptions<TData, TParams = void, TError = unknown> = QueryInstanceOptions<TData, TParams, TError> & Required<Pick<QueryInstanceOptions<TData, TParams, TError>, 'enabled' | 'refetchOnMount' | 'refetchOnWindowFocus' | 'refetchOnReconnect' | 'keepPreviousData' | 'abortPrevious'>> & {
625
+ staleTimeMs: number;
626
+ cacheTimeMs: number;
627
+ retry: number | false | ((failureCount: number, error: unknown) => boolean);
628
+ retryDelay: number | ((failureCount: number, error: unknown) => number);
629
+ };
630
+
631
+ declare class QueryClient {
632
+ readonly queryCache: QueryCache;
633
+ readonly infiniteQueryCache: InfiniteQueryCache;
634
+ readonly mutationCache: MutationCache;
635
+ constructor(config?: QueryClientConfig);
636
+ fetchQuery<TData, TParams = void, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, TParams, TError, TQueryData>, params?: TParams, options?: QueryInstanceOptions<TData, TParams, TError>): Promise<TData>;
637
+ prefetchQuery<TData, TParams = void, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, TParams, TError, TQueryData>, params?: TParams, options?: QueryInstanceOptions<TData, TParams, TError>): Promise<void>;
638
+ ensureQueryData<TData, TParams = void, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, TParams, TError, TQueryData>, params?: TParams, options?: QueryInstanceOptions<TData, TParams, TError>): Promise<TData>;
639
+ getQueryData<TData>(keyOrDefinition: QueryKey): TData | undefined;
640
+ getQueryData<TData, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, void, TError, TQueryData>): TData | undefined;
641
+ getQueryData<TData, TParams, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, TParams, TError, TQueryData>, params: TParams): TData | undefined;
642
+ setQueryData<TData>(keyOrDefinition: QueryKey, updater: TData | ((prev: TData | undefined) => TData | undefined)): void;
643
+ setQueryData<TData>(definition: QueryDefinition<TData, void, unknown, unknown>, updater: TData | ((prev: TData | undefined) => TData | undefined)): void;
644
+ setQueryData<TData, TParams, TError = unknown, TQueryData = TData>(definition: QueryDefinition<TData, TParams, TError, TQueryData>, params: TParams, updater: TData | ((prev: TData | undefined) => TData | undefined)): void;
645
+ invalidateQueries(filter: QueryFilter, options?: InvalidateQueriesOptions): void;
646
+ refetchQueries(filter: QueryFilter): Promise<void>;
647
+ cancelQueries(filter: QueryFilter): void;
648
+ removeQueries(filter: QueryFilter): void;
649
+ clear(): void;
650
+ }
651
+ declare const createQueryClient: (config?: QueryClientConfig) => QueryClient;
652
+
653
+ type QueryProviderDefaultOptions = {
654
+ queries?: Partial<Omit<QueryOptions<unknown, void>, 'queryKey' | 'queryFn'>>;
655
+ mutations?: Partial<Omit<MutationOptions<unknown, unknown>, 'mutationFn'>>;
656
+ };
657
+ type QueryProviderConfig = QueryClientConfig & {
658
+ client?: QueryClient$1;
659
+ defaultOptions?: QueryProviderDefaultOptions;
660
+ };
661
+
662
+ declare const getQueryProvider: () => QueryProvider | null;
663
+ declare const requireQueryProvider: () => QueryProvider;
664
+ declare const resetQueryProvider: () => void;
665
+
666
+ declare class QueryProvider {
667
+ readonly client: QueryClient;
668
+ readonly config: QueryProviderConfig;
669
+ constructor(config?: QueryProviderConfig);
670
+ createQuery: <TData, TParams = void, TError = unknown, TQueryData = TData>(options: QueryOptions<TData, TParams, TError, TQueryData>) => QueryDefinition<TData, TParams, TError, TQueryData>;
671
+ createMutation: <TData, TVariables, TError = unknown, TRollback = unknown>(options: MutationOptions<TData, TVariables, TError, TRollback>) => MutationDefinition<TData, TVariables, TError, TRollback>;
672
+ createInfiniteQuery: <TPage, TParams = void, TPageParam = unknown, TError = unknown>(options: InfiniteQueryOptions<TPage, TParams, TPageParam, TError>) => InfiniteQueryDefinition<TPage, TParams, TPageParam, TError>;
673
+ invalidateQueries(filter: QueryFilter, options?: InvalidateQueriesOptions): void;
674
+ refetchQueries(filter: QueryFilter): Promise<void>;
675
+ cancelQueries(filter: QueryFilter): void;
676
+ removeQueries(filter: QueryFilter): void;
677
+ }
678
+ declare const setQueryProvider: (provider: QueryProvider) => void;
679
+
680
+ type CreateQueryMeta = {
681
+ provider?: QueryProvider | null;
682
+ };
683
+ declare const createQuery: <TData, TParams = void, TError = unknown, TQueryData = TData>(options: QueryOptions<TData, TParams, TError, TQueryData>, meta?: CreateQueryMeta) => QueryDefinition<TData, TParams, TError, TQueryData>;
684
+
685
+ type CreateInfiniteQueryMeta = {
686
+ provider?: QueryProvider | null;
687
+ };
688
+ declare const createInfiniteQuery: <TPage, TParams = void, TPageParam = unknown, TError = unknown>(options: InfiniteQueryOptions<TPage, TParams, TPageParam, TError>, meta?: CreateInfiniteQueryMeta) => InfiniteQueryDefinition<TPage, TParams, TPageParam, TError>;
689
+
690
+ declare const setDefaultQueryClient: (client: QueryClient$1) => void;
691
+ declare const getDefaultQueryClient: () => QueryClient$1;
692
+
693
+ declare const QUERY_PROVIDER_KEY: unique symbol;
694
+ /** Minimal host shape — compatible with {@link EchoApp} from `@echojs-ecosystem/framework/app`. */
695
+ type QueryProviderHost = {
696
+ provide?<T>(key: symbol, value: T): unknown;
697
+ };
698
+ /** @deprecated Use {@link QueryProviderHost} */
699
+ type QueryPluginHost = QueryProviderHost;
700
+ /** Echo app provider with the active {@link QueryProvider} instance. */
701
+ type EchoQueryProvider = {
702
+ name: 'query';
703
+ readonly provider: QueryProvider;
704
+ setup: (app: QueryProviderHost) => void;
705
+ };
706
+ /** @deprecated Use {@link EchoQueryProvider} */
707
+ type EchoQueryPlugin = EchoQueryProvider;
708
+ /** @deprecated Use {@link EchoQueryProvider} */
709
+ type QueryPlugin = EchoQueryProvider;
710
+ /**
711
+ * Creates a query provider: registers the global provider on call and exposes it on `app.use`.
712
+ *
713
+ * ```ts
714
+ * export const queryProvider = createQueryProvider({
715
+ * defaultOptions: { queries: { staleTime: 60_000 } },
716
+ * });
717
+ * ```
718
+ */
719
+ declare const createQueryProvider: (config?: QueryProviderConfig) => EchoQueryProvider;
720
+ /** @deprecated Use {@link createQueryProvider} */
721
+ declare const createQueryPlugin: (config?: QueryProviderConfig) => EchoQueryProvider;
722
+ /** @deprecated Use {@link createQueryProvider} */
723
+ declare const queryPlugin: (config?: QueryProviderConfig) => EchoQueryProvider;
724
+
725
+ declare const createMutation: <TData, TVariables, TError = unknown, TRollback = unknown>(options: MutationOptions<TData, TVariables, TError, TRollback>, meta?: CreateQueryMeta) => MutationDefinition<TData, TVariables, TError, TRollback>;
726
+
727
+ declare class FocusManager {
728
+ #private;
729
+ constructor();
730
+ isFocused(): boolean;
731
+ setFocused(focused: boolean): void;
732
+ subscribe(listener: (focused: boolean) => void): () => void;
733
+ onClientRegistered(client: QueryClient$1): void;
734
+ }
735
+ declare const focusManager: FocusManager;
736
+
737
+ declare class OnlineManager {
738
+ #private;
739
+ constructor();
740
+ isOnline(): boolean;
741
+ setOnline(online: boolean): void;
742
+ subscribe(listener: (online: boolean) => void): () => void;
743
+ onClientRegistered(client: QueryClient$1): void;
744
+ }
745
+ declare const onlineManager: OnlineManager;
746
+
747
+ declare class Mutation<TData, TVariables, TError = unknown, TRollback = unknown> {
748
+ #private;
749
+ readonly id: number;
750
+ readonly definition: MutationDefinition<TData, TVariables, TError, TRollback>;
751
+ readonly client: QueryClient$1;
752
+ readonly cache: MutationCache;
753
+ readonly $data: _echojs_ecosystem_reactivity.Signal<TData | undefined>;
754
+ readonly $error: _echojs_ecosystem_reactivity.Signal<TError | null>;
755
+ readonly $variables: _echojs_ecosystem_reactivity.Signal<TVariables | undefined>;
756
+ readonly $status: _echojs_ecosystem_reactivity.Signal<MutationStatus>;
757
+ readonly $pendingCount: _echojs_ecosystem_reactivity.Signal<number>;
758
+ constructor(definition: MutationDefinition<TData, TVariables, TError, TRollback>, client: QueryClient$1, cache: MutationCache);
759
+ getAbortController(): AbortController | undefined;
760
+ getAbortSignal(): AbortSignal | undefined;
761
+ run(variables: TVariables, runOptions?: MutationRunOptions): Promise<TData>;
762
+ cancel(options?: CancelOptions$2): void;
763
+ reset(): void;
764
+ toInstance(): MutationInstance<TData, TVariables, TError>;
765
+ }
766
+
767
+ declare class QueryObserver<TData, TParams = void, TError = unknown, TQueryData = TData> {
768
+ #private;
769
+ readonly definition: QueryDefinition<TData, TParams, TError, TQueryData>;
770
+ readonly client: QueryClient$1;
771
+ readonly options: ResolvedInstanceOptions<TData, TParams, TError>;
772
+ constructor(definition: QueryDefinition<TData, TParams, TError, TQueryData>, client: QueryClient$1, params: TParams | (() => TParams), instanceOptions?: QueryInstanceOptions<TData, TParams, TError>);
773
+ getQuery(): Query<TData, TParams, TError, TQueryData> | null;
774
+ getPreviousQuery(): Query<TData, TParams, TError, TQueryData> | null;
775
+ getParams(): TParams;
776
+ onQueryUpdate(): void;
777
+ subscribe(listener: () => void): () => void;
778
+ setParams(params: TParams): void;
779
+ maybeFetch(paramsChanged: boolean): void;
780
+ fetch(options?: RefetchOptions): Promise<TData>;
781
+ refetch(options?: RefetchOptions): Promise<TData>;
782
+ invalidate(): void;
783
+ cancel(options?: CancelOptions$1): Promise<void>;
784
+ remove(): void;
785
+ destroy(): void;
786
+ }
787
+
788
+ declare class InfiniteQueryObserver<TPage, TParams = void, TPageParam = unknown, TError = unknown> {
789
+ #private;
790
+ readonly definition: InfiniteQueryDefinition<TPage, TParams, TPageParam, TError>;
791
+ readonly client: QueryClient$1;
792
+ readonly options: ResolvedInfiniteInstanceOptions<TPage, TParams, TPageParam, TError>;
793
+ constructor(definition: InfiniteQueryDefinition<TPage, TParams, TPageParam, TError>, client: QueryClient$1, params: TParams | (() => TParams), instanceOptions?: InfiniteQueryInstanceOptions<TPage, TParams, TPageParam, TError>);
794
+ getQuery(): InfiniteQuery<TPage, TParams, TPageParam, TError> | null;
795
+ getPreviousQuery(): InfiniteQuery<TPage, TParams, TPageParam, TError> | null;
796
+ getParams(): TParams;
797
+ onInfiniteQueryUpdate(): void;
798
+ subscribe(listener: () => void): () => void;
799
+ setParams(params: TParams): void;
800
+ maybeFetch(paramsChanged: boolean): void;
801
+ cancel(options?: CancelOptions$1): void;
802
+ remove(): void;
803
+ destroy(): void;
804
+ }
805
+
806
+ /** TanStack Query stable hash — sorts object keys recursively. */
807
+ declare const hashKey: (queryKey: QueryKey) => string;
808
+ /** TanStack Query partial key match. */
809
+ declare const partialMatchKey: (a: QueryKey, b: QueryKey) => boolean;
810
+
811
+ type CancelOptions = {
812
+ revert?: boolean;
813
+ silent?: boolean;
814
+ };
815
+ declare class CancelledError extends Error {
816
+ readonly revert?: boolean;
817
+ readonly silent?: boolean;
818
+ constructor(options?: CancelOptions);
819
+ }
820
+ declare const isCancelledError: (value: unknown) => value is CancelledError;
821
+
822
+ export { type AbortCapable, type AbortControlOptions, type AbortInput, type CancelOptions$1 as CancelOptions, CancelledError, type EchoQueryPlugin, type EchoQueryProvider, type FetchPageOptions, FocusManager, InfiniteQuery, InfiniteQueryCache, type InfiniteQueryData, type InfiniteQueryDefinition, type InfiniteQueryFnContext, type InfiniteQueryInstance, type InfiniteQueryInstanceOptions, InfiniteQueryObserver, type InfiniteQueryOptions, type InvalidateQueriesOptions, Mutation, MutationCache, type MutationDefinition, type MutationFnContext, type MutationInstance, type MutationOptions, type MutationRunOptions, type MutationStatus, OnlineManager, QUERY_PROVIDER_KEY, Query, QueryCache, QueryClient, type QueryClientConfig, type QueryDefinition, type QueryFetchStatus, type QueryFilter, type QueryFnContext, type QueryInstance, type QueryInstanceOptions, type QueryKey, QueryObserver, type QueryOptions, type QueryPlugin, type QueryPluginHost, QueryProvider, type QueryProviderConfig, type QueryProviderDefaultOptions, type QueryProviderHost, type QueryStatus, type RefetchOptions, type StoreLike, abortWithReason, createFetchAbortHandle, createInfiniteQuery, createMutation, createQuery, createQueryClient, createQueryPlugin, createQueryProvider, focusManager, getDefaultQueryClient, getQueryProvider, hasInfiniteNextPage, hasInfinitePreviousPage, hashKey, isCancelledError, matchQuery, mergeFetchAbortSource, onlineManager, partialMatchKey, queryPlugin, requireQueryProvider, resetQueryProvider, resolveAbortInput, setDefaultQueryClient, setQueryProvider };