@hypequery/react 0.0.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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are advised to review the applicable
150
+ documentation for the specific language governing permissions and
151
+ limitations under each license.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2024 hypequery
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,365 @@
1
+ # @hypequery/react
2
+
3
+ Type-safe React hooks for hypequery APIs. Wraps your generated API definition in thin TanStack Query shims so you can call `useQuery('weeklyRevenue')` with end-to-end type safety.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @hypequery/react @tanstack/react-query
9
+ ```
10
+
11
+ Peer dependencies: `react@^18`, `@tanstack/react-query@^5`.
12
+
13
+ ## Quick Start
14
+
15
+ ```ts
16
+ // lib/analytics.ts
17
+ import { createHooks } from '@hypequery/react';
18
+ import type { Api } from '@/analytics/queries';
19
+
20
+ export const { useQuery, useMutation } = createHooks<Api>({
21
+ baseUrl: '/api',
22
+ });
23
+ ```
24
+
25
+ Wrap your app with TanStack Query's provider:
26
+
27
+ ```tsx
28
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
29
+
30
+ const queryClient = new QueryClient();
31
+
32
+ export function App({ children }: { children: React.ReactNode }) {
33
+ return (
34
+ <QueryClientProvider client={queryClient}>
35
+ {children}
36
+ </QueryClientProvider>
37
+ );
38
+ }
39
+ ```
40
+
41
+ Use the hooks in your components:
42
+
43
+ ```tsx
44
+ // Query
45
+ const { data, error, isLoading } = useQuery('weeklyRevenue', { startDate: '2025-01-01' });
46
+
47
+ // Mutation
48
+ const rebuild = useMutation('rebuildMetrics');
49
+ rebuild.mutate({ force: true });
50
+ ```
51
+
52
+ ---
53
+
54
+ ## API Reference
55
+
56
+ ### `createHooks<Api>(config)`
57
+
58
+ Factory function that creates type-safe `useQuery` and `useMutation` hooks for your API.
59
+
60
+ **Parameters:**
61
+
62
+ ```ts
63
+ interface CreateHooksConfig<TApi> {
64
+ baseUrl: string; // Required: API base URL (e.g., '/api' or 'https://api.example.com')
65
+ fetchFn?: typeof fetch; // Optional: Custom fetch implementation (defaults to global fetch)
66
+ headers?: Record<string, string>; // Optional: Default headers for all requests
67
+ config?: Record<string, QueryMethodConfig>; // Optional: Per-route HTTP method overrides
68
+ api?: TApi; // Optional: API object to auto-extract HTTP methods
69
+ }
70
+
71
+ interface QueryMethodConfig {
72
+ method?: string; // HTTP method: 'GET', 'POST', 'PUT', 'DELETE', etc.
73
+ }
74
+ ```
75
+
76
+ **Returns:**
77
+
78
+ ```ts
79
+ {
80
+ useQuery: <Name>(name, input?, options?) => UseQueryResult<Output, HttpError>,
81
+ useMutation: <Name>(name, options?) => UseMutationResult<Output, HttpError, Input>
82
+ }
83
+ ```
84
+
85
+ **Example:**
86
+
87
+ ```ts
88
+ const { useQuery, useMutation } = createHooks<Api>({
89
+ baseUrl: 'https://api.example.com',
90
+ headers: {
91
+ 'X-API-Key': process.env.API_KEY,
92
+ },
93
+ config: {
94
+ // Override HTTP method for specific routes
95
+ uploadFile: { method: 'POST' },
96
+ },
97
+ });
98
+ ```
99
+
100
+ ---
101
+
102
+ ### `useQuery(name, input?, options?)`
103
+
104
+ Type-safe wrapper around TanStack Query's `useQuery`. Automatically infers input and output types from your API definition.
105
+
106
+ **Signatures:**
107
+
108
+ ```ts
109
+ // No input required
110
+ useQuery(name: Name)
111
+ useQuery(name: Name, options: QueryOptions)
112
+
113
+ // Input required
114
+ useQuery(name: Name, input: Input)
115
+ useQuery(name: Name, input: Input, options: QueryOptions)
116
+ ```
117
+
118
+ **Parameters:**
119
+
120
+ - `name` - Query name from your API definition
121
+ - `input` - Query input (typed from your API). Optional if query has no input schema
122
+ - `options` - TanStack Query options (`enabled`, `staleTime`, `refetchInterval`, etc.)
123
+
124
+ **Returns:** TanStack Query's `UseQueryResult<Output, HttpError>`
125
+
126
+ **Examples:**
127
+
128
+ ```tsx
129
+ // Simple query with no input
130
+ const { data } = useQuery('healthCheck');
131
+
132
+ // Query with input
133
+ const { data, error, isLoading } = useQuery('getUser', { id: '123' });
134
+
135
+ // Query with options
136
+ const { data } = useQuery('getUser', { id: '123' }, {
137
+ enabled: isLoggedIn,
138
+ staleTime: 60000,
139
+ refetchOnWindowFocus: false,
140
+ });
141
+
142
+ // Query without input but with options
143
+ const { data } = useQuery('healthCheck', { refetchInterval: 5000 });
144
+ ```
145
+
146
+ ---
147
+
148
+ ### `useMutation(name, options?)`
149
+
150
+ Type-safe wrapper around TanStack Query's `useMutation`.
151
+
152
+ **Parameters:**
153
+
154
+ - `name` - Mutation name from your API definition
155
+ - `options` - TanStack Query mutation options (`onSuccess`, `onError`, `retry`, etc.)
156
+
157
+ **Returns:** TanStack Query's `UseMutationResult<Output, HttpError, Input>`
158
+
159
+ **Examples:**
160
+
161
+ ```tsx
162
+ // Basic mutation
163
+ const createUser = useMutation('createUser');
164
+ createUser.mutate({ name: 'Alice', email: 'alice@example.com' });
165
+
166
+ // Mutation with callbacks
167
+ const updateProfile = useMutation('updateProfile', {
168
+ onSuccess: (data) => {
169
+ console.log('Profile updated:', data);
170
+ queryClient.invalidateQueries(['hypequery', 'getProfile']);
171
+ },
172
+ onError: (error) => {
173
+ console.error('Failed to update profile:', error.message);
174
+ },
175
+ });
176
+
177
+ updateProfile.mutate({ bio: 'New bio' });
178
+ ```
179
+
180
+ ---
181
+
182
+ ### `queryOptions(options)`
183
+
184
+ Helper function to explicitly mark an object as query options (not input). Useful when your query input and TanStack Query options have overlapping property names.
185
+
186
+ **Parameters:**
187
+
188
+ - `options` - TanStack Query options object
189
+
190
+ **Returns:** The same object with an internal symbol marker
191
+
192
+ **When to use:**
193
+
194
+ If your API input has properties like `enabled`, `staleTime`, etc., the library might misclassify input as options. Use `queryOptions()` to disambiguate:
195
+
196
+ ```tsx
197
+ // ❌ Ambiguous - could be input or options?
198
+ useQuery('getConfig', { enabled: true, staleTime: 5000 });
199
+
200
+ // ✅ Explicit - this is input
201
+ useQuery('getConfig', { enabled: true, staleTime: 5000 });
202
+
203
+ // ✅ Explicit - these are options
204
+ import { queryOptions } from '@hypequery/react';
205
+ useQuery('getConfig', queryOptions({ enabled: true, staleTime: 5000 }));
206
+ ```
207
+
208
+ ---
209
+
210
+ ### `HttpError`
211
+
212
+ Custom error class thrown by failed HTTP requests. Extends the standard `Error` class with additional properties.
213
+
214
+ **Properties:**
215
+
216
+ ```ts
217
+ class HttpError extends Error {
218
+ readonly status: number; // HTTP status code (404, 500, etc.)
219
+ readonly body: unknown; // Parsed response body (JSON or text)
220
+ }
221
+ ```
222
+
223
+ **Usage:**
224
+
225
+ ```tsx
226
+ const { error } = useQuery('getUser', { id: '123' });
227
+
228
+ if (error) {
229
+ console.log(error.message); // "GET request to /api/getUser failed with status 404"
230
+ console.log(error.status); // 404
231
+ console.log(error.body); // { message: "User not found" }
232
+
233
+ // Type-safe instanceof check
234
+ if (error instanceof HttpError) {
235
+ if (error.status === 404) {
236
+ return <NotFound />;
237
+ }
238
+ }
239
+ }
240
+ ```
241
+
242
+ **Error handling example:**
243
+
244
+ ```tsx
245
+ import { HttpError } from '@hypequery/react';
246
+
247
+ function UserProfile({ userId }: { userId: string }) {
248
+ const { data, error, isLoading } = useQuery('getUser', { id: userId });
249
+
250
+ if (isLoading) return <Spinner />;
251
+
252
+ if (error instanceof HttpError) {
253
+ switch (error.status) {
254
+ case 404:
255
+ return <NotFound message="User not found" />;
256
+ case 403:
257
+ return <Unauthorized />;
258
+ case 500:
259
+ return <ServerError details={error.body} />;
260
+ default:
261
+ return <Error message={error.message} />;
262
+ }
263
+ }
264
+
265
+ return <div>{data.name}</div>;
266
+ }
267
+ ```
268
+
269
+ ---
270
+
271
+ ## Advanced Usage
272
+
273
+ ### Custom fetch implementation
274
+
275
+ ```ts
276
+ const { useQuery } = createHooks<Api>({
277
+ baseUrl: '/api',
278
+ fetchFn: async (url, init) => {
279
+ // Add authentication token
280
+ const token = await getAuthToken();
281
+ return fetch(url, {
282
+ ...init,
283
+ headers: {
284
+ ...init?.headers,
285
+ Authorization: `Bearer ${token}`,
286
+ },
287
+ });
288
+ },
289
+ });
290
+ ```
291
+
292
+ ### Default headers
293
+
294
+ ```ts
295
+ const { useQuery } = createHooks<Api>({
296
+ baseUrl: '/api',
297
+ headers: {
298
+ 'X-API-Key': process.env.API_KEY,
299
+ 'X-Client-Version': '1.0.0',
300
+ },
301
+ });
302
+ ```
303
+
304
+ ### HTTP method configuration
305
+
306
+ ```ts
307
+ const { useQuery } = createHooks<Api>({
308
+ baseUrl: '/api',
309
+ config: {
310
+ // Override default GET for specific queries
311
+ refreshCache: { method: 'POST' },
312
+ deleteUser: { method: 'DELETE' },
313
+ },
314
+ });
315
+ ```
316
+
317
+ ### Auto-extract methods from API object
318
+
319
+ If your API definition includes HTTP method information, pass it to auto-configure:
320
+
321
+ ```ts
322
+ import { api } from '@/analytics/queries';
323
+
324
+ const { useQuery } = createHooks({
325
+ baseUrl: '/api',
326
+ api, // Automatically extracts method config from api object
327
+ });
328
+ ```
329
+
330
+ ---
331
+
332
+ ## TypeScript
333
+
334
+ All hooks are fully typed based on your API definition:
335
+
336
+ ```ts
337
+ interface Api {
338
+ getUser: {
339
+ input: { id: string };
340
+ output: { name: string; email: string };
341
+ };
342
+ weeklyRevenue: {
343
+ input: { startDate: string };
344
+ output: { total: number };
345
+ };
346
+ }
347
+
348
+ const { useQuery } = createHooks<Api>({ baseUrl: '/api' });
349
+
350
+ // ✅ TypeScript infers input and output types
351
+ const { data } = useQuery('getUser', { id: '123' });
352
+ // ^? { name: string; email: string } | undefined
353
+
354
+ // ❌ TypeScript error: missing required input
355
+ const { data } = useQuery('getUser');
356
+
357
+ // ❌ TypeScript error: invalid property
358
+ const { data } = useQuery('getUser', { userId: '123' });
359
+ ```
360
+
361
+ ---
362
+
363
+ ## License
364
+
365
+ MIT
@@ -0,0 +1,45 @@
1
+ import { type UseQueryOptions as TanstackUseQueryOptions, type UseMutationOptions as TanstackUseMutationOptions, type UseMutationResult, type UseQueryResult } from '@tanstack/react-query';
2
+ import type { ExtractNames, QueryInput, QueryOutput } from './types.js';
3
+ import { HttpError } from './errors.js';
4
+ export interface QueryMethodConfig {
5
+ method?: string;
6
+ }
7
+ export interface CreateHooksConfig<TApi = any> {
8
+ baseUrl: string;
9
+ fetchFn?: typeof fetch;
10
+ headers?: Record<string, string>;
11
+ config?: Record<string, QueryMethodConfig>;
12
+ api?: TApi;
13
+ }
14
+ /**
15
+ * Symbol used to mark objects as query options (not input)
16
+ * @internal
17
+ */
18
+ declare const OPTIONS_SYMBOL: unique symbol;
19
+ /**
20
+ * Helper to explicitly mark an object as query options
21
+ * Prevents ambiguity when query input and options have overlapping properties
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * // Without helper - ambiguous (could be input or options)
26
+ * useQuery('getData', { enabled: true, staleTime: 5000 })
27
+ *
28
+ * // With helper - explicit
29
+ * useQuery('getData', queryOptions({ enabled: true, staleTime: 5000 }))
30
+ * ```
31
+ */
32
+ export declare function queryOptions<T extends object>(opts: T): T & {
33
+ [OPTIONS_SYMBOL]: true;
34
+ };
35
+ export declare function createHooks<Api extends {
36
+ [K in keyof Api]: {
37
+ input: unknown;
38
+ output: unknown;
39
+ };
40
+ }>(config: CreateHooksConfig): {
41
+ readonly useQuery: <Name extends ExtractNames<Api>>(...args: QueryInput<Api, Name> extends unknown ? unknown extends QueryInput<Api, Name> ? [name: Name, options?: Omit<TanstackUseQueryOptions<QueryOutput<Api, Name>, HttpError, QueryOutput<Api, Name>, ["hypequery", Name, QueryInput<Api, Name>]>, "queryKey" | "queryFn"> | undefined] : [name: Name, input: QueryInput<Api, Name>, options?: Omit<TanstackUseQueryOptions<QueryOutput<Api, Name>, HttpError, QueryOutput<Api, Name>, ["hypequery", Name, QueryInput<Api, Name>]>, "queryKey" | "queryFn"> | undefined] : [name: Name, input: QueryInput<Api, Name>, options?: Omit<TanstackUseQueryOptions<QueryOutput<Api, Name>, HttpError, QueryOutput<Api, Name>, ["hypequery", Name, QueryInput<Api, Name>]>, "queryKey" | "queryFn"> | undefined]) => UseQueryResult<QueryOutput<Api, Name>, HttpError>;
42
+ readonly useMutation: <Name extends ExtractNames<Api>>(name: Name, options?: Omit<TanstackUseMutationOptions<QueryOutput<Api, Name>, HttpError, QueryInput<Api, Name>, unknown>, "mutationFn">) => UseMutationResult<QueryOutput<Api, Name>, HttpError, QueryInput<Api, Name>>;
43
+ };
44
+ export {};
45
+ //# sourceMappingURL=createHooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createHooks.d.ts","sourceRoot":"","sources":["../src/createHooks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,IAAI,uBAAuB,EAC/C,KAAK,kBAAkB,IAAI,0BAA0B,EACrD,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,YAAY,EACZ,UAAU,EACV,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD,MAAM,WAAW,iBAAiB,CAAC,IAAI,GAAG,GAAG;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED;;;GAGG;AACH,QAAA,MAAM,cAAc,eAAkC,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG;IAAE,CAAC,cAAc,CAAC,EAAE,IAAI,CAAA;CAAE,CAEtF;AA4DD,wBAAgB,WAAW,CAAC,GAAG,SAAS;KACrC,CAAC,IAAI,MAAM,GAAG,GAAG;QAChB,KAAK,EAAE,OAAO,CAAC;QACf,MAAM,EAAE,OAAO,CAAC;KACjB;CACF,EAAE,MAAM,EAAE,iBAAiB;wBAiFR,IAAI,SAAS,YAAY,CAAC,GAAG,CAAC,kuBAE7C,cAAc,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS,CAAC;2BAoD/B,IAAI,SAAS,YAAY,CAAC,GAAG,CAAC,QAC3C,IAAI,kIAET,iBAAiB,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;EAW/E"}