@navios/react-query 0.7.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +171 -1
- package/README.md +152 -4
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/client/declare-client.mts.html +1264 -0
- package/coverage/client/index.html +116 -0
- package/coverage/clover.xml +160 -0
- package/coverage/coverage-final.json +8 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +146 -0
- package/coverage/mutation/index.html +131 -0
- package/coverage/mutation/key-creator.mts.html +277 -0
- package/coverage/mutation/make-hook.mts.html +952 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/query/index.html +161 -0
- package/coverage/query/key-creator.mts.html +415 -0
- package/coverage/query/make-infinite-options.mts.html +601 -0
- package/coverage/query/make-options.mts.html +838 -0
- package/coverage/query/prefetch.mts.html +1063 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/dist/src/__tests__/errorSchema.spec.d.mts +2 -0
- package/dist/src/__tests__/errorSchema.spec.d.mts.map +1 -0
- package/dist/src/__tests__/prefetch.spec.d.mts +2 -0
- package/dist/src/__tests__/prefetch.spec.d.mts.map +1 -0
- package/dist/src/client/__type-tests__/from-endpoint.spec-d.d.mts +2 -0
- package/dist/src/client/__type-tests__/from-endpoint.spec-d.d.mts.map +1 -0
- package/dist/src/client/__type-tests__/infinite-query.spec-d.d.mts +2 -0
- package/dist/src/client/__type-tests__/infinite-query.spec-d.d.mts.map +1 -0
- package/dist/src/client/__type-tests__/multipart-mutation.spec-d.d.mts +2 -0
- package/dist/src/client/__type-tests__/multipart-mutation.spec-d.d.mts.map +1 -0
- package/dist/src/client/__type-tests__/mutation.spec-d.d.mts +2 -0
- package/dist/src/client/__type-tests__/mutation.spec-d.d.mts.map +1 -0
- package/dist/src/client/__type-tests__/query.spec-d.d.mts +2 -0
- package/dist/src/client/__type-tests__/query.spec-d.d.mts.map +1 -0
- package/dist/src/client/declare-client.d.mts +15 -8
- package/dist/src/client/declare-client.d.mts.map +1 -1
- package/dist/src/client/types/from-endpoint.d.mts +130 -0
- package/dist/src/client/types/from-endpoint.d.mts.map +1 -0
- package/dist/src/client/types/helpers.d.mts +74 -0
- package/dist/src/client/types/helpers.d.mts.map +1 -0
- package/dist/src/client/types/index.d.mts +21 -0
- package/dist/src/client/types/index.d.mts.map +1 -0
- package/dist/src/client/types/infinite-query.d.mts +61 -0
- package/dist/src/client/types/infinite-query.d.mts.map +1 -0
- package/dist/src/client/types/multipart-mutation.d.mts +98 -0
- package/dist/src/client/types/multipart-mutation.d.mts.map +1 -0
- package/dist/src/client/types/mutation.d.mts +75 -0
- package/dist/src/client/types/mutation.d.mts.map +1 -0
- package/dist/src/client/types/query.d.mts +65 -0
- package/dist/src/client/types/query.d.mts.map +1 -0
- package/dist/src/client/types.d.mts +1 -608
- package/dist/src/client/types.d.mts.map +1 -1
- package/dist/src/common/types.d.mts +40 -3
- package/dist/src/common/types.d.mts.map +1 -1
- package/dist/src/mutation/index.d.mts +1 -0
- package/dist/src/mutation/index.d.mts.map +1 -1
- package/dist/src/mutation/make-hook.d.mts +42 -16
- package/dist/src/mutation/make-hook.d.mts.map +1 -1
- package/dist/src/mutation/optimistic.d.mts +172 -0
- package/dist/src/mutation/optimistic.d.mts.map +1 -0
- package/dist/src/mutation/types.d.mts +41 -20
- package/dist/src/mutation/types.d.mts.map +1 -1
- package/dist/src/query/index.d.mts +1 -0
- package/dist/src/query/index.d.mts.map +1 -1
- package/dist/src/query/key-creator.d.mts.map +1 -1
- package/dist/src/query/make-infinite-options.d.mts +3 -2
- package/dist/src/query/make-infinite-options.d.mts.map +1 -1
- package/dist/src/query/make-options.d.mts +42 -12
- package/dist/src/query/make-options.d.mts.map +1 -1
- package/dist/src/query/prefetch.d.mts +245 -0
- package/dist/src/query/prefetch.d.mts.map +1 -0
- package/dist/src/query/types.d.mts +25 -18
- package/dist/src/query/types.d.mts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/lib/index.cjs +451 -28
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1019 -600
- package/lib/index.d.cts.map +1 -1
- package/lib/index.d.mts +1016 -597
- package/lib/index.d.mts.map +1 -1
- package/lib/index.mjs +447 -29
- package/lib/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/declare-client.spec.mts +229 -2
- package/src/__tests__/errorSchema.spec.mts +391 -0
- package/src/__tests__/make-mutation.spec.mts +6 -5
- package/src/__tests__/makeDataTag.spec.mts +2 -1
- package/src/__tests__/makeQueryOptions.spec.mts +2 -1
- package/src/__tests__/prefetch.spec.mts +310 -0
- package/src/client/__type-tests__/from-endpoint.spec-d.mts +550 -0
- package/src/client/__type-tests__/infinite-query.spec-d.mts +648 -0
- package/src/client/__type-tests__/multipart-mutation.spec-d.mts +725 -0
- package/src/client/__type-tests__/mutation.spec-d.mts +757 -0
- package/src/client/__type-tests__/query.spec-d.mts +701 -0
- package/src/client/declare-client.mts +59 -34
- package/src/client/types/from-endpoint.mts +344 -0
- package/src/client/types/helpers.mts +140 -0
- package/src/client/types/index.mts +26 -0
- package/src/client/types/infinite-query.mts +133 -0
- package/src/client/types/multipart-mutation.mts +264 -0
- package/src/client/types/mutation.mts +176 -0
- package/src/client/types/query.mts +132 -0
- package/src/client/types.mts +1 -1935
- package/src/common/types.mts +67 -3
- package/src/mutation/index.mts +1 -0
- package/src/mutation/make-hook.mts +171 -63
- package/src/mutation/optimistic.mts +300 -0
- package/src/mutation/types.mts +87 -30
- package/src/query/index.mts +1 -0
- package/src/query/key-creator.mts +24 -13
- package/src/query/make-infinite-options.mts +53 -10
- package/src/query/make-options.mts +184 -43
- package/src/query/prefetch.mts +326 -0
- package/src/query/types.mts +56 -17
- package/src/client/__type-tests__/client-instance.spec-d.mts +0 -852
|
@@ -1,609 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { DataTag, InfiniteData, MutationFunctionContext, UseMutationResult, UseSuspenseInfiniteQueryOptions, UseSuspenseQueryOptions } from '@tanstack/react-query';
|
|
3
|
-
import type { z, ZodObject, ZodType } from 'zod/v4';
|
|
4
|
-
import type { ProcessResponseFunction, Split } from '../common/types.mjs';
|
|
5
|
-
import type { MutationArgs, MutationHelpers } from '../mutation/types.mjs';
|
|
6
|
-
import type { QueryArgs, QueryHelpers } from '../query/types.mjs';
|
|
7
|
-
/**
|
|
8
|
-
* Helper type that attaches the endpoint to query/mutation results.
|
|
9
|
-
*/
|
|
10
|
-
export type EndpointHelper<Method extends HttpMethod = HttpMethod, Url extends string = string, RequestSchema = unknown, ResponseSchema extends z.ZodType = z.ZodType, QuerySchema = unknown> = {
|
|
11
|
-
endpoint: ((params: Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, RequestSchema>>) => Promise<z.output<ResponseSchema>>) & {
|
|
12
|
-
config: BaseEndpointConfig<Method, Url, QuerySchema, ResponseSchema, RequestSchema>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
/** @deprecated Use EndpointHelper instead */
|
|
16
|
-
export type ClientEndpointHelper<Method extends HttpMethod = HttpMethod, Url extends string = string, RequestSchema = unknown, ResponseSchema extends z.ZodType = z.ZodType, QuerySchema = unknown> = EndpointHelper<Method, Url, RequestSchema, ResponseSchema, QuerySchema>;
|
|
17
|
-
/**
|
|
18
|
-
* Helper type that attaches a stream endpoint to mutation results.
|
|
19
|
-
*/
|
|
20
|
-
export type StreamHelper<Method extends HttpMethod = HttpMethod, Url extends string = string, RequestSchema = unknown, QuerySchema = unknown> = {
|
|
21
|
-
endpoint: ((params: Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, RequestSchema>>) => Promise<Blob>) & {
|
|
22
|
-
config: BaseStreamConfig<Method, Url, QuerySchema, RequestSchema>;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* The main client instance interface.
|
|
27
|
-
* Provides methods for creating queries, infinite queries, and mutations.
|
|
28
|
-
*/
|
|
29
|
-
export interface ClientInstance {
|
|
30
|
-
query<Method extends 'GET' | 'HEAD' | 'OPTIONS' = 'GET', Url extends string = string, Response extends ZodType = ZodType, Result = z.output<Response>>(config: {
|
|
31
|
-
method: Method;
|
|
32
|
-
url: Url;
|
|
33
|
-
responseSchema: Response;
|
|
34
|
-
processResponse?: (data: z.output<Response>) => Result;
|
|
35
|
-
}): ((params: Util_FlatObject<QueryArgs<Url, undefined>>) => UseSuspenseQueryOptions<Result, Error, Result, DataTag<Split<Url, '/'>, Result, Error>>) & QueryHelpers<Url, undefined, Result> & EndpointHelper<Method, Url, undefined, Response>;
|
|
36
|
-
query<Method extends 'GET' | 'HEAD' | 'OPTIONS' = 'GET', Url extends string = string, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, Result = z.output<Response>>(config: {
|
|
37
|
-
method: Method;
|
|
38
|
-
url: Url;
|
|
39
|
-
querySchema: QuerySchema;
|
|
40
|
-
responseSchema: Response;
|
|
41
|
-
processResponse?: (data: z.output<Response>) => Result;
|
|
42
|
-
}): ((params: Util_FlatObject<QueryArgs<Url, QuerySchema>>) => UseSuspenseQueryOptions<Result, Error, Result, DataTag<Split<Url, '/'>, Result, Error>>) & QueryHelpers<Url, QuerySchema, Result> & EndpointHelper<Method, Url, undefined, Response, QuerySchema>;
|
|
43
|
-
query<Method extends 'POST' = 'POST', Url extends string = string, RequestSchema extends ZodType = ZodType, Response extends ZodType = ZodType, Result = z.output<Response>>(config: {
|
|
44
|
-
method: Method;
|
|
45
|
-
url: Url;
|
|
46
|
-
requestSchema: RequestSchema;
|
|
47
|
-
responseSchema: Response;
|
|
48
|
-
processResponse?: (data: z.output<Response>) => Result;
|
|
49
|
-
}): ((params: Util_FlatObject<QueryArgs<Url, undefined, RequestSchema>>) => UseSuspenseQueryOptions<Result, Error, Result, DataTag<Split<Url, '/'>, Result, Error>>) & QueryHelpers<Url, undefined, Result, false, RequestSchema> & EndpointHelper<Method, Url, RequestSchema, Response>;
|
|
50
|
-
query<Method extends 'POST' = 'POST', Url extends string = string, QuerySchema extends ZodObject = ZodObject, RequestSchema extends ZodType = ZodType, Response extends ZodType = ZodType, Result = z.output<Response>>(config: {
|
|
51
|
-
method: Method;
|
|
52
|
-
url: Url;
|
|
53
|
-
querySchema: QuerySchema;
|
|
54
|
-
requestSchema: RequestSchema;
|
|
55
|
-
responseSchema: Response;
|
|
56
|
-
processResponse?: (data: z.output<Response>) => Result;
|
|
57
|
-
}): ((params: Util_FlatObject<QueryArgs<Url, QuerySchema, RequestSchema>>) => UseSuspenseQueryOptions<Result, Error, Result, DataTag<Split<Url, '/'>, Result, Error>>) & QueryHelpers<Url, QuerySchema, Result, false, RequestSchema> & EndpointHelper<Method, Url, RequestSchema, Response, QuerySchema>;
|
|
58
|
-
infiniteQuery<Method extends 'GET' | 'HEAD' | 'OPTIONS' = 'GET', Url extends string = string, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, PageResult = z.output<Response>, Result = InfiniteData<PageResult>>(config: {
|
|
59
|
-
method: Method;
|
|
60
|
-
url: Url;
|
|
61
|
-
querySchema: QuerySchema;
|
|
62
|
-
responseSchema: Response;
|
|
63
|
-
processResponse?: (data: z.output<Response>) => PageResult;
|
|
64
|
-
getNextPageParam: (lastPage: PageResult, allPages: PageResult[], lastPageParam: z.infer<QuerySchema> | undefined, allPageParams: z.infer<QuerySchema>[] | undefined) => z.input<QuerySchema> | undefined;
|
|
65
|
-
getPreviousPageParam?: (firstPage: PageResult, allPages: PageResult[], lastPageParam: z.infer<QuerySchema> | undefined, allPageParams: z.infer<QuerySchema>[] | undefined) => z.input<QuerySchema>;
|
|
66
|
-
}): ((params: Util_FlatObject<QueryArgs<Url, QuerySchema>>) => UseSuspenseInfiniteQueryOptions<PageResult, Error, Result, DataTag<Split<Url, '/'>, PageResult, Error>, z.output<QuerySchema>>) & QueryHelpers<Url, QuerySchema, PageResult, true> & EndpointHelper<Method, Url, undefined, Response, QuerySchema>;
|
|
67
|
-
infiniteQuery<Method extends 'POST' = 'POST', Url extends string = string, QuerySchema extends ZodObject = ZodObject, RequestSchema extends ZodType = ZodType, Response extends ZodType = ZodType, PageResult = z.output<Response>, Result = InfiniteData<PageResult>>(config: {
|
|
68
|
-
method: Method;
|
|
69
|
-
url: Url;
|
|
70
|
-
querySchema: QuerySchema;
|
|
71
|
-
requestSchema: RequestSchema;
|
|
72
|
-
responseSchema: Response;
|
|
73
|
-
processResponse?: (data: z.output<Response>) => PageResult;
|
|
74
|
-
getNextPageParam: (lastPage: PageResult, allPages: PageResult[], lastPageParam: z.infer<QuerySchema> | undefined, allPageParams: z.infer<QuerySchema>[] | undefined) => z.input<QuerySchema> | undefined;
|
|
75
|
-
getPreviousPageParam?: (firstPage: PageResult, allPages: PageResult[], lastPageParam: z.infer<QuerySchema> | undefined, allPageParams: z.infer<QuerySchema>[] | undefined) => z.input<QuerySchema>;
|
|
76
|
-
}): ((params: Util_FlatObject<QueryArgs<Url, QuerySchema, RequestSchema>>) => UseSuspenseInfiniteQueryOptions<PageResult, Error, Result, DataTag<Split<Url, '/'>, PageResult, Error>, z.output<QuerySchema>>) & QueryHelpers<Url, QuerySchema, PageResult, true, RequestSchema> & EndpointHelper<Method, Url, RequestSchema, Response, QuerySchema>;
|
|
77
|
-
mutation<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(config: {
|
|
78
|
-
method: Method;
|
|
79
|
-
url: Url;
|
|
80
|
-
useKey: UseKey;
|
|
81
|
-
requestSchema: RequestSchema;
|
|
82
|
-
querySchema: QuerySchema;
|
|
83
|
-
responseSchema: Response;
|
|
84
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
85
|
-
useContext?: () => Context;
|
|
86
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
87
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
88
|
-
onMutateResult: OnMutateResult | undefined;
|
|
89
|
-
}) => void | Promise<void>;
|
|
90
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
91
|
-
onMutateResult: OnMutateResult | undefined;
|
|
92
|
-
}) => void | Promise<void>;
|
|
93
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
94
|
-
onMutateResult: OnMutateResult | undefined;
|
|
95
|
-
}) => void | Promise<void>;
|
|
96
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
97
|
-
urlParams: UrlParams<Url>;
|
|
98
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, QuerySchema>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, RequestSchema, Response, QuerySchema>;
|
|
99
|
-
mutation<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown>(config: {
|
|
100
|
-
method: Method;
|
|
101
|
-
url: Url;
|
|
102
|
-
requestSchema: RequestSchema;
|
|
103
|
-
querySchema: QuerySchema;
|
|
104
|
-
responseSchema: Response;
|
|
105
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
106
|
-
useContext?: () => Context;
|
|
107
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
108
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
109
|
-
onMutateResult: OnMutateResult | undefined;
|
|
110
|
-
}) => void | Promise<void>;
|
|
111
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
112
|
-
onMutateResult: OnMutateResult | undefined;
|
|
113
|
-
}) => void | Promise<void>;
|
|
114
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
115
|
-
onMutateResult: OnMutateResult | undefined;
|
|
116
|
-
}) => void | Promise<void>;
|
|
117
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, QuerySchema>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, RequestSchema, Response, QuerySchema>;
|
|
118
|
-
mutation<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown>(config: {
|
|
119
|
-
method: Method;
|
|
120
|
-
url: Url;
|
|
121
|
-
requestSchema: RequestSchema;
|
|
122
|
-
responseSchema: Response;
|
|
123
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
124
|
-
useContext?: () => Context;
|
|
125
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
126
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
127
|
-
onMutateResult: OnMutateResult | undefined;
|
|
128
|
-
}) => void | Promise<void>;
|
|
129
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
130
|
-
onMutateResult: OnMutateResult | undefined;
|
|
131
|
-
}) => void | Promise<void>;
|
|
132
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
133
|
-
onMutateResult: OnMutateResult | undefined;
|
|
134
|
-
}) => void | Promise<void>;
|
|
135
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, undefined>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, RequestSchema, Response>;
|
|
136
|
-
mutation<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(config: {
|
|
137
|
-
method: Method;
|
|
138
|
-
url: Url;
|
|
139
|
-
useKey: UseKey;
|
|
140
|
-
requestSchema: RequestSchema;
|
|
141
|
-
responseSchema: Response;
|
|
142
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
143
|
-
useContext?: () => Context;
|
|
144
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
145
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
146
|
-
onMutateResult: OnMutateResult | undefined;
|
|
147
|
-
}) => void | Promise<void>;
|
|
148
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
149
|
-
onMutateResult: OnMutateResult | undefined;
|
|
150
|
-
}) => void | Promise<void>;
|
|
151
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
152
|
-
onMutateResult: OnMutateResult | undefined;
|
|
153
|
-
}) => void | Promise<void>;
|
|
154
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
155
|
-
urlParams: UrlParams<Url>;
|
|
156
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, undefined>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, RequestSchema, Response>;
|
|
157
|
-
mutation<Method extends 'DELETE' = 'DELETE', Url extends string = string, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(config: {
|
|
158
|
-
method: Method;
|
|
159
|
-
url: Url;
|
|
160
|
-
useKey: UseKey;
|
|
161
|
-
querySchema: QuerySchema;
|
|
162
|
-
responseSchema: Response;
|
|
163
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
164
|
-
useContext?: () => Context;
|
|
165
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
166
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
167
|
-
onMutateResult: OnMutateResult | undefined;
|
|
168
|
-
}) => void | Promise<void>;
|
|
169
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
170
|
-
onMutateResult: OnMutateResult | undefined;
|
|
171
|
-
}) => void | Promise<void>;
|
|
172
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
173
|
-
onMutateResult: OnMutateResult | undefined;
|
|
174
|
-
}) => void | Promise<void>;
|
|
175
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
176
|
-
urlParams: UrlParams<Url>;
|
|
177
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, undefined, QuerySchema>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, undefined, Response, QuerySchema>;
|
|
178
|
-
mutation<Method extends 'DELETE' = 'DELETE', Url extends string = string, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown>(config: {
|
|
179
|
-
method: Method;
|
|
180
|
-
url: Url;
|
|
181
|
-
querySchema: QuerySchema;
|
|
182
|
-
responseSchema: Response;
|
|
183
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
184
|
-
useContext?: () => Context;
|
|
185
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
186
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
187
|
-
onMutateResult: OnMutateResult | undefined;
|
|
188
|
-
}) => void | Promise<void>;
|
|
189
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
190
|
-
onMutateResult: OnMutateResult | undefined;
|
|
191
|
-
}) => void | Promise<void>;
|
|
192
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
193
|
-
onMutateResult: OnMutateResult | undefined;
|
|
194
|
-
}) => void | Promise<void>;
|
|
195
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, undefined, QuerySchema>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, undefined, Response, QuerySchema>;
|
|
196
|
-
mutation<Method extends 'DELETE' = 'DELETE', Url extends string = string, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(config: {
|
|
197
|
-
method: Method;
|
|
198
|
-
url: Url;
|
|
199
|
-
useKey: UseKey;
|
|
200
|
-
responseSchema: Response;
|
|
201
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
202
|
-
useContext?: () => Context;
|
|
203
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
204
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
205
|
-
onMutateResult: OnMutateResult | undefined;
|
|
206
|
-
}) => void | Promise<void>;
|
|
207
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
208
|
-
onMutateResult: OnMutateResult | undefined;
|
|
209
|
-
}) => void | Promise<void>;
|
|
210
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
211
|
-
onMutateResult: OnMutateResult | undefined;
|
|
212
|
-
}) => void | Promise<void>;
|
|
213
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
214
|
-
urlParams: UrlParams<Url>;
|
|
215
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, undefined, undefined>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, undefined, Response>;
|
|
216
|
-
mutation<Method extends 'DELETE' = 'DELETE', Url extends string = string, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown>(config: {
|
|
217
|
-
method: Method;
|
|
218
|
-
url: Url;
|
|
219
|
-
responseSchema: Response;
|
|
220
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
221
|
-
useContext?: () => Context;
|
|
222
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
223
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
224
|
-
onMutateResult: OnMutateResult | undefined;
|
|
225
|
-
}) => void | Promise<void>;
|
|
226
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
227
|
-
onMutateResult: OnMutateResult | undefined;
|
|
228
|
-
}) => void | Promise<void>;
|
|
229
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
230
|
-
onMutateResult: OnMutateResult | undefined;
|
|
231
|
-
}) => void | Promise<void>;
|
|
232
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, undefined, undefined>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, undefined, Response>;
|
|
233
|
-
queryFromEndpoint<Method extends 'GET' | 'HEAD' | 'OPTIONS' = 'GET', Url extends string = string, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, Result = z.output<Response>>(endpoint: {
|
|
234
|
-
config: BaseEndpointConfig<Method, Url, QuerySchema, Response>;
|
|
235
|
-
}, options?: {
|
|
236
|
-
processResponse?: (data: z.output<Response>) => Result;
|
|
237
|
-
}): (params: Util_FlatObject<QueryArgs<Url, QuerySchema>>) => UseSuspenseQueryOptions<Result, Error, Result, DataTag<Split<Url, '/'>, Result, Error>> & QueryHelpers<Url, QuerySchema, Result>;
|
|
238
|
-
queryFromEndpoint<Method extends 'GET' | 'HEAD' | 'OPTIONS' = 'GET', Url extends string = string, Response extends ZodType = ZodType, Result = z.output<Response>>(endpoint: {
|
|
239
|
-
config: BaseEndpointConfig<Method, Url, undefined, Response>;
|
|
240
|
-
}, options?: {
|
|
241
|
-
processResponse?: (data: z.output<Response>) => Result;
|
|
242
|
-
}): ((params: Util_FlatObject<QueryArgs<Url, undefined>>) => UseSuspenseQueryOptions<Result, Error, Result, DataTag<Split<Url, '/'>, Result, Error>>) & QueryHelpers<Url, undefined, Result>;
|
|
243
|
-
infiniteQueryFromEndpoint<Method extends 'GET' | 'HEAD' | 'OPTIONS' = 'GET', Url extends string = string, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, PageResult = z.output<Response>, Result = InfiniteData<PageResult>>(endpoint: {
|
|
244
|
-
config: BaseEndpointConfig<Method, Url, QuerySchema, Response>;
|
|
245
|
-
}, options: {
|
|
246
|
-
processResponse?: (data: z.output<Response>) => PageResult;
|
|
247
|
-
getNextPageParam: (lastPage: PageResult, allPages: PageResult[], lastPageParam: z.infer<QuerySchema> | undefined, allPageParams: z.infer<QuerySchema>[] | undefined) => z.input<QuerySchema> | undefined;
|
|
248
|
-
getPreviousPageParam?: (firstPage: PageResult, allPages: PageResult[], lastPageParam: z.infer<QuerySchema> | undefined, allPageParams: z.infer<QuerySchema>[] | undefined) => z.input<QuerySchema>;
|
|
249
|
-
}): ((params: Util_FlatObject<QueryArgs<Url, QuerySchema>>) => UseSuspenseInfiniteQueryOptions<PageResult, Error, Result, DataTag<Split<Url, '/'>, PageResult, Error>, z.output<QuerySchema>>) & QueryHelpers<Url, QuerySchema, PageResult, true>;
|
|
250
|
-
mutationFromEndpoint<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(endpoint: {
|
|
251
|
-
config: BaseEndpointConfig<Method, Url, QuerySchema, Response, RequestSchema>;
|
|
252
|
-
}, mutationOptions: {
|
|
253
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
254
|
-
useKey: UseKey;
|
|
255
|
-
useContext?: () => Context;
|
|
256
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
257
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
258
|
-
onMutateResult: OnMutateResult | undefined;
|
|
259
|
-
}) => void | Promise<void>;
|
|
260
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
261
|
-
onMutateResult: OnMutateResult | undefined;
|
|
262
|
-
}) => void | Promise<void>;
|
|
263
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
264
|
-
onMutateResult: OnMutateResult | undefined;
|
|
265
|
-
}) => void | Promise<void>;
|
|
266
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
267
|
-
urlParams: UrlParams<Url>;
|
|
268
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, QuerySchema>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, RequestSchema, Response, QuerySchema>;
|
|
269
|
-
mutationFromEndpoint<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(endpoint: {
|
|
270
|
-
config: BaseEndpointConfig<Method, Url, undefined, Response, RequestSchema>;
|
|
271
|
-
}, mutationOptions: {
|
|
272
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
273
|
-
useKey: UseKey;
|
|
274
|
-
useContext?: () => Context;
|
|
275
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
276
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
277
|
-
onMutateResult: OnMutateResult | undefined;
|
|
278
|
-
}) => void | Promise<void>;
|
|
279
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
280
|
-
onMutateResult: OnMutateResult | undefined;
|
|
281
|
-
}) => void | Promise<void>;
|
|
282
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
283
|
-
onMutateResult: OnMutateResult | undefined;
|
|
284
|
-
}) => void | Promise<void>;
|
|
285
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
286
|
-
urlParams: UrlParams<Url>;
|
|
287
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, undefined>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, RequestSchema, Response, undefined>;
|
|
288
|
-
mutationFromEndpoint<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown>(endpoint: {
|
|
289
|
-
config: BaseEndpointConfig<Method, Url, QuerySchema, Response, RequestSchema>;
|
|
290
|
-
}, mutationOptions: {
|
|
291
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
292
|
-
useContext?: () => Context;
|
|
293
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
294
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
295
|
-
onMutateResult: OnMutateResult | undefined;
|
|
296
|
-
}) => void | Promise<void>;
|
|
297
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
298
|
-
onMutateResult: OnMutateResult | undefined;
|
|
299
|
-
}) => void | Promise<void>;
|
|
300
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
301
|
-
onMutateResult: OnMutateResult | undefined;
|
|
302
|
-
}) => void | Promise<void>;
|
|
303
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, QuerySchema>, OnMutateResult>) & EndpointHelper<Method, Url, RequestSchema, Response, QuerySchema>;
|
|
304
|
-
mutationFromEndpoint<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown>(endpoint: {
|
|
305
|
-
config: BaseEndpointConfig<Method, Url, undefined, Response, RequestSchema>;
|
|
306
|
-
}, mutationOptions: {
|
|
307
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
308
|
-
useContext?: () => Context;
|
|
309
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
310
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
311
|
-
onMutateResult: OnMutateResult | undefined;
|
|
312
|
-
}) => void | Promise<void>;
|
|
313
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
314
|
-
onMutateResult: OnMutateResult | undefined;
|
|
315
|
-
}) => void | Promise<void>;
|
|
316
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
317
|
-
onMutateResult: OnMutateResult | undefined;
|
|
318
|
-
}) => void | Promise<void>;
|
|
319
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, undefined>, OnMutateResult>) & EndpointHelper<Method, Url, RequestSchema, Response, undefined>;
|
|
320
|
-
mutationFromEndpoint<Method extends 'DELETE' = 'DELETE', Url extends string = string, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(endpoint: {
|
|
321
|
-
config: BaseEndpointConfig<Method, Url, QuerySchema, Response>;
|
|
322
|
-
}, mutationOptions: {
|
|
323
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
324
|
-
useKey: UseKey;
|
|
325
|
-
useContext?: () => Context;
|
|
326
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
327
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
328
|
-
onMutateResult: OnMutateResult | undefined;
|
|
329
|
-
}) => void | Promise<void>;
|
|
330
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
331
|
-
onMutateResult: OnMutateResult | undefined;
|
|
332
|
-
}) => void | Promise<void>;
|
|
333
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
334
|
-
onMutateResult: OnMutateResult | undefined;
|
|
335
|
-
}) => void | Promise<void>;
|
|
336
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, undefined, QuerySchema>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, undefined, Response, QuerySchema>;
|
|
337
|
-
mutationFromEndpoint<Method extends 'DELETE' = 'DELETE', Url extends string = string, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(endpoint: {
|
|
338
|
-
config: BaseEndpointConfig<Method, Url, undefined, Response>;
|
|
339
|
-
}, mutationOptions: {
|
|
340
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
341
|
-
useKey: UseKey;
|
|
342
|
-
useContext?: () => Context;
|
|
343
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
344
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
345
|
-
onMutateResult: OnMutateResult | undefined;
|
|
346
|
-
}) => void | Promise<void>;
|
|
347
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
348
|
-
onMutateResult: OnMutateResult | undefined;
|
|
349
|
-
}) => void | Promise<void>;
|
|
350
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
351
|
-
onMutateResult: OnMutateResult | undefined;
|
|
352
|
-
}) => void | Promise<void>;
|
|
353
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
354
|
-
urlParams: UrlParams<Url>;
|
|
355
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, undefined, undefined>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, undefined, Response, undefined>;
|
|
356
|
-
mutationFromEndpoint<Method extends 'DELETE' = 'DELETE', Url extends string = string, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown>(endpoint: {
|
|
357
|
-
config: BaseEndpointConfig<Method, Url, QuerySchema, Response>;
|
|
358
|
-
}, mutationOptions: {
|
|
359
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
360
|
-
useContext?: () => Context;
|
|
361
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
362
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
363
|
-
onMutateResult: OnMutateResult | undefined;
|
|
364
|
-
}) => void | Promise<void>;
|
|
365
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
366
|
-
onMutateResult: OnMutateResult | undefined;
|
|
367
|
-
}) => void | Promise<void>;
|
|
368
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
369
|
-
onMutateResult: OnMutateResult | undefined;
|
|
370
|
-
}) => void | Promise<void>;
|
|
371
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, undefined, QuerySchema>, OnMutateResult>) & EndpointHelper<Method, Url, undefined, Response, QuerySchema>;
|
|
372
|
-
mutationFromEndpoint<Method extends 'DELETE' = 'DELETE', Url extends string = string, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown>(endpoint: {
|
|
373
|
-
config: BaseEndpointConfig<Method, Url, undefined, Response>;
|
|
374
|
-
}, mutationOptions: {
|
|
375
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
376
|
-
useContext?: () => Context;
|
|
377
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
378
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
379
|
-
onMutateResult: OnMutateResult | undefined;
|
|
380
|
-
}) => void | Promise<void>;
|
|
381
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
382
|
-
onMutateResult: OnMutateResult | undefined;
|
|
383
|
-
}) => void | Promise<void>;
|
|
384
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
385
|
-
onMutateResult: OnMutateResult | undefined;
|
|
386
|
-
}) => void | Promise<void>;
|
|
387
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, undefined, undefined>, OnMutateResult>) & EndpointHelper<Method, Url, undefined, Response, undefined>;
|
|
388
|
-
multipartMutation<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(config: {
|
|
389
|
-
method: Method;
|
|
390
|
-
url: Url;
|
|
391
|
-
useKey: UseKey;
|
|
392
|
-
requestSchema: RequestSchema;
|
|
393
|
-
querySchema: QuerySchema;
|
|
394
|
-
responseSchema: Response;
|
|
395
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
396
|
-
useContext?: () => Context;
|
|
397
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
398
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
399
|
-
onMutateResult: OnMutateResult | undefined;
|
|
400
|
-
}) => void | Promise<void>;
|
|
401
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
402
|
-
onMutateResult: OnMutateResult | undefined;
|
|
403
|
-
}) => void | Promise<void>;
|
|
404
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
405
|
-
onMutateResult: OnMutateResult | undefined;
|
|
406
|
-
}) => void | Promise<void>;
|
|
407
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
408
|
-
urlParams: UrlParams<Url>;
|
|
409
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, QuerySchema>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, RequestSchema, Response, QuerySchema>;
|
|
410
|
-
multipartMutation<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, QuerySchema extends ZodObject = ZodObject, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown>(config: {
|
|
411
|
-
method: Method;
|
|
412
|
-
url: Url;
|
|
413
|
-
requestSchema: RequestSchema;
|
|
414
|
-
querySchema: QuerySchema;
|
|
415
|
-
responseSchema: Response;
|
|
416
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
417
|
-
useContext?: () => Context;
|
|
418
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
419
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
420
|
-
onMutateResult: OnMutateResult | undefined;
|
|
421
|
-
}) => void | Promise<void>;
|
|
422
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
423
|
-
onMutateResult: OnMutateResult | undefined;
|
|
424
|
-
}) => void | Promise<void>;
|
|
425
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
426
|
-
onMutateResult: OnMutateResult | undefined;
|
|
427
|
-
}) => void | Promise<void>;
|
|
428
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, QuerySchema>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, RequestSchema, Response, QuerySchema>;
|
|
429
|
-
multipartMutation<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown>(config: {
|
|
430
|
-
method: Method;
|
|
431
|
-
url: Url;
|
|
432
|
-
requestSchema: RequestSchema;
|
|
433
|
-
responseSchema: Response;
|
|
434
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
435
|
-
useContext?: () => Context;
|
|
436
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
437
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
438
|
-
onMutateResult: OnMutateResult | undefined;
|
|
439
|
-
}) => void | Promise<void>;
|
|
440
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
441
|
-
onMutateResult: OnMutateResult | undefined;
|
|
442
|
-
}) => void | Promise<void>;
|
|
443
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
444
|
-
onMutateResult: OnMutateResult | undefined;
|
|
445
|
-
}) => void | Promise<void>;
|
|
446
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, undefined>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, RequestSchema, Response>;
|
|
447
|
-
multipartMutation<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, Response extends ZodType = ZodType, ReqResult = z.output<Response>, Result = unknown, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(config: {
|
|
448
|
-
method: Method;
|
|
449
|
-
url: Url;
|
|
450
|
-
useKey: UseKey;
|
|
451
|
-
requestSchema: RequestSchema;
|
|
452
|
-
responseSchema: Response;
|
|
453
|
-
processResponse: ProcessResponseFunction<Result, ReqResult>;
|
|
454
|
-
useContext?: () => Context;
|
|
455
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
456
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
457
|
-
onMutateResult: OnMutateResult | undefined;
|
|
458
|
-
}) => void | Promise<void>;
|
|
459
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
460
|
-
onMutateResult: OnMutateResult | undefined;
|
|
461
|
-
}) => void | Promise<void>;
|
|
462
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
463
|
-
onMutateResult: OnMutateResult | undefined;
|
|
464
|
-
}) => void | Promise<void>;
|
|
465
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
466
|
-
urlParams: UrlParams<Url>;
|
|
467
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, undefined>, OnMutateResult>) & MutationHelpers<Url, Result> & EndpointHelper<Method, Url, RequestSchema, Response>;
|
|
468
|
-
mutationFromEndpoint<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, QuerySchema extends ZodObject = ZodObject, Result = Blob, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(endpoint: {
|
|
469
|
-
config: BaseStreamConfig<Method, Url, QuerySchema, RequestSchema>;
|
|
470
|
-
}, mutationOptions: {
|
|
471
|
-
processResponse?: ProcessResponseFunction<Result, Blob>;
|
|
472
|
-
useKey: UseKey;
|
|
473
|
-
useContext?: () => Context;
|
|
474
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
475
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
476
|
-
onMutateResult: OnMutateResult | undefined;
|
|
477
|
-
}) => void | Promise<void>;
|
|
478
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
479
|
-
onMutateResult: OnMutateResult | undefined;
|
|
480
|
-
}) => void | Promise<void>;
|
|
481
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
482
|
-
onMutateResult: OnMutateResult | undefined;
|
|
483
|
-
}) => void | Promise<void>;
|
|
484
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
485
|
-
urlParams: UrlParams<Url>;
|
|
486
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, QuerySchema>, OnMutateResult>) & MutationHelpers<Url, Result> & StreamHelper<Method, Url, RequestSchema, QuerySchema>;
|
|
487
|
-
mutationFromEndpoint<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, QuerySchema extends ZodObject = ZodObject, Result = Blob, OnMutateResult = unknown, Context = unknown>(endpoint: {
|
|
488
|
-
config: BaseStreamConfig<Method, Url, QuerySchema, RequestSchema>;
|
|
489
|
-
}, mutationOptions?: {
|
|
490
|
-
processResponse?: ProcessResponseFunction<Result, Blob>;
|
|
491
|
-
useContext?: () => Context;
|
|
492
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
493
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
494
|
-
onMutateResult: OnMutateResult | undefined;
|
|
495
|
-
}) => void | Promise<void>;
|
|
496
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
497
|
-
onMutateResult: OnMutateResult | undefined;
|
|
498
|
-
}) => void | Promise<void>;
|
|
499
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
500
|
-
onMutateResult: OnMutateResult | undefined;
|
|
501
|
-
}) => void | Promise<void>;
|
|
502
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, QuerySchema>, OnMutateResult>) & StreamHelper<Method, Url, RequestSchema, QuerySchema>;
|
|
503
|
-
mutationFromEndpoint<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, Result = Blob, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(endpoint: {
|
|
504
|
-
config: BaseStreamConfig<Method, Url, undefined, RequestSchema>;
|
|
505
|
-
}, mutationOptions: {
|
|
506
|
-
processResponse?: ProcessResponseFunction<Result, Blob>;
|
|
507
|
-
useKey: UseKey;
|
|
508
|
-
useContext?: () => Context;
|
|
509
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
510
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
511
|
-
onMutateResult: OnMutateResult | undefined;
|
|
512
|
-
}) => void | Promise<void>;
|
|
513
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
514
|
-
onMutateResult: OnMutateResult | undefined;
|
|
515
|
-
}) => void | Promise<void>;
|
|
516
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
517
|
-
onMutateResult: OnMutateResult | undefined;
|
|
518
|
-
}) => void | Promise<void>;
|
|
519
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
520
|
-
urlParams: UrlParams<Url>;
|
|
521
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, undefined>, OnMutateResult>) & MutationHelpers<Url, Result> & StreamHelper<Method, Url, RequestSchema, undefined>;
|
|
522
|
-
mutationFromEndpoint<Method extends 'POST' | 'PUT' | 'PATCH' = 'POST' | 'PUT' | 'PATCH', Url extends string = string, RequestSchema extends ZodType = ZodType, Result = Blob, OnMutateResult = unknown, Context = unknown>(endpoint: {
|
|
523
|
-
config: BaseStreamConfig<Method, Url, undefined, RequestSchema>;
|
|
524
|
-
}, mutationOptions?: {
|
|
525
|
-
processResponse?: ProcessResponseFunction<Result, Blob>;
|
|
526
|
-
useContext?: () => Context;
|
|
527
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
528
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
529
|
-
onMutateResult: OnMutateResult | undefined;
|
|
530
|
-
}) => void | Promise<void>;
|
|
531
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
532
|
-
onMutateResult: OnMutateResult | undefined;
|
|
533
|
-
}) => void | Promise<void>;
|
|
534
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, RequestSchema, undefined>>, context: Context & MutationFunctionContext & {
|
|
535
|
-
onMutateResult: OnMutateResult | undefined;
|
|
536
|
-
}) => void | Promise<void>;
|
|
537
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, RequestSchema, undefined>, OnMutateResult>) & StreamHelper<Method, Url, RequestSchema, undefined>;
|
|
538
|
-
mutationFromEndpoint<Method extends 'GET' | 'DELETE' | 'OPTIONS' | 'HEAD' = 'GET', Url extends string = string, QuerySchema extends ZodObject = ZodObject, Result = Blob, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(endpoint: {
|
|
539
|
-
config: BaseStreamConfig<Method, Url, QuerySchema, undefined>;
|
|
540
|
-
}, mutationOptions: {
|
|
541
|
-
processResponse?: ProcessResponseFunction<Result, Blob>;
|
|
542
|
-
useKey: UseKey;
|
|
543
|
-
useContext?: () => Context;
|
|
544
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
545
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
546
|
-
onMutateResult: OnMutateResult | undefined;
|
|
547
|
-
}) => void | Promise<void>;
|
|
548
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
549
|
-
onMutateResult: OnMutateResult | undefined;
|
|
550
|
-
}) => void | Promise<void>;
|
|
551
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
552
|
-
onMutateResult: OnMutateResult | undefined;
|
|
553
|
-
}) => void | Promise<void>;
|
|
554
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
555
|
-
urlParams: UrlParams<Url>;
|
|
556
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, undefined, QuerySchema>, OnMutateResult>) & MutationHelpers<Url, Result> & StreamHelper<Method, Url, undefined, QuerySchema>;
|
|
557
|
-
mutationFromEndpoint<Method extends 'GET' | 'DELETE' | 'OPTIONS' | 'HEAD' = 'GET', Url extends string = string, QuerySchema extends ZodObject = ZodObject, Result = Blob, OnMutateResult = unknown, Context = unknown>(endpoint: {
|
|
558
|
-
config: BaseStreamConfig<Method, Url, QuerySchema, undefined>;
|
|
559
|
-
}, mutationOptions?: {
|
|
560
|
-
processResponse?: ProcessResponseFunction<Result, Blob>;
|
|
561
|
-
useContext?: () => Context;
|
|
562
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
563
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
564
|
-
onMutateResult: OnMutateResult | undefined;
|
|
565
|
-
}) => void | Promise<void>;
|
|
566
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
567
|
-
onMutateResult: OnMutateResult | undefined;
|
|
568
|
-
}) => void | Promise<void>;
|
|
569
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, QuerySchema>>, context: Context & MutationFunctionContext & {
|
|
570
|
-
onMutateResult: OnMutateResult | undefined;
|
|
571
|
-
}) => void | Promise<void>;
|
|
572
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, undefined, QuerySchema>, OnMutateResult>) & StreamHelper<Method, Url, undefined, QuerySchema>;
|
|
573
|
-
mutationFromEndpoint<Method extends 'GET' | 'DELETE' | 'OPTIONS' | 'HEAD' = 'GET', Url extends string = string, Result = Blob, OnMutateResult = unknown, Context = unknown, UseKey extends true = true>(endpoint: {
|
|
574
|
-
config: BaseStreamConfig<Method, Url, undefined, undefined>;
|
|
575
|
-
}, mutationOptions: {
|
|
576
|
-
processResponse?: ProcessResponseFunction<Result, Blob>;
|
|
577
|
-
useKey: UseKey;
|
|
578
|
-
useContext?: () => Context;
|
|
579
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
580
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
581
|
-
onMutateResult: OnMutateResult | undefined;
|
|
582
|
-
}) => void | Promise<void>;
|
|
583
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
584
|
-
onMutateResult: OnMutateResult | undefined;
|
|
585
|
-
}) => void | Promise<void>;
|
|
586
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
587
|
-
onMutateResult: OnMutateResult | undefined;
|
|
588
|
-
}) => void | Promise<void>;
|
|
589
|
-
}): ((params: UrlHasParams<Url> extends true ? {
|
|
590
|
-
urlParams: UrlParams<Url>;
|
|
591
|
-
} : {}) => UseMutationResult<Result, Error, MutationArgs<Url, undefined, undefined>, OnMutateResult>) & MutationHelpers<Url, Result> & StreamHelper<Method, Url, undefined, undefined>;
|
|
592
|
-
mutationFromEndpoint<Method extends 'GET' | 'DELETE' | 'OPTIONS' | 'HEAD' = 'GET', Url extends string = string, Result = Blob, OnMutateResult = unknown, Context = unknown>(endpoint: {
|
|
593
|
-
config: BaseStreamConfig<Method, Url, undefined, undefined>;
|
|
594
|
-
}, mutationOptions?: {
|
|
595
|
-
processResponse?: ProcessResponseFunction<Result, Blob>;
|
|
596
|
-
useContext?: () => Context;
|
|
597
|
-
onMutate?: (variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext) => OnMutateResult | Promise<OnMutateResult>;
|
|
598
|
-
onSuccess?: (data: NoInfer<Result>, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
599
|
-
onMutateResult: OnMutateResult | undefined;
|
|
600
|
-
}) => void | Promise<void>;
|
|
601
|
-
onError?: (error: Error, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
602
|
-
onMutateResult: OnMutateResult | undefined;
|
|
603
|
-
}) => void | Promise<void>;
|
|
604
|
-
onSettled?: (data: NoInfer<Result> | undefined, error: Error | null, variables: Util_FlatObject<MutationArgs<Url, undefined, undefined>>, context: Context & MutationFunctionContext & {
|
|
605
|
-
onMutateResult: OnMutateResult | undefined;
|
|
606
|
-
}) => void | Promise<void>;
|
|
607
|
-
}): (() => UseMutationResult<Result, Error, MutationArgs<Url, undefined, undefined>, OnMutateResult>) & StreamHelper<Method, Url, undefined, undefined>;
|
|
608
|
-
}
|
|
1
|
+
export * from './types/index.mjs';
|
|
609
2
|
//# sourceMappingURL=types.d.mts.map
|