@zenstackhq/tanstack-query 3.0.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/client.d.ts +4 -0
- package/dist/common/client.js +38 -0
- package/dist/common/client.js.map +1 -0
- package/dist/common/query-key.d.ts +39 -0
- package/dist/common/query-key.js +38 -0
- package/dist/common/query-key.js.map +1 -0
- package/dist/common/types.d.ts +60 -0
- package/dist/common/types.js +2 -0
- package/dist/common/types.js.map +1 -0
- package/dist/react.d.ts +99 -150
- package/dist/react.js +248 -1178
- package/dist/react.js.map +1 -1
- package/dist/svelte/index.svelte.d.ts +79 -0
- package/dist/svelte/index.svelte.js +245 -0
- package/dist/vue.d.ts +313 -342
- package/dist/vue.js +224 -1138
- package/dist/vue.js.map +1 -1
- package/package.json +36 -48
- package/.turbo/turbo-build.log +0 -47
- package/dist/react.cjs +0 -1240
- package/dist/react.cjs.map +0 -1
- package/dist/react.d.cts +0 -616
- package/dist/svelte.cjs +0 -1224
- package/dist/svelte.cjs.map +0 -1
- package/dist/svelte.d.cts +0 -381
- package/dist/svelte.d.ts +0 -381
- package/dist/svelte.js +0 -1183
- package/dist/svelte.js.map +0 -1
- package/dist/types-C8iIZD-7.d.cts +0 -99
- package/dist/types-C8iIZD-7.d.ts +0 -99
- package/dist/vue.cjs +0 -1192
- package/dist/vue.cjs.map +0 -1
- package/dist/vue.d.cts +0 -382
- package/eslint.config.js +0 -4
- package/src/react.ts +0 -562
- package/src/svelte.ts +0 -502
- package/src/utils/common.ts +0 -448
- package/src/utils/mutator.ts +0 -441
- package/src/utils/nested-read-visitor.ts +0 -61
- package/src/utils/nested-write-visitor.ts +0 -359
- package/src/utils/query-analysis.ts +0 -116
- package/src/utils/serialization.ts +0 -39
- package/src/utils/types.ts +0 -43
- package/src/vue.ts +0 -448
- package/test/react-query.test.tsx +0 -1787
- package/test/react-typing-test.ts +0 -113
- package/test/schemas/basic/input.ts +0 -110
- package/test/schemas/basic/models.ts +0 -14
- package/test/schemas/basic/schema-lite.ts +0 -172
- package/test/schemas/basic/schema.zmodel +0 -35
- package/test/svelte-typing-test.ts +0 -111
- package/test/vue-typing-test.ts +0 -111
- package/tsconfig.json +0 -7
- package/tsconfig.test.json +0 -8
- package/tsup.config.ts +0 -15
- package/vitest.config.ts +0 -11
package/dist/react.d.ts
CHANGED
|
@@ -1,54 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { A as APIContext, E as ExtraQueryOptions, W as WithOptimistic, a as ExtraMutationOptions, T as TrimDelegateModelOperations } from './types-C8iIZD-7.js';
|
|
7
|
-
export { F as FetchFn } from './types-C8iIZD-7.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The default query endpoint.
|
|
11
|
-
*/
|
|
12
|
-
declare const DEFAULT_QUERY_ENDPOINT = "/api/model";
|
|
1
|
+
import { type DefaultError, type InfiniteData, type QueryKey, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, type UseSuspenseInfiniteQueryOptions, type UseSuspenseInfiniteQueryResult, type UseSuspenseQueryOptions, type UseSuspenseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { AggregateArgs, AggregateResult, BatchResult, CountArgs, CountResult, CreateArgs, CreateManyAndReturnArgs, CreateManyArgs, DeleteArgs, DeleteManyArgs, FindFirstArgs, FindManyArgs, FindUniqueArgs, GroupByArgs, GroupByResult, QueryOptions, SelectSubset, SimplifiedPlainResult, SimplifiedResult, Subset, UpdateArgs, UpdateManyAndReturnArgs, UpdateManyArgs, UpsertArgs } from '@zenstackhq/orm';
|
|
3
|
+
import type { GetModels, SchemaDef } from '@zenstackhq/schema';
|
|
4
|
+
import type { ExtraMutationOptions, ExtraQueryOptions, QueryContext, TrimDelegateModelOperations, WithOptimistic } from './common/types';
|
|
5
|
+
export type { FetchFn } from '@zenstackhq/client-helpers/fetch';
|
|
13
6
|
/**
|
|
14
7
|
* React context for query settings.
|
|
15
8
|
*/
|
|
16
|
-
declare const QuerySettingsContext: react.Context<
|
|
9
|
+
export declare const QuerySettingsContext: import("react").Context<QueryContext>;
|
|
17
10
|
/**
|
|
18
11
|
* React context provider for configuring query settings.
|
|
19
12
|
*/
|
|
20
|
-
declare const QuerySettingsProvider: react.Provider<
|
|
13
|
+
export declare const QuerySettingsProvider: import("react").Provider<QueryContext>;
|
|
21
14
|
/**
|
|
22
15
|
* React context provider for configuring query settings.
|
|
23
16
|
*
|
|
24
17
|
* @deprecated Use {@link QuerySettingsProvider} instead.
|
|
25
18
|
*/
|
|
26
|
-
declare const Provider: react.Provider<
|
|
27
|
-
type ModelQueryOptions<T> = Omit<UseQueryOptions<T, DefaultError>, 'queryKey'> & ExtraQueryOptions;
|
|
28
|
-
type ModelQueryResult<T> = UseQueryResult<WithOptimistic<T>, DefaultError> & {
|
|
19
|
+
export declare const Provider: import("react").Provider<QueryContext>;
|
|
20
|
+
export type ModelQueryOptions<T> = Omit<UseQueryOptions<T, DefaultError>, 'queryKey'> & ExtraQueryOptions;
|
|
21
|
+
export type ModelQueryResult<T> = UseQueryResult<WithOptimistic<T>, DefaultError> & {
|
|
29
22
|
queryKey: QueryKey;
|
|
30
23
|
};
|
|
31
|
-
type ModelSuspenseQueryOptions<T> = Omit<UseSuspenseQueryOptions<T, DefaultError>, 'queryKey'> & ExtraQueryOptions;
|
|
32
|
-
type ModelSuspenseQueryResult<T> = UseSuspenseQueryResult<WithOptimistic<T>, DefaultError> & {
|
|
24
|
+
export type ModelSuspenseQueryOptions<T> = Omit<UseSuspenseQueryOptions<T, DefaultError>, 'queryKey'> & ExtraQueryOptions;
|
|
25
|
+
export type ModelSuspenseQueryResult<T> = UseSuspenseQueryResult<WithOptimistic<T>, DefaultError> & {
|
|
33
26
|
queryKey: QueryKey;
|
|
34
27
|
};
|
|
35
|
-
type ModelInfiniteQueryOptions<T> = Omit<UseInfiniteQueryOptions<T, DefaultError, InfiniteData<T>>, 'queryKey' | 'initialPageParam'>;
|
|
36
|
-
type ModelInfiniteQueryResult<T> = UseInfiniteQueryResult<T, DefaultError> & {
|
|
28
|
+
export type ModelInfiniteQueryOptions<T> = Omit<UseInfiniteQueryOptions<T, DefaultError, InfiniteData<T>>, 'queryKey' | 'initialPageParam'>;
|
|
29
|
+
export type ModelInfiniteQueryResult<T> = UseInfiniteQueryResult<T, DefaultError> & {
|
|
37
30
|
queryKey: QueryKey;
|
|
38
31
|
};
|
|
39
|
-
type ModelSuspenseInfiniteQueryOptions<T> = Omit<UseSuspenseInfiniteQueryOptions<T, DefaultError, InfiniteData<T>>, 'queryKey' | 'initialPageParam'>;
|
|
40
|
-
type ModelSuspenseInfiniteQueryResult<T> = UseSuspenseInfiniteQueryResult<T, DefaultError> & {
|
|
32
|
+
export type ModelSuspenseInfiniteQueryOptions<T> = Omit<UseSuspenseInfiniteQueryOptions<T, DefaultError, InfiniteData<T>>, 'queryKey' | 'initialPageParam'>;
|
|
33
|
+
export type ModelSuspenseInfiniteQueryResult<T> = UseSuspenseInfiniteQueryResult<T, DefaultError> & {
|
|
41
34
|
queryKey: QueryKey;
|
|
42
35
|
};
|
|
43
|
-
type ModelMutationOptions<T, TArgs> = Omit<UseMutationOptions<T, DefaultError, TArgs>, 'mutationFn'> & ExtraMutationOptions;
|
|
44
|
-
type ModelMutationResult<T, TArgs> = UseMutationResult<T, DefaultError, TArgs>;
|
|
45
|
-
type ModelMutationModelResult<Schema extends SchemaDef, Model extends GetModels<Schema>, TArgs, Array extends boolean = false, Options extends QueryOptions<Schema> = QueryOptions<Schema>> = Omit<ModelMutationResult<SimplifiedResult<Schema, Model, TArgs, Options, false, Array>, TArgs>, 'mutateAsync'> & {
|
|
36
|
+
export type ModelMutationOptions<T, TArgs> = Omit<UseMutationOptions<T, DefaultError, TArgs>, 'mutationFn'> & ExtraMutationOptions;
|
|
37
|
+
export type ModelMutationResult<T, TArgs> = UseMutationResult<T, DefaultError, TArgs>;
|
|
38
|
+
export type ModelMutationModelResult<Schema extends SchemaDef, Model extends GetModels<Schema>, TArgs, Array extends boolean = false, Options extends QueryOptions<Schema> = QueryOptions<Schema>> = Omit<ModelMutationResult<SimplifiedResult<Schema, Model, TArgs, Options, false, Array>, TArgs>, 'mutateAsync'> & {
|
|
46
39
|
mutateAsync<T extends TArgs>(args: T, options?: ModelMutationOptions<SimplifiedResult<Schema, Model, T, Options, false, Array>, T>): Promise<SimplifiedResult<Schema, Model, T, Options, false, Array>>;
|
|
47
40
|
};
|
|
48
|
-
type ClientHooks<Schema extends SchemaDef, Options extends QueryOptions<Schema> = QueryOptions<Schema>> = {
|
|
41
|
+
export type ClientHooks<Schema extends SchemaDef, Options extends QueryOptions<Schema> = QueryOptions<Schema>> = {
|
|
49
42
|
[Model in GetModels<Schema> as `${Uncapitalize<Model>}`]: ModelQueryHooks<Schema, Model, Options>;
|
|
50
43
|
};
|
|
51
|
-
type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Schema>, Options extends QueryOptions<Schema> = QueryOptions<Schema>> = TrimDelegateModelOperations<Schema, Model, {
|
|
44
|
+
export type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Schema>, Options extends QueryOptions<Schema> = QueryOptions<Schema>> = TrimDelegateModelOperations<Schema, Model, {
|
|
52
45
|
useFindUnique<T extends FindUniqueArgs<Schema, Model>>(args: SelectSubset<T, FindUniqueArgs<Schema, Model>>, options?: ModelQueryOptions<SimplifiedPlainResult<Schema, Model, T, Options> | null>): ModelQueryResult<SimplifiedPlainResult<Schema, Model, T, Options> | null>;
|
|
53
46
|
useSuspenseFindUnique<T extends FindUniqueArgs<Schema, Model>>(args: SelectSubset<T, FindUniqueArgs<Schema, Model>>, options?: ModelSuspenseQueryOptions<SimplifiedPlainResult<Schema, Model, T, Options> | null>): ModelSuspenseQueryResult<SimplifiedPlainResult<Schema, Model, T, Options> | null>;
|
|
54
47
|
useFindFirst<T extends FindFirstArgs<Schema, Model>>(args?: SelectSubset<T, FindFirstArgs<Schema, Model>>, options?: ModelQueryOptions<SimplifiedPlainResult<Schema, Model, T, Options> | null>): ModelQueryResult<SimplifiedPlainResult<Schema, Model, T, Options> | null>;
|
|
@@ -75,14 +68,17 @@ type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Schema>,
|
|
|
75
68
|
}>;
|
|
76
69
|
/**
|
|
77
70
|
* Gets data query hooks for all models in the schema.
|
|
71
|
+
*
|
|
72
|
+
* @param schema The schema.
|
|
73
|
+
* @param options Options for all queries originated from this hook.
|
|
78
74
|
*/
|
|
79
|
-
declare function useClientQueries<Schema extends SchemaDef, Options extends QueryOptions<Schema> = QueryOptions<Schema>>(schema: Schema): ClientHooks<Schema, Options>;
|
|
75
|
+
export declare function useClientQueries<Schema extends SchemaDef, Options extends QueryOptions<Schema> = QueryOptions<Schema>>(schema: Schema, options?: QueryContext): ClientHooks<Schema, Options>;
|
|
80
76
|
/**
|
|
81
77
|
* Gets data query hooks for a specific model in the schema.
|
|
82
78
|
*/
|
|
83
|
-
declare function useModelQueries<Schema extends SchemaDef, Model extends GetModels<Schema>, Options extends QueryOptions<Schema>>(schema: Schema, model: Model): ModelQueryHooks<Schema, Model, Options>;
|
|
84
|
-
declare function useInternalQuery<TQueryFnData, TData>(_schema: SchemaDef, model: string, operation: string, args?: unknown, options?: Omit<UseQueryOptions<TQueryFnData, DefaultError, TData>, 'queryKey'> & ExtraQueryOptions): {
|
|
85
|
-
data:
|
|
79
|
+
export declare function useModelQueries<Schema extends SchemaDef, Model extends GetModels<Schema>, Options extends QueryOptions<Schema>>(schema: Schema, model: Model, rootOptions?: QueryContext): ModelQueryHooks<Schema, Model, Options>;
|
|
80
|
+
export declare function useInternalQuery<TQueryFnData, TData>(_schema: SchemaDef, model: string, operation: string, args?: unknown, options?: Omit<UseQueryOptions<TQueryFnData, DefaultError, TData>, 'queryKey'> & ExtraQueryOptions): {
|
|
81
|
+
data: import("@tanstack/query-core").NoInfer<TData>;
|
|
86
82
|
error: Error;
|
|
87
83
|
isError: true;
|
|
88
84
|
isPending: false;
|
|
@@ -105,15 +101,12 @@ declare function useInternalQuery<TQueryFnData, TData>(_schema: SchemaDef, model
|
|
|
105
101
|
isRefetching: boolean;
|
|
106
102
|
isStale: boolean;
|
|
107
103
|
isEnabled: boolean;
|
|
108
|
-
refetch: (options?:
|
|
109
|
-
fetchStatus:
|
|
110
|
-
promise: Promise<
|
|
111
|
-
queryKey:
|
|
112
|
-
infinite: boolean;
|
|
113
|
-
optimisticUpdate: boolean;
|
|
114
|
-
}];
|
|
104
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").NoInfer<TData>, Error>>;
|
|
105
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
106
|
+
promise: Promise<import("@tanstack/query-core").NoInfer<TData>>;
|
|
107
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
115
108
|
} | {
|
|
116
|
-
data:
|
|
109
|
+
data: import("@tanstack/query-core").NoInfer<TData>;
|
|
117
110
|
error: null;
|
|
118
111
|
isError: false;
|
|
119
112
|
isPending: false;
|
|
@@ -136,13 +129,10 @@ declare function useInternalQuery<TQueryFnData, TData>(_schema: SchemaDef, model
|
|
|
136
129
|
isRefetching: boolean;
|
|
137
130
|
isStale: boolean;
|
|
138
131
|
isEnabled: boolean;
|
|
139
|
-
refetch: (options?:
|
|
140
|
-
fetchStatus:
|
|
141
|
-
promise: Promise<
|
|
142
|
-
queryKey:
|
|
143
|
-
infinite: boolean;
|
|
144
|
-
optimisticUpdate: boolean;
|
|
145
|
-
}];
|
|
132
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").NoInfer<TData>, Error>>;
|
|
133
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
134
|
+
promise: Promise<import("@tanstack/query-core").NoInfer<TData>>;
|
|
135
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
146
136
|
} | {
|
|
147
137
|
data: undefined;
|
|
148
138
|
error: Error;
|
|
@@ -167,13 +157,10 @@ declare function useInternalQuery<TQueryFnData, TData>(_schema: SchemaDef, model
|
|
|
167
157
|
isRefetching: boolean;
|
|
168
158
|
isStale: boolean;
|
|
169
159
|
isEnabled: boolean;
|
|
170
|
-
refetch: (options?:
|
|
171
|
-
fetchStatus:
|
|
172
|
-
promise: Promise<
|
|
173
|
-
queryKey:
|
|
174
|
-
infinite: boolean;
|
|
175
|
-
optimisticUpdate: boolean;
|
|
176
|
-
}];
|
|
160
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").NoInfer<TData>, Error>>;
|
|
161
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
162
|
+
promise: Promise<import("@tanstack/query-core").NoInfer<TData>>;
|
|
163
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
177
164
|
} | {
|
|
178
165
|
data: undefined;
|
|
179
166
|
error: null;
|
|
@@ -198,13 +185,10 @@ declare function useInternalQuery<TQueryFnData, TData>(_schema: SchemaDef, model
|
|
|
198
185
|
isRefetching: boolean;
|
|
199
186
|
isStale: boolean;
|
|
200
187
|
isEnabled: boolean;
|
|
201
|
-
refetch: (options?:
|
|
202
|
-
fetchStatus:
|
|
203
|
-
promise: Promise<
|
|
204
|
-
queryKey:
|
|
205
|
-
infinite: boolean;
|
|
206
|
-
optimisticUpdate: boolean;
|
|
207
|
-
}];
|
|
188
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").NoInfer<TData>, Error>>;
|
|
189
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
190
|
+
promise: Promise<import("@tanstack/query-core").NoInfer<TData>>;
|
|
191
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
208
192
|
} | {
|
|
209
193
|
data: undefined;
|
|
210
194
|
error: null;
|
|
@@ -229,15 +213,12 @@ declare function useInternalQuery<TQueryFnData, TData>(_schema: SchemaDef, model
|
|
|
229
213
|
isRefetching: boolean;
|
|
230
214
|
isStale: boolean;
|
|
231
215
|
isEnabled: boolean;
|
|
232
|
-
refetch: (options?:
|
|
233
|
-
fetchStatus:
|
|
234
|
-
promise: Promise<
|
|
235
|
-
queryKey:
|
|
236
|
-
infinite: boolean;
|
|
237
|
-
optimisticUpdate: boolean;
|
|
238
|
-
}];
|
|
216
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").NoInfer<TData>, Error>>;
|
|
217
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
218
|
+
promise: Promise<import("@tanstack/query-core").NoInfer<TData>>;
|
|
219
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
239
220
|
} | {
|
|
240
|
-
data:
|
|
221
|
+
data: import("@tanstack/query-core").NoInfer<TData>;
|
|
241
222
|
isError: false;
|
|
242
223
|
error: null;
|
|
243
224
|
isPending: false;
|
|
@@ -260,15 +241,12 @@ declare function useInternalQuery<TQueryFnData, TData>(_schema: SchemaDef, model
|
|
|
260
241
|
isRefetching: boolean;
|
|
261
242
|
isStale: boolean;
|
|
262
243
|
isEnabled: boolean;
|
|
263
|
-
refetch: (options?:
|
|
264
|
-
fetchStatus:
|
|
265
|
-
promise: Promise<
|
|
266
|
-
queryKey:
|
|
267
|
-
infinite: boolean;
|
|
268
|
-
optimisticUpdate: boolean;
|
|
269
|
-
}];
|
|
244
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").NoInfer<TData>, Error>>;
|
|
245
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
246
|
+
promise: Promise<import("@tanstack/query-core").NoInfer<TData>>;
|
|
247
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
270
248
|
};
|
|
271
|
-
declare function useInternalSuspenseQuery<TQueryFnData, TData>(_schema: SchemaDef, model: string, operation: string, args?: unknown, options?: Omit<UseSuspenseQueryOptions<TQueryFnData, DefaultError, TData>, 'queryKey'> & ExtraQueryOptions): {
|
|
249
|
+
export declare function useInternalSuspenseQuery<TQueryFnData, TData>(_schema: SchemaDef, model: string, operation: string, args?: unknown, options?: Omit<UseSuspenseQueryOptions<TQueryFnData, DefaultError, TData>, 'queryKey'> & ExtraQueryOptions): {
|
|
272
250
|
data: TData;
|
|
273
251
|
error: Error;
|
|
274
252
|
isError: true;
|
|
@@ -291,12 +269,9 @@ declare function useInternalSuspenseQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
291
269
|
isRefetching: boolean;
|
|
292
270
|
isStale: boolean;
|
|
293
271
|
isEnabled: boolean;
|
|
294
|
-
refetch: (options?:
|
|
295
|
-
fetchStatus:
|
|
296
|
-
queryKey:
|
|
297
|
-
infinite: boolean;
|
|
298
|
-
optimisticUpdate: boolean;
|
|
299
|
-
}];
|
|
272
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TData, Error>>;
|
|
273
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
274
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
300
275
|
} | {
|
|
301
276
|
data: TData;
|
|
302
277
|
error: null;
|
|
@@ -320,14 +295,11 @@ declare function useInternalSuspenseQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
320
295
|
isRefetching: boolean;
|
|
321
296
|
isStale: boolean;
|
|
322
297
|
isEnabled: boolean;
|
|
323
|
-
refetch: (options?:
|
|
324
|
-
fetchStatus:
|
|
325
|
-
queryKey:
|
|
326
|
-
infinite: boolean;
|
|
327
|
-
optimisticUpdate: boolean;
|
|
328
|
-
}];
|
|
298
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TData, Error>>;
|
|
299
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
300
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
329
301
|
};
|
|
330
|
-
declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDef, model: string, operation: string, args: unknown, options: Omit<UseInfiniteQueryOptions<TQueryFnData, DefaultError, InfiniteData<TData>>, 'queryKey' | 'initialPageParam'> | undefined): {
|
|
302
|
+
export declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDef, model: string, operation: string, args: unknown, options: (Omit<UseInfiniteQueryOptions<TQueryFnData, DefaultError, InfiniteData<TData>>, 'queryKey' | 'initialPageParam'> & QueryContext) | undefined): {
|
|
331
303
|
data: InfiniteData<TData, unknown>;
|
|
332
304
|
error: Error;
|
|
333
305
|
isError: true;
|
|
@@ -338,8 +310,8 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
338
310
|
isSuccess: false;
|
|
339
311
|
isPlaceholderData: false;
|
|
340
312
|
status: "error";
|
|
341
|
-
fetchNextPage: (options?:
|
|
342
|
-
fetchPreviousPage: (options?:
|
|
313
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
314
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
343
315
|
hasNextPage: boolean;
|
|
344
316
|
hasPreviousPage: boolean;
|
|
345
317
|
isFetchNextPageError: boolean;
|
|
@@ -359,13 +331,10 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
359
331
|
isRefetching: boolean;
|
|
360
332
|
isStale: boolean;
|
|
361
333
|
isEnabled: boolean;
|
|
362
|
-
refetch: (options?:
|
|
363
|
-
fetchStatus:
|
|
334
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
335
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
364
336
|
promise: Promise<InfiniteData<TData, unknown>>;
|
|
365
|
-
queryKey:
|
|
366
|
-
infinite: boolean;
|
|
367
|
-
optimisticUpdate: boolean;
|
|
368
|
-
}];
|
|
337
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
369
338
|
} | {
|
|
370
339
|
data: InfiniteData<TData, unknown>;
|
|
371
340
|
error: null;
|
|
@@ -379,8 +348,8 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
379
348
|
isSuccess: true;
|
|
380
349
|
isPlaceholderData: false;
|
|
381
350
|
status: "success";
|
|
382
|
-
fetchNextPage: (options?:
|
|
383
|
-
fetchPreviousPage: (options?:
|
|
351
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
352
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
384
353
|
hasNextPage: boolean;
|
|
385
354
|
hasPreviousPage: boolean;
|
|
386
355
|
isFetchingNextPage: boolean;
|
|
@@ -398,13 +367,10 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
398
367
|
isRefetching: boolean;
|
|
399
368
|
isStale: boolean;
|
|
400
369
|
isEnabled: boolean;
|
|
401
|
-
refetch: (options?:
|
|
402
|
-
fetchStatus:
|
|
370
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
371
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
403
372
|
promise: Promise<InfiniteData<TData, unknown>>;
|
|
404
|
-
queryKey:
|
|
405
|
-
infinite: boolean;
|
|
406
|
-
optimisticUpdate: boolean;
|
|
407
|
-
}];
|
|
373
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
408
374
|
} | {
|
|
409
375
|
data: undefined;
|
|
410
376
|
error: Error;
|
|
@@ -418,8 +384,8 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
418
384
|
isSuccess: false;
|
|
419
385
|
isPlaceholderData: false;
|
|
420
386
|
status: "error";
|
|
421
|
-
fetchNextPage: (options?:
|
|
422
|
-
fetchPreviousPage: (options?:
|
|
387
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
388
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
423
389
|
hasNextPage: boolean;
|
|
424
390
|
hasPreviousPage: boolean;
|
|
425
391
|
isFetchingNextPage: boolean;
|
|
@@ -437,13 +403,10 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
437
403
|
isRefetching: boolean;
|
|
438
404
|
isStale: boolean;
|
|
439
405
|
isEnabled: boolean;
|
|
440
|
-
refetch: (options?:
|
|
441
|
-
fetchStatus:
|
|
406
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
407
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
442
408
|
promise: Promise<InfiniteData<TData, unknown>>;
|
|
443
|
-
queryKey:
|
|
444
|
-
infinite: boolean;
|
|
445
|
-
optimisticUpdate: boolean;
|
|
446
|
-
}];
|
|
409
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
447
410
|
} | {
|
|
448
411
|
data: undefined;
|
|
449
412
|
error: null;
|
|
@@ -457,8 +420,8 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
457
420
|
isSuccess: false;
|
|
458
421
|
isPlaceholderData: false;
|
|
459
422
|
status: "pending";
|
|
460
|
-
fetchNextPage: (options?:
|
|
461
|
-
fetchPreviousPage: (options?:
|
|
423
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
424
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
462
425
|
hasNextPage: boolean;
|
|
463
426
|
hasPreviousPage: boolean;
|
|
464
427
|
isFetchingNextPage: boolean;
|
|
@@ -476,13 +439,10 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
476
439
|
isRefetching: boolean;
|
|
477
440
|
isStale: boolean;
|
|
478
441
|
isEnabled: boolean;
|
|
479
|
-
refetch: (options?:
|
|
480
|
-
fetchStatus:
|
|
442
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
443
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
481
444
|
promise: Promise<InfiniteData<TData, unknown>>;
|
|
482
|
-
queryKey:
|
|
483
|
-
infinite: boolean;
|
|
484
|
-
optimisticUpdate: boolean;
|
|
485
|
-
}];
|
|
445
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
486
446
|
} | {
|
|
487
447
|
data: undefined;
|
|
488
448
|
error: null;
|
|
@@ -495,8 +455,8 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
495
455
|
isSuccess: false;
|
|
496
456
|
isPlaceholderData: false;
|
|
497
457
|
status: "pending";
|
|
498
|
-
fetchNextPage: (options?:
|
|
499
|
-
fetchPreviousPage: (options?:
|
|
458
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
459
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
500
460
|
hasNextPage: boolean;
|
|
501
461
|
hasPreviousPage: boolean;
|
|
502
462
|
isFetchingNextPage: boolean;
|
|
@@ -515,13 +475,10 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
515
475
|
isRefetching: boolean;
|
|
516
476
|
isStale: boolean;
|
|
517
477
|
isEnabled: boolean;
|
|
518
|
-
refetch: (options?:
|
|
519
|
-
fetchStatus:
|
|
478
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
479
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
520
480
|
promise: Promise<InfiniteData<TData, unknown>>;
|
|
521
|
-
queryKey:
|
|
522
|
-
infinite: boolean;
|
|
523
|
-
optimisticUpdate: boolean;
|
|
524
|
-
}];
|
|
481
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
525
482
|
} | {
|
|
526
483
|
data: InfiniteData<TData, unknown>;
|
|
527
484
|
isError: false;
|
|
@@ -535,8 +492,8 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
535
492
|
isFetchNextPageError: false;
|
|
536
493
|
isFetchPreviousPageError: false;
|
|
537
494
|
status: "success";
|
|
538
|
-
fetchNextPage: (options?:
|
|
539
|
-
fetchPreviousPage: (options?:
|
|
495
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
496
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
540
497
|
hasNextPage: boolean;
|
|
541
498
|
hasPreviousPage: boolean;
|
|
542
499
|
isFetchingNextPage: boolean;
|
|
@@ -554,15 +511,12 @@ declare function useInternalInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDe
|
|
|
554
511
|
isRefetching: boolean;
|
|
555
512
|
isStale: boolean;
|
|
556
513
|
isEnabled: boolean;
|
|
557
|
-
refetch: (options?:
|
|
558
|
-
fetchStatus:
|
|
514
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
515
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
559
516
|
promise: Promise<InfiniteData<TData, unknown>>;
|
|
560
|
-
queryKey:
|
|
561
|
-
infinite: boolean;
|
|
562
|
-
optimisticUpdate: boolean;
|
|
563
|
-
}];
|
|
517
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
564
518
|
};
|
|
565
|
-
declare function useInternalSuspenseInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDef, model: string, operation: string, args: unknown, options: Omit<UseSuspenseInfiniteQueryOptions<TQueryFnData, DefaultError, InfiniteData<TData
|
|
519
|
+
export declare function useInternalSuspenseInfiniteQuery<TQueryFnData, TData>(_schema: SchemaDef, model: string, operation: string, args: unknown, options: Omit<UseSuspenseInfiniteQueryOptions<TQueryFnData, DefaultError, InfiniteData<TData>> & QueryContext, 'queryKey' | 'initialPageParam'>): {
|
|
566
520
|
data: InfiniteData<TData, unknown>;
|
|
567
521
|
error: Error | null;
|
|
568
522
|
isError: boolean;
|
|
@@ -585,20 +539,17 @@ declare function useInternalSuspenseInfiniteQuery<TQueryFnData, TData>(_schema:
|
|
|
585
539
|
isRefetching: boolean;
|
|
586
540
|
isStale: boolean;
|
|
587
541
|
isEnabled: boolean;
|
|
588
|
-
refetch: (options?:
|
|
589
|
-
fetchStatus:
|
|
590
|
-
fetchNextPage: (options?:
|
|
591
|
-
fetchPreviousPage: (options?:
|
|
542
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
543
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
544
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
545
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<InfiniteData<TData, unknown>, Error>>;
|
|
592
546
|
hasNextPage: boolean;
|
|
593
547
|
hasPreviousPage: boolean;
|
|
594
548
|
isFetchNextPageError: boolean;
|
|
595
549
|
isFetchingNextPage: boolean;
|
|
596
550
|
isFetchPreviousPageError: boolean;
|
|
597
551
|
isFetchingPreviousPage: boolean;
|
|
598
|
-
queryKey:
|
|
599
|
-
infinite: boolean;
|
|
600
|
-
optimisticUpdate: boolean;
|
|
601
|
-
}];
|
|
552
|
+
queryKey: import("./common/query-key").QueryKey;
|
|
602
553
|
};
|
|
603
554
|
/**
|
|
604
555
|
* Creates a react-query mutation
|
|
@@ -611,6 +562,4 @@ declare function useInternalSuspenseInfiniteQuery<TQueryFnData, TData>(_schema:
|
|
|
611
562
|
* @param options The react-query options.
|
|
612
563
|
* @param checkReadBack Whether to check for read back errors and return undefined if found.
|
|
613
564
|
*/
|
|
614
|
-
declare function useInternalMutation<TArgs, R = any>(schema: SchemaDef, model: string, method: 'POST' | 'PUT' | 'DELETE', operation: string, options?: Omit<UseMutationOptions<R, DefaultError, TArgs>, 'mutationFn'> & ExtraMutationOptions): UseMutationResult<R, Error, TArgs, unknown>;
|
|
615
|
-
|
|
616
|
-
export { type ClientHooks, DEFAULT_QUERY_ENDPOINT, type ModelInfiniteQueryOptions, type ModelInfiniteQueryResult, type ModelMutationModelResult, type ModelMutationOptions, type ModelMutationResult, type ModelQueryHooks, type ModelQueryOptions, type ModelQueryResult, type ModelSuspenseInfiniteQueryOptions, type ModelSuspenseInfiniteQueryResult, type ModelSuspenseQueryOptions, type ModelSuspenseQueryResult, Provider, QuerySettingsContext, QuerySettingsProvider, useClientQueries, useInternalInfiniteQuery, useInternalMutation, useInternalQuery, useInternalSuspenseInfiniteQuery, useInternalSuspenseQuery, useModelQueries };
|
|
565
|
+
export declare function useInternalMutation<TArgs, R = any>(schema: SchemaDef, model: string, method: 'POST' | 'PUT' | 'DELETE', operation: string, options?: Omit<UseMutationOptions<R, DefaultError, TArgs>, 'mutationFn'> & ExtraMutationOptions): UseMutationResult<R, Error, TArgs, unknown>;
|