@kubb/plugin-react-query 5.0.0-beta.84 → 5.0.0-beta.86
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/index.cjs +244 -240
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +170 -117
- package/dist/index.js +244 -240
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { Exclude, Group, Include, Output, OutputOptions, Override, PluginFactoryOptions, Resolver, ast } from "kubb/kit";
|
|
2
|
+
import { Exclude, Group, Include, Output, OutputOptions, Override, PluginFactoryOptions, Resolver, ResolverPatch, ast } from "kubb/kit";
|
|
3
3
|
//#region ../../internals/client/src/resolveClient.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Resolves which client plugin a consumer (react-query, vue-query, swr, mcp) should call for an
|
|
@@ -31,124 +31,177 @@ type Transformer = (props: {
|
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/types.d.ts
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* The concrete resolver type for `@kubb/plugin-react-query`.
|
|
35
|
+
* Extends the base `Resolver` (which provides `default` naming and option helpers, the top-level
|
|
36
|
+
* `name` casing, and the `file` builder) with plugin-specific naming namespaces for the generated
|
|
37
|
+
* `useQuery`, `useSuspenseQuery`, `useInfiniteQuery`, `useSuspenseInfiniteQuery`, and `useMutation`
|
|
38
|
+
* hooks and their companion helpers.
|
|
35
39
|
*/
|
|
36
40
|
type ResolverReactQuery = Resolver & {
|
|
37
41
|
/**
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
42
|
+
* Naming for the generated `useQuery` hook and its companion helpers.
|
|
43
|
+
*/
|
|
44
|
+
query: {
|
|
45
|
+
/**
|
|
46
|
+
* Resolves a query hook function name.
|
|
47
|
+
*
|
|
48
|
+
* @example Query hook names
|
|
49
|
+
* `resolver.query.name(node) // → 'useGetPetById'`
|
|
50
|
+
*/
|
|
51
|
+
name(node: ast.OperationNode): string;
|
|
52
|
+
/**
|
|
53
|
+
* Resolves the query options helper name.
|
|
54
|
+
*
|
|
55
|
+
* @example Query options helper names
|
|
56
|
+
* `resolver.query.optionsName(node) // → 'getPetByIdQueryOptions'`
|
|
57
|
+
*/
|
|
58
|
+
optionsName(node: ast.OperationNode): string;
|
|
59
|
+
/**
|
|
60
|
+
* Resolves the query key helper name.
|
|
61
|
+
*
|
|
62
|
+
* @example Query key helper names
|
|
63
|
+
* `resolver.query.keyName(node) // → 'getPetByIdQueryKey'`
|
|
64
|
+
*/
|
|
65
|
+
keyName(node: ast.OperationNode): string;
|
|
66
|
+
/**
|
|
67
|
+
* Resolves the query key type name.
|
|
68
|
+
*
|
|
69
|
+
* @example Query key type names
|
|
70
|
+
* `resolver.query.keyTypeName(node) // → 'GetPetByIdQueryKey'`
|
|
71
|
+
*/
|
|
72
|
+
keyTypeName(node: ast.OperationNode): string;
|
|
73
|
+
/**
|
|
74
|
+
* Resolves the client function name generated inline by query hooks.
|
|
75
|
+
*
|
|
76
|
+
* @example Client function names
|
|
77
|
+
* `resolver.query.clientName(node) // → 'getPetById'`
|
|
78
|
+
*/
|
|
79
|
+
clientName(node: ast.OperationNode): string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Naming for the generated `useSuspenseQuery` hook and its companion helpers.
|
|
83
|
+
*/
|
|
84
|
+
suspenseQuery: {
|
|
85
|
+
/**
|
|
86
|
+
* Resolves a suspense query hook function name.
|
|
87
|
+
*
|
|
88
|
+
* @example Suspense query hook names
|
|
89
|
+
* `resolver.suspenseQuery.name(node) // → 'useGetPetByIdSuspense'`
|
|
90
|
+
*/
|
|
91
|
+
name(node: ast.OperationNode): string;
|
|
92
|
+
/**
|
|
93
|
+
* Resolves the suspense query options helper name.
|
|
94
|
+
*/
|
|
95
|
+
optionsName(node: ast.OperationNode): string;
|
|
96
|
+
/**
|
|
97
|
+
* Resolves the suspense query key helper name.
|
|
98
|
+
*/
|
|
99
|
+
keyName(node: ast.OperationNode): string;
|
|
100
|
+
/**
|
|
101
|
+
* Resolves the suspense query key type name.
|
|
102
|
+
*/
|
|
103
|
+
keyTypeName(node: ast.OperationNode): string;
|
|
104
|
+
/**
|
|
105
|
+
* Resolves the client function name generated inline by suspense query hooks.
|
|
106
|
+
*/
|
|
107
|
+
clientName(node: ast.OperationNode): string;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Naming for the generated `useInfiniteQuery` hook and its companion helpers.
|
|
111
|
+
*/
|
|
112
|
+
infiniteQuery: {
|
|
113
|
+
/**
|
|
114
|
+
* Resolves an infinite query hook function name.
|
|
115
|
+
*
|
|
116
|
+
* @example Infinite query hook names
|
|
117
|
+
* `resolver.infiniteQuery.name(node) // → 'useGetPetByIdInfinite'`
|
|
118
|
+
*/
|
|
119
|
+
name(node: ast.OperationNode): string;
|
|
120
|
+
/**
|
|
121
|
+
* Resolves the infinite query options helper name.
|
|
122
|
+
*/
|
|
123
|
+
optionsName(node: ast.OperationNode): string;
|
|
124
|
+
/**
|
|
125
|
+
* Resolves the infinite query key helper name.
|
|
126
|
+
*/
|
|
127
|
+
keyName(node: ast.OperationNode): string;
|
|
128
|
+
/**
|
|
129
|
+
* Resolves the infinite query key type name.
|
|
130
|
+
*/
|
|
131
|
+
keyTypeName(node: ast.OperationNode): string;
|
|
132
|
+
/**
|
|
133
|
+
* Resolves the client function name generated inline by infinite query hooks.
|
|
134
|
+
*/
|
|
135
|
+
clientName(node: ast.OperationNode): string;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Naming for the generated `useSuspenseInfiniteQuery` hook and its companion helpers.
|
|
139
|
+
*/
|
|
140
|
+
suspenseInfiniteQuery: {
|
|
141
|
+
/**
|
|
142
|
+
* Resolves a suspense infinite query hook function name.
|
|
143
|
+
*
|
|
144
|
+
* @example Suspense infinite query hook names
|
|
145
|
+
* `resolver.suspenseInfiniteQuery.name(node) // → 'useGetPetByIdSuspenseInfinite'`
|
|
146
|
+
*/
|
|
147
|
+
name(node: ast.OperationNode): string;
|
|
148
|
+
/**
|
|
149
|
+
* Resolves the suspense infinite query options helper name.
|
|
150
|
+
*/
|
|
151
|
+
optionsName(node: ast.OperationNode): string;
|
|
152
|
+
/**
|
|
153
|
+
* Resolves the suspense infinite query key helper name.
|
|
154
|
+
*/
|
|
155
|
+
keyName(node: ast.OperationNode): string;
|
|
156
|
+
/**
|
|
157
|
+
* Resolves the suspense infinite query key type name.
|
|
158
|
+
*/
|
|
159
|
+
keyTypeName(node: ast.OperationNode): string;
|
|
160
|
+
/**
|
|
161
|
+
* Resolves the client function name generated inline by suspense infinite query hooks.
|
|
162
|
+
*/
|
|
163
|
+
clientName(node: ast.OperationNode): string;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Naming for the generated `useMutation` hook and its companion helpers.
|
|
167
|
+
*/
|
|
168
|
+
mutation: {
|
|
169
|
+
/**
|
|
170
|
+
* Resolves a mutation hook function name.
|
|
171
|
+
*
|
|
172
|
+
* @example Mutation hook names
|
|
173
|
+
* `resolver.mutation.name(node) // → 'useUpdatePet'`
|
|
174
|
+
*/
|
|
175
|
+
name(node: ast.OperationNode): string;
|
|
176
|
+
/**
|
|
177
|
+
* Resolves the mutation options helper name.
|
|
178
|
+
*/
|
|
179
|
+
optionsName(node: ast.OperationNode): string;
|
|
180
|
+
/**
|
|
181
|
+
* Resolves the mutation key helper name.
|
|
182
|
+
*/
|
|
183
|
+
keyName(node: ast.OperationNode): string;
|
|
184
|
+
/**
|
|
185
|
+
* Resolves the mutation type name.
|
|
186
|
+
*
|
|
187
|
+
* @example Mutation type names
|
|
188
|
+
* `resolver.mutation.typeName(node) // → 'UpdatePet'`
|
|
189
|
+
*/
|
|
190
|
+
typeName(node: ast.OperationNode): string;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Naming for the generated custom hook options file.
|
|
194
|
+
*/
|
|
195
|
+
hook: {
|
|
196
|
+
/**
|
|
197
|
+
* Resolves the generated custom hook options map type name.
|
|
198
|
+
*/
|
|
199
|
+
optionsName(): string;
|
|
200
|
+
/**
|
|
201
|
+
* Resolves the helper function name used inside the custom hook options file.
|
|
202
|
+
*/
|
|
203
|
+
customOptionsName(): string;
|
|
204
|
+
};
|
|
152
205
|
};
|
|
153
206
|
type Suspense = object;
|
|
154
207
|
/**
|
|
@@ -313,7 +366,7 @@ type Options = OutputOptions & {
|
|
|
313
366
|
* Override how hook names and file paths are built. Methods you omit fall
|
|
314
367
|
* back to the default `resolverReactQuery`.
|
|
315
368
|
*/
|
|
316
|
-
resolver?:
|
|
369
|
+
resolver?: ResolverPatch<ResolverReactQuery>;
|
|
317
370
|
/**
|
|
318
371
|
* Set to `false` to skip generating `use*` hook functions. `queryOptions`,
|
|
319
372
|
* `mutationOptions`, `queryKey`, and `mutationKey` helpers are still emitted.
|