@razakalpha/convngx 0.2.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/index.d.ts ADDED
@@ -0,0 +1,2678 @@
1
+ import { BaseConvexClientOptions, OptimisticUpdate } from 'convex/browser';
2
+ import { FunctionReference, FunctionArgs, FunctionReturnType } from 'convex/server';
3
+ import * as _angular_core from '@angular/core';
4
+ import { InjectionToken, Provider, ResourceRef, Signal } from '@angular/core';
5
+ import * as nanostores from 'nanostores';
6
+ import * as jose from 'jose';
7
+ import * as better_auth_plugins from 'better-auth/plugins';
8
+ import * as better_auth from 'better-auth';
9
+ import * as _better_fetch_fetch from '@better-fetch/fetch';
10
+ import { createAuthClient } from 'better-auth/client';
11
+
12
+ /**
13
+ * Shared types for Convex Angular core.
14
+ * Pure extraction for readability; no behavior changes.
15
+ */
16
+ /** Auth token fetcher used by ConvexAngularClient.setAuth */
17
+ type FetchAccessToken = (o: {
18
+ forceRefreshToken: boolean;
19
+ }) => Promise<string | null>;
20
+ /** Snapshot of current auth state (token presence-based) */
21
+ type AuthSnapshot = {
22
+ isAuthenticated: boolean;
23
+ token: string | null;
24
+ exp?: number;
25
+ };
26
+
27
+ /**
28
+ * ConvexAngularClient
29
+ * - Wraps Convex BaseConvexClient + ConvexHttpClient
30
+ * - Integrates Better Auth via pluggable fetcher (setAuth)
31
+ * - Caches JWT in sessionStorage with BroadcastChannel sync
32
+ * - Auto-refreshes auth token ahead of expiry with jitter
33
+ * - Provides:
34
+ * - watchQuery: live subscription with localQueryResult + onUpdate
35
+ * - query: HTTP one-shot with in-flight de-dupe + 401 retry
36
+ * - mutation: supports optimisticUpdate passthrough
37
+ * - action: HTTP call with 401 retry
38
+ * - Does not change any runtime behavior – documentation and structure only.
39
+ */
40
+
41
+ type WatchHandle<Q extends FunctionReference<'query'>> = {
42
+ localQueryResult(): FunctionReturnType<Q> | undefined;
43
+ onUpdate(cb: () => void): () => void;
44
+ unsubscribe(): void;
45
+ };
46
+ declare class ConvexAngularClient {
47
+ private authListeners;
48
+ private lastSnap?;
49
+ private emitAuth;
50
+ private base;
51
+ private http;
52
+ private byToken;
53
+ private fetchToken?;
54
+ private inflightToken?;
55
+ private token?;
56
+ private refreshTimer?;
57
+ private inflightHttp;
58
+ private authLocked;
59
+ private readonly skewMs;
60
+ constructor(url: string, opts?: BaseConvexClientOptions & {
61
+ authSkewMs?: number;
62
+ });
63
+ setAuth(fetcher: FetchAccessToken): void;
64
+ /** Optional: call once on app start */
65
+ warmAuth(): Promise<void>;
66
+ private freshTokenInCache;
67
+ onAuth(cb: (s: AuthSnapshot) => void): () => void;
68
+ logoutLocal(lock?: boolean): void;
69
+ getAuthSnapshot(): {
70
+ isAuthenticated: boolean;
71
+ token: string | null;
72
+ exp: number | undefined;
73
+ };
74
+ /** Allow re-auth then fetch a fresh token (use after successful sign-in) */
75
+ refreshAuth(): Promise<void>;
76
+ private applyToken;
77
+ private scheduleRefresh;
78
+ private getToken;
79
+ private ensureHttpAuth;
80
+ watchQuery<Q extends FunctionReference<'query'>>(q: Q, args: FunctionArgs<Q>): WatchHandle<Q>;
81
+ mutation<M extends FunctionReference<'mutation'>>(m: M, args: FunctionArgs<M>, opts?: {
82
+ optimisticUpdate?: OptimisticUpdate<FunctionArgs<M>>;
83
+ }): Promise<FunctionReturnType<M>>;
84
+ action<A extends FunctionReference<'action'> & {
85
+ _args: Record<string, never>;
86
+ }>(a: A): Promise<FunctionReturnType<A>>;
87
+ action<A extends FunctionReference<'action'>>(a: A, args: FunctionArgs<A>): Promise<FunctionReturnType<A>>;
88
+ query<Q extends FunctionReference<'query'> & {
89
+ _args: Record<string, never>;
90
+ }>(q: Q): Promise<FunctionReturnType<Q>>;
91
+ query<Q extends FunctionReference<'query'>>(q: Q, args: FunctionArgs<Q>): Promise<FunctionReturnType<Q>>;
92
+ }
93
+
94
+ /**
95
+ * Injection token and helper for accessing the Convex client from DI.
96
+ * Keep this tiny and stable — many helpers rely on it.
97
+ */
98
+
99
+ /** DI token for the configured ConvexAngularClient instance */
100
+ declare const CONVEX: InjectionToken<ConvexAngularClient>;
101
+ /** Convenience helper to inject the Convex client */
102
+ declare const injectConvex: () => ConvexAngularClient;
103
+
104
+ type AuthClient = ReturnType<typeof createAuthClient<AuthConfig>>;
105
+ interface ProvideAuthClientOptions {
106
+ baseURL: string;
107
+ fetchOptions?: RequestInit;
108
+ }
109
+ /**
110
+ * Un-typed DI token. We don't re-export types; callers who create the client
111
+ * get full type safety from better-auth directly.
112
+ */
113
+ declare const AUTH_CLIENT: InjectionToken<{
114
+ convex: {
115
+ ".wellKnown": {
116
+ openidConfiguration: <FetchOptions extends {
117
+ cache?: RequestCache | undefined;
118
+ credentials?: RequestCredentials | undefined;
119
+ headers?: (HeadersInit & (HeadersInit | {
120
+ accept: "application/json" | "text/plain" | "application/octet-stream";
121
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
122
+ authorization: "Bearer" | "Basic";
123
+ })) | undefined;
124
+ integrity?: string | undefined;
125
+ keepalive?: boolean | undefined;
126
+ method?: string | undefined;
127
+ mode?: RequestMode | undefined;
128
+ priority?: RequestPriority | undefined;
129
+ redirect?: RequestRedirect | undefined;
130
+ referrer?: string | undefined;
131
+ referrerPolicy?: ReferrerPolicy | undefined;
132
+ signal?: (AbortSignal | null) | undefined;
133
+ window?: null | undefined;
134
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
135
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
136
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
137
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
138
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
139
+ hookOptions?: {
140
+ cloneResponse?: boolean;
141
+ } | undefined;
142
+ timeout?: number | undefined;
143
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
144
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
145
+ baseURL?: string | undefined;
146
+ throw?: boolean | undefined;
147
+ auth?: ({
148
+ type: "Bearer";
149
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
150
+ } | {
151
+ type: "Basic";
152
+ username: string | (() => string | undefined) | undefined;
153
+ password: string | (() => string | undefined) | undefined;
154
+ } | {
155
+ type: "Custom";
156
+ prefix: string | (() => string | undefined) | undefined;
157
+ value: string | (() => string | undefined) | undefined;
158
+ }) | undefined;
159
+ body?: undefined;
160
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
161
+ params?: Record<string, any> | undefined;
162
+ duplex?: "full" | "half" | undefined;
163
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
164
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
165
+ retryAttempt?: number | undefined;
166
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
167
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
168
+ disableValidation?: boolean | undefined;
169
+ }>(data_0?: better_auth.Prettify<{
170
+ query?: Record<string, any> | undefined;
171
+ fetchOptions?: FetchOptions | undefined;
172
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth_plugins.OIDCMetadata, {
173
+ code?: string;
174
+ message?: string;
175
+ }, FetchOptions["throw"] extends true ? true : false>>;
176
+ };
177
+ };
178
+ } & {
179
+ convex: {
180
+ jwks: <FetchOptions extends {
181
+ cache?: RequestCache | undefined;
182
+ credentials?: RequestCredentials | undefined;
183
+ headers?: (HeadersInit & (HeadersInit | {
184
+ accept: "application/json" | "text/plain" | "application/octet-stream";
185
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
186
+ authorization: "Bearer" | "Basic";
187
+ })) | undefined;
188
+ integrity?: string | undefined;
189
+ keepalive?: boolean | undefined;
190
+ method?: string | undefined;
191
+ mode?: RequestMode | undefined;
192
+ priority?: RequestPriority | undefined;
193
+ redirect?: RequestRedirect | undefined;
194
+ referrer?: string | undefined;
195
+ referrerPolicy?: ReferrerPolicy | undefined;
196
+ signal?: (AbortSignal | null) | undefined;
197
+ window?: null | undefined;
198
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
199
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
200
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
201
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
202
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
203
+ hookOptions?: {
204
+ cloneResponse?: boolean;
205
+ } | undefined;
206
+ timeout?: number | undefined;
207
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
208
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
209
+ baseURL?: string | undefined;
210
+ throw?: boolean | undefined;
211
+ auth?: ({
212
+ type: "Bearer";
213
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
214
+ } | {
215
+ type: "Basic";
216
+ username: string | (() => string | undefined) | undefined;
217
+ password: string | (() => string | undefined) | undefined;
218
+ } | {
219
+ type: "Custom";
220
+ prefix: string | (() => string | undefined) | undefined;
221
+ value: string | (() => string | undefined) | undefined;
222
+ }) | undefined;
223
+ body?: undefined;
224
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
225
+ params?: Record<string, any> | undefined;
226
+ duplex?: "full" | "half" | undefined;
227
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
228
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
229
+ retryAttempt?: number | undefined;
230
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
231
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
232
+ disableValidation?: boolean | undefined;
233
+ }>(data_0?: better_auth.Prettify<{
234
+ query?: Record<string, any> | undefined;
235
+ fetchOptions?: FetchOptions | undefined;
236
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<jose.JSONWebKeySet, {
237
+ code?: string;
238
+ message?: string;
239
+ }, FetchOptions["throw"] extends true ? true : false>>;
240
+ };
241
+ } & {
242
+ convex: {
243
+ token: <FetchOptions extends {
244
+ cache?: RequestCache | undefined;
245
+ credentials?: RequestCredentials | undefined;
246
+ headers?: (HeadersInit & (HeadersInit | {
247
+ accept: "application/json" | "text/plain" | "application/octet-stream";
248
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
249
+ authorization: "Bearer" | "Basic";
250
+ })) | undefined;
251
+ integrity?: string | undefined;
252
+ keepalive?: boolean | undefined;
253
+ method?: string | undefined;
254
+ mode?: RequestMode | undefined;
255
+ priority?: RequestPriority | undefined;
256
+ redirect?: RequestRedirect | undefined;
257
+ referrer?: string | undefined;
258
+ referrerPolicy?: ReferrerPolicy | undefined;
259
+ signal?: (AbortSignal | null) | undefined;
260
+ window?: null | undefined;
261
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
262
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
263
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
264
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
265
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
266
+ hookOptions?: {
267
+ cloneResponse?: boolean;
268
+ } | undefined;
269
+ timeout?: number | undefined;
270
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
271
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
272
+ baseURL?: string | undefined;
273
+ throw?: boolean | undefined;
274
+ auth?: ({
275
+ type: "Bearer";
276
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
277
+ } | {
278
+ type: "Basic";
279
+ username: string | (() => string | undefined) | undefined;
280
+ password: string | (() => string | undefined) | undefined;
281
+ } | {
282
+ type: "Custom";
283
+ prefix: string | (() => string | undefined) | undefined;
284
+ value: string | (() => string | undefined) | undefined;
285
+ }) | undefined;
286
+ body?: undefined;
287
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
288
+ params?: Record<string, any> | undefined;
289
+ duplex?: "full" | "half" | undefined;
290
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
291
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
292
+ retryAttempt?: number | undefined;
293
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
294
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
295
+ disableValidation?: boolean | undefined;
296
+ }>(data_0?: better_auth.Prettify<{
297
+ query?: Record<string, any> | undefined;
298
+ fetchOptions?: FetchOptions | undefined;
299
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
300
+ token: string;
301
+ }, {
302
+ code?: string;
303
+ message?: string;
304
+ }, FetchOptions["throw"] extends true ? true : false>>;
305
+ };
306
+ } & {
307
+ crossDomain: {
308
+ oneTimeToken: {
309
+ verify: <FetchOptions extends {
310
+ cache?: RequestCache | undefined;
311
+ credentials?: RequestCredentials | undefined;
312
+ headers?: (HeadersInit & (HeadersInit | {
313
+ accept: "application/json" | "text/plain" | "application/octet-stream";
314
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
315
+ authorization: "Bearer" | "Basic";
316
+ })) | undefined;
317
+ integrity?: string | undefined;
318
+ keepalive?: boolean | undefined;
319
+ method?: string | undefined;
320
+ mode?: RequestMode | undefined;
321
+ priority?: RequestPriority | undefined;
322
+ redirect?: RequestRedirect | undefined;
323
+ referrer?: string | undefined;
324
+ referrerPolicy?: ReferrerPolicy | undefined;
325
+ signal?: (AbortSignal | null) | undefined;
326
+ window?: null | undefined;
327
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
328
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
329
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
330
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
331
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
332
+ hookOptions?: {
333
+ cloneResponse?: boolean;
334
+ } | undefined;
335
+ timeout?: number | undefined;
336
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
337
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
338
+ baseURL?: string | undefined;
339
+ throw?: boolean | undefined;
340
+ auth?: ({
341
+ type: "Bearer";
342
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
343
+ } | {
344
+ type: "Basic";
345
+ username: string | (() => string | undefined) | undefined;
346
+ password: string | (() => string | undefined) | undefined;
347
+ } | {
348
+ type: "Custom";
349
+ prefix: string | (() => string | undefined) | undefined;
350
+ value: string | (() => string | undefined) | undefined;
351
+ }) | undefined;
352
+ body?: (Partial<{
353
+ token: string;
354
+ }> & Record<string, any>) | undefined;
355
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
356
+ params?: Record<string, any> | undefined;
357
+ duplex?: "full" | "half" | undefined;
358
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
359
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
360
+ retryAttempt?: number | undefined;
361
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
362
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
363
+ disableValidation?: boolean | undefined;
364
+ }>(data_0: better_auth.Prettify<{
365
+ token: string;
366
+ } & {
367
+ fetchOptions?: FetchOptions | undefined;
368
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
369
+ session: better_auth.Session & Record<string, any>;
370
+ user: better_auth.User & Record<string, any>;
371
+ }, {
372
+ code?: string;
373
+ message?: string;
374
+ }, FetchOptions["throw"] extends true ? true : false>>;
375
+ };
376
+ };
377
+ } & {
378
+ signIn: {
379
+ social: <FetchOptions extends {
380
+ cache?: RequestCache | undefined;
381
+ credentials?: RequestCredentials | undefined;
382
+ headers?: (HeadersInit & (HeadersInit | {
383
+ accept: "application/json" | "text/plain" | "application/octet-stream";
384
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
385
+ authorization: "Bearer" | "Basic";
386
+ })) | undefined;
387
+ integrity?: string | undefined;
388
+ keepalive?: boolean | undefined;
389
+ method?: string | undefined;
390
+ mode?: RequestMode | undefined;
391
+ priority?: RequestPriority | undefined;
392
+ redirect?: RequestRedirect | undefined;
393
+ referrer?: string | undefined;
394
+ referrerPolicy?: ReferrerPolicy | undefined;
395
+ signal?: (AbortSignal | null) | undefined;
396
+ window?: null | undefined;
397
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
398
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
399
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
400
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
401
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
402
+ hookOptions?: {
403
+ cloneResponse?: boolean;
404
+ } | undefined;
405
+ timeout?: number | undefined;
406
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
407
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
408
+ baseURL?: string | undefined;
409
+ throw?: boolean | undefined;
410
+ auth?: ({
411
+ type: "Bearer";
412
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
413
+ } | {
414
+ type: "Basic";
415
+ username: string | (() => string | undefined) | undefined;
416
+ password: string | (() => string | undefined) | undefined;
417
+ } | {
418
+ type: "Custom";
419
+ prefix: string | (() => string | undefined) | undefined;
420
+ value: string | (() => string | undefined) | undefined;
421
+ }) | undefined;
422
+ body?: (Partial<{
423
+ provider: unknown;
424
+ callbackURL?: string | undefined;
425
+ newUserCallbackURL?: string | undefined;
426
+ errorCallbackURL?: string | undefined;
427
+ disableRedirect?: boolean | undefined;
428
+ idToken?: {
429
+ token: string;
430
+ nonce?: string | undefined;
431
+ accessToken?: string | undefined;
432
+ refreshToken?: string | undefined;
433
+ expiresAt?: number | undefined;
434
+ } | undefined;
435
+ scopes?: string[] | undefined;
436
+ requestSignUp?: boolean | undefined;
437
+ loginHint?: string | undefined;
438
+ }> & Record<string, any>) | undefined;
439
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
440
+ params?: Record<string, any> | undefined;
441
+ duplex?: "full" | "half" | undefined;
442
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
443
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
444
+ retryAttempt?: number | undefined;
445
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
446
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
447
+ disableValidation?: boolean | undefined;
448
+ }>(data_0: better_auth.Prettify<{
449
+ provider: unknown;
450
+ callbackURL?: string | undefined;
451
+ newUserCallbackURL?: string | undefined;
452
+ errorCallbackURL?: string | undefined;
453
+ disableRedirect?: boolean | undefined;
454
+ idToken?: {
455
+ token: string;
456
+ nonce?: string | undefined;
457
+ accessToken?: string | undefined;
458
+ refreshToken?: string | undefined;
459
+ expiresAt?: number | undefined;
460
+ } | undefined;
461
+ scopes?: string[] | undefined;
462
+ requestSignUp?: boolean | undefined;
463
+ loginHint?: string | undefined;
464
+ } & {
465
+ fetchOptions?: FetchOptions | undefined;
466
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
467
+ redirect: boolean;
468
+ token: string;
469
+ url: undefined;
470
+ user: {
471
+ id: string;
472
+ email: string;
473
+ name: string;
474
+ image: string | null | undefined;
475
+ emailVerified: boolean;
476
+ createdAt: Date;
477
+ updatedAt: Date;
478
+ };
479
+ } | {
480
+ url: string;
481
+ redirect: boolean;
482
+ }>, {
483
+ code?: string;
484
+ message?: string;
485
+ }, FetchOptions["throw"] extends true ? true : false>>;
486
+ };
487
+ } & {
488
+ signOut: <FetchOptions extends {
489
+ cache?: RequestCache | undefined;
490
+ credentials?: RequestCredentials | undefined;
491
+ headers?: (HeadersInit & (HeadersInit | {
492
+ accept: "application/json" | "text/plain" | "application/octet-stream";
493
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
494
+ authorization: "Bearer" | "Basic";
495
+ })) | undefined;
496
+ integrity?: string | undefined;
497
+ keepalive?: boolean | undefined;
498
+ method?: string | undefined;
499
+ mode?: RequestMode | undefined;
500
+ priority?: RequestPriority | undefined;
501
+ redirect?: RequestRedirect | undefined;
502
+ referrer?: string | undefined;
503
+ referrerPolicy?: ReferrerPolicy | undefined;
504
+ signal?: (AbortSignal | null) | undefined;
505
+ window?: null | undefined;
506
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
507
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
508
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
509
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
510
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
511
+ hookOptions?: {
512
+ cloneResponse?: boolean;
513
+ } | undefined;
514
+ timeout?: number | undefined;
515
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
516
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
517
+ baseURL?: string | undefined;
518
+ throw?: boolean | undefined;
519
+ auth?: ({
520
+ type: "Bearer";
521
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
522
+ } | {
523
+ type: "Basic";
524
+ username: string | (() => string | undefined) | undefined;
525
+ password: string | (() => string | undefined) | undefined;
526
+ } | {
527
+ type: "Custom";
528
+ prefix: string | (() => string | undefined) | undefined;
529
+ value: string | (() => string | undefined) | undefined;
530
+ }) | undefined;
531
+ body?: undefined;
532
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
533
+ params?: Record<string, any> | undefined;
534
+ duplex?: "full" | "half" | undefined;
535
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
536
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
537
+ retryAttempt?: number | undefined;
538
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
539
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
540
+ disableValidation?: boolean | undefined;
541
+ }>(data_0?: better_auth.Prettify<{
542
+ query?: Record<string, any> | undefined;
543
+ fetchOptions?: FetchOptions | undefined;
544
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
545
+ success: boolean;
546
+ }, {
547
+ code?: string;
548
+ message?: string;
549
+ }, FetchOptions["throw"] extends true ? true : false>>;
550
+ } & {
551
+ signIn: {
552
+ email: <FetchOptions extends {
553
+ cache?: RequestCache | undefined;
554
+ credentials?: RequestCredentials | undefined;
555
+ headers?: (HeadersInit & (HeadersInit | {
556
+ accept: "application/json" | "text/plain" | "application/octet-stream";
557
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
558
+ authorization: "Bearer" | "Basic";
559
+ })) | undefined;
560
+ integrity?: string | undefined;
561
+ keepalive?: boolean | undefined;
562
+ method?: string | undefined;
563
+ mode?: RequestMode | undefined;
564
+ priority?: RequestPriority | undefined;
565
+ redirect?: RequestRedirect | undefined;
566
+ referrer?: string | undefined;
567
+ referrerPolicy?: ReferrerPolicy | undefined;
568
+ signal?: (AbortSignal | null) | undefined;
569
+ window?: null | undefined;
570
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
571
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
572
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
573
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
574
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
575
+ hookOptions?: {
576
+ cloneResponse?: boolean;
577
+ } | undefined;
578
+ timeout?: number | undefined;
579
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
580
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
581
+ baseURL?: string | undefined;
582
+ throw?: boolean | undefined;
583
+ auth?: ({
584
+ type: "Bearer";
585
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
586
+ } | {
587
+ type: "Basic";
588
+ username: string | (() => string | undefined) | undefined;
589
+ password: string | (() => string | undefined) | undefined;
590
+ } | {
591
+ type: "Custom";
592
+ prefix: string | (() => string | undefined) | undefined;
593
+ value: string | (() => string | undefined) | undefined;
594
+ }) | undefined;
595
+ body?: (Partial<{
596
+ email: string;
597
+ password: string;
598
+ callbackURL?: string | undefined;
599
+ rememberMe?: boolean | undefined;
600
+ }> & Record<string, any>) | undefined;
601
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
602
+ params?: Record<string, any> | undefined;
603
+ duplex?: "full" | "half" | undefined;
604
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
605
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
606
+ retryAttempt?: number | undefined;
607
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
608
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
609
+ disableValidation?: boolean | undefined;
610
+ }>(data_0: better_auth.Prettify<{
611
+ email: string;
612
+ password: string;
613
+ callbackURL?: string | undefined;
614
+ rememberMe?: boolean | undefined;
615
+ } & {
616
+ fetchOptions?: FetchOptions | undefined;
617
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
618
+ redirect: boolean;
619
+ token: string;
620
+ url: string | undefined;
621
+ user: {
622
+ id: string;
623
+ email: string;
624
+ name: string;
625
+ image: string | null | undefined;
626
+ emailVerified: boolean;
627
+ createdAt: Date;
628
+ updatedAt: Date;
629
+ };
630
+ }, {
631
+ code?: string;
632
+ message?: string;
633
+ }, FetchOptions["throw"] extends true ? true : false>>;
634
+ };
635
+ } & {
636
+ forgetPassword: <FetchOptions extends {
637
+ cache?: RequestCache | undefined;
638
+ credentials?: RequestCredentials | undefined;
639
+ headers?: (HeadersInit & (HeadersInit | {
640
+ accept: "application/json" | "text/plain" | "application/octet-stream";
641
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
642
+ authorization: "Bearer" | "Basic";
643
+ })) | undefined;
644
+ integrity?: string | undefined;
645
+ keepalive?: boolean | undefined;
646
+ method?: string | undefined;
647
+ mode?: RequestMode | undefined;
648
+ priority?: RequestPriority | undefined;
649
+ redirect?: RequestRedirect | undefined;
650
+ referrer?: string | undefined;
651
+ referrerPolicy?: ReferrerPolicy | undefined;
652
+ signal?: (AbortSignal | null) | undefined;
653
+ window?: null | undefined;
654
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
655
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
656
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
657
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
658
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
659
+ hookOptions?: {
660
+ cloneResponse?: boolean;
661
+ } | undefined;
662
+ timeout?: number | undefined;
663
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
664
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
665
+ baseURL?: string | undefined;
666
+ throw?: boolean | undefined;
667
+ auth?: ({
668
+ type: "Bearer";
669
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
670
+ } | {
671
+ type: "Basic";
672
+ username: string | (() => string | undefined) | undefined;
673
+ password: string | (() => string | undefined) | undefined;
674
+ } | {
675
+ type: "Custom";
676
+ prefix: string | (() => string | undefined) | undefined;
677
+ value: string | (() => string | undefined) | undefined;
678
+ }) | undefined;
679
+ body?: (Partial<{
680
+ email: string;
681
+ redirectTo?: string | undefined;
682
+ }> & Record<string, any>) | undefined;
683
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
684
+ params?: Record<string, any> | undefined;
685
+ duplex?: "full" | "half" | undefined;
686
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
687
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
688
+ retryAttempt?: number | undefined;
689
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
690
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
691
+ disableValidation?: boolean | undefined;
692
+ }>(data_0: better_auth.Prettify<{
693
+ email: string;
694
+ redirectTo?: string | undefined;
695
+ } & {
696
+ fetchOptions?: FetchOptions | undefined;
697
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
698
+ status: boolean;
699
+ }, {
700
+ code?: string;
701
+ message?: string;
702
+ }, FetchOptions["throw"] extends true ? true : false>>;
703
+ } & {
704
+ resetPassword: <FetchOptions extends {
705
+ cache?: RequestCache | undefined;
706
+ credentials?: RequestCredentials | undefined;
707
+ headers?: (HeadersInit & (HeadersInit | {
708
+ accept: "application/json" | "text/plain" | "application/octet-stream";
709
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
710
+ authorization: "Bearer" | "Basic";
711
+ })) | undefined;
712
+ integrity?: string | undefined;
713
+ keepalive?: boolean | undefined;
714
+ method?: string | undefined;
715
+ mode?: RequestMode | undefined;
716
+ priority?: RequestPriority | undefined;
717
+ redirect?: RequestRedirect | undefined;
718
+ referrer?: string | undefined;
719
+ referrerPolicy?: ReferrerPolicy | undefined;
720
+ signal?: (AbortSignal | null) | undefined;
721
+ window?: null | undefined;
722
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
723
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
724
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
725
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
726
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
727
+ hookOptions?: {
728
+ cloneResponse?: boolean;
729
+ } | undefined;
730
+ timeout?: number | undefined;
731
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
732
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
733
+ baseURL?: string | undefined;
734
+ throw?: boolean | undefined;
735
+ auth?: ({
736
+ type: "Bearer";
737
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
738
+ } | {
739
+ type: "Basic";
740
+ username: string | (() => string | undefined) | undefined;
741
+ password: string | (() => string | undefined) | undefined;
742
+ } | {
743
+ type: "Custom";
744
+ prefix: string | (() => string | undefined) | undefined;
745
+ value: string | (() => string | undefined) | undefined;
746
+ }) | undefined;
747
+ body?: (Partial<{
748
+ newPassword: string;
749
+ token?: string | undefined;
750
+ }> & Record<string, any>) | undefined;
751
+ query?: (Partial<{
752
+ token?: string | undefined;
753
+ }> & Record<string, any>) | undefined;
754
+ params?: Record<string, any> | undefined;
755
+ duplex?: "full" | "half" | undefined;
756
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
757
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
758
+ retryAttempt?: number | undefined;
759
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
760
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
761
+ disableValidation?: boolean | undefined;
762
+ }>(data_0: better_auth.Prettify<{
763
+ newPassword: string;
764
+ token?: string | undefined;
765
+ } & {
766
+ fetchOptions?: FetchOptions | undefined;
767
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
768
+ status: boolean;
769
+ }, {
770
+ code?: string;
771
+ message?: string;
772
+ }, FetchOptions["throw"] extends true ? true : false>>;
773
+ } & {
774
+ verifyEmail: <FetchOptions extends {
775
+ cache?: RequestCache | undefined;
776
+ credentials?: RequestCredentials | undefined;
777
+ headers?: (HeadersInit & (HeadersInit | {
778
+ accept: "application/json" | "text/plain" | "application/octet-stream";
779
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
780
+ authorization: "Bearer" | "Basic";
781
+ })) | undefined;
782
+ integrity?: string | undefined;
783
+ keepalive?: boolean | undefined;
784
+ method?: string | undefined;
785
+ mode?: RequestMode | undefined;
786
+ priority?: RequestPriority | undefined;
787
+ redirect?: RequestRedirect | undefined;
788
+ referrer?: string | undefined;
789
+ referrerPolicy?: ReferrerPolicy | undefined;
790
+ signal?: (AbortSignal | null) | undefined;
791
+ window?: null | undefined;
792
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
793
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
794
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
795
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
796
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
797
+ hookOptions?: {
798
+ cloneResponse?: boolean;
799
+ } | undefined;
800
+ timeout?: number | undefined;
801
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
802
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
803
+ baseURL?: string | undefined;
804
+ throw?: boolean | undefined;
805
+ auth?: ({
806
+ type: "Bearer";
807
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
808
+ } | {
809
+ type: "Basic";
810
+ username: string | (() => string | undefined) | undefined;
811
+ password: string | (() => string | undefined) | undefined;
812
+ } | {
813
+ type: "Custom";
814
+ prefix: string | (() => string | undefined) | undefined;
815
+ value: string | (() => string | undefined) | undefined;
816
+ }) | undefined;
817
+ body?: undefined;
818
+ query?: (Partial<{
819
+ token: string;
820
+ callbackURL?: string | undefined;
821
+ }> & Record<string, any>) | undefined;
822
+ params?: Record<string, any> | undefined;
823
+ duplex?: "full" | "half" | undefined;
824
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
825
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
826
+ retryAttempt?: number | undefined;
827
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
828
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
829
+ disableValidation?: boolean | undefined;
830
+ }>(data_0: better_auth.Prettify<{
831
+ query: {
832
+ token: string;
833
+ callbackURL?: string | undefined;
834
+ };
835
+ fetchOptions?: FetchOptions | undefined;
836
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<void | {
837
+ status: boolean;
838
+ user: {
839
+ id: any;
840
+ email: any;
841
+ name: any;
842
+ image: any;
843
+ emailVerified: any;
844
+ createdAt: any;
845
+ updatedAt: any;
846
+ };
847
+ } | {
848
+ status: boolean;
849
+ user: null;
850
+ }>, {
851
+ code?: string;
852
+ message?: string;
853
+ }, FetchOptions["throw"] extends true ? true : false>>;
854
+ } & {
855
+ sendVerificationEmail: <FetchOptions extends {
856
+ cache?: RequestCache | undefined;
857
+ credentials?: RequestCredentials | undefined;
858
+ headers?: (HeadersInit & (HeadersInit | {
859
+ accept: "application/json" | "text/plain" | "application/octet-stream";
860
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
861
+ authorization: "Bearer" | "Basic";
862
+ })) | undefined;
863
+ integrity?: string | undefined;
864
+ keepalive?: boolean | undefined;
865
+ method?: string | undefined;
866
+ mode?: RequestMode | undefined;
867
+ priority?: RequestPriority | undefined;
868
+ redirect?: RequestRedirect | undefined;
869
+ referrer?: string | undefined;
870
+ referrerPolicy?: ReferrerPolicy | undefined;
871
+ signal?: (AbortSignal | null) | undefined;
872
+ window?: null | undefined;
873
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
874
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
875
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
876
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
877
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
878
+ hookOptions?: {
879
+ cloneResponse?: boolean;
880
+ } | undefined;
881
+ timeout?: number | undefined;
882
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
883
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
884
+ baseURL?: string | undefined;
885
+ throw?: boolean | undefined;
886
+ auth?: ({
887
+ type: "Bearer";
888
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
889
+ } | {
890
+ type: "Basic";
891
+ username: string | (() => string | undefined) | undefined;
892
+ password: string | (() => string | undefined) | undefined;
893
+ } | {
894
+ type: "Custom";
895
+ prefix: string | (() => string | undefined) | undefined;
896
+ value: string | (() => string | undefined) | undefined;
897
+ }) | undefined;
898
+ body?: (Partial<{
899
+ email: string;
900
+ callbackURL?: string | undefined;
901
+ }> & Record<string, any>) | undefined;
902
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
903
+ params?: Record<string, any> | undefined;
904
+ duplex?: "full" | "half" | undefined;
905
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
906
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
907
+ retryAttempt?: number | undefined;
908
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
909
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
910
+ disableValidation?: boolean | undefined;
911
+ }>(data_0: better_auth.Prettify<{
912
+ email: string;
913
+ callbackURL?: string | undefined;
914
+ } & {
915
+ fetchOptions?: FetchOptions | undefined;
916
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
917
+ status: boolean;
918
+ }, {
919
+ code?: string;
920
+ message?: string;
921
+ }, FetchOptions["throw"] extends true ? true : false>>;
922
+ } & {
923
+ changeEmail: <FetchOptions extends {
924
+ cache?: RequestCache | undefined;
925
+ credentials?: RequestCredentials | undefined;
926
+ headers?: (HeadersInit & (HeadersInit | {
927
+ accept: "application/json" | "text/plain" | "application/octet-stream";
928
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
929
+ authorization: "Bearer" | "Basic";
930
+ })) | undefined;
931
+ integrity?: string | undefined;
932
+ keepalive?: boolean | undefined;
933
+ method?: string | undefined;
934
+ mode?: RequestMode | undefined;
935
+ priority?: RequestPriority | undefined;
936
+ redirect?: RequestRedirect | undefined;
937
+ referrer?: string | undefined;
938
+ referrerPolicy?: ReferrerPolicy | undefined;
939
+ signal?: (AbortSignal | null) | undefined;
940
+ window?: null | undefined;
941
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
942
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
943
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
944
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
945
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
946
+ hookOptions?: {
947
+ cloneResponse?: boolean;
948
+ } | undefined;
949
+ timeout?: number | undefined;
950
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
951
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
952
+ baseURL?: string | undefined;
953
+ throw?: boolean | undefined;
954
+ auth?: ({
955
+ type: "Bearer";
956
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
957
+ } | {
958
+ type: "Basic";
959
+ username: string | (() => string | undefined) | undefined;
960
+ password: string | (() => string | undefined) | undefined;
961
+ } | {
962
+ type: "Custom";
963
+ prefix: string | (() => string | undefined) | undefined;
964
+ value: string | (() => string | undefined) | undefined;
965
+ }) | undefined;
966
+ body?: (Partial<{
967
+ newEmail: string;
968
+ callbackURL?: string | undefined;
969
+ }> & Record<string, any>) | undefined;
970
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
971
+ params?: Record<string, any> | undefined;
972
+ duplex?: "full" | "half" | undefined;
973
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
974
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
975
+ retryAttempt?: number | undefined;
976
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
977
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
978
+ disableValidation?: boolean | undefined;
979
+ }>(data_0: better_auth.Prettify<{
980
+ newEmail: string;
981
+ callbackURL?: string | undefined;
982
+ } & {
983
+ fetchOptions?: FetchOptions | undefined;
984
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
985
+ status: boolean;
986
+ }, {
987
+ code?: string;
988
+ message?: string;
989
+ }, FetchOptions["throw"] extends true ? true : false>>;
990
+ } & {
991
+ changePassword: <FetchOptions extends {
992
+ cache?: RequestCache | undefined;
993
+ credentials?: RequestCredentials | undefined;
994
+ headers?: (HeadersInit & (HeadersInit | {
995
+ accept: "application/json" | "text/plain" | "application/octet-stream";
996
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
997
+ authorization: "Bearer" | "Basic";
998
+ })) | undefined;
999
+ integrity?: string | undefined;
1000
+ keepalive?: boolean | undefined;
1001
+ method?: string | undefined;
1002
+ mode?: RequestMode | undefined;
1003
+ priority?: RequestPriority | undefined;
1004
+ redirect?: RequestRedirect | undefined;
1005
+ referrer?: string | undefined;
1006
+ referrerPolicy?: ReferrerPolicy | undefined;
1007
+ signal?: (AbortSignal | null) | undefined;
1008
+ window?: null | undefined;
1009
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1010
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1011
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1012
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1013
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1014
+ hookOptions?: {
1015
+ cloneResponse?: boolean;
1016
+ } | undefined;
1017
+ timeout?: number | undefined;
1018
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1019
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1020
+ baseURL?: string | undefined;
1021
+ throw?: boolean | undefined;
1022
+ auth?: ({
1023
+ type: "Bearer";
1024
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1025
+ } | {
1026
+ type: "Basic";
1027
+ username: string | (() => string | undefined) | undefined;
1028
+ password: string | (() => string | undefined) | undefined;
1029
+ } | {
1030
+ type: "Custom";
1031
+ prefix: string | (() => string | undefined) | undefined;
1032
+ value: string | (() => string | undefined) | undefined;
1033
+ }) | undefined;
1034
+ body?: (Partial<{
1035
+ newPassword: string;
1036
+ currentPassword: string;
1037
+ revokeOtherSessions?: boolean | undefined;
1038
+ }> & Record<string, any>) | undefined;
1039
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1040
+ params?: Record<string, any> | undefined;
1041
+ duplex?: "full" | "half" | undefined;
1042
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1043
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1044
+ retryAttempt?: number | undefined;
1045
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1046
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1047
+ disableValidation?: boolean | undefined;
1048
+ }>(data_0: better_auth.Prettify<{
1049
+ newPassword: string;
1050
+ currentPassword: string;
1051
+ revokeOtherSessions?: boolean | undefined;
1052
+ } & {
1053
+ fetchOptions?: FetchOptions | undefined;
1054
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1055
+ token: string | null;
1056
+ user: {
1057
+ id: string;
1058
+ email: string;
1059
+ name: string;
1060
+ image: string | null | undefined;
1061
+ emailVerified: boolean;
1062
+ createdAt: Date;
1063
+ updatedAt: Date;
1064
+ };
1065
+ }, {
1066
+ code?: string;
1067
+ message?: string;
1068
+ }, FetchOptions["throw"] extends true ? true : false>>;
1069
+ } & {
1070
+ deleteUser: <FetchOptions extends {
1071
+ cache?: RequestCache | undefined;
1072
+ credentials?: RequestCredentials | undefined;
1073
+ headers?: (HeadersInit & (HeadersInit | {
1074
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1075
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1076
+ authorization: "Bearer" | "Basic";
1077
+ })) | undefined;
1078
+ integrity?: string | undefined;
1079
+ keepalive?: boolean | undefined;
1080
+ method?: string | undefined;
1081
+ mode?: RequestMode | undefined;
1082
+ priority?: RequestPriority | undefined;
1083
+ redirect?: RequestRedirect | undefined;
1084
+ referrer?: string | undefined;
1085
+ referrerPolicy?: ReferrerPolicy | undefined;
1086
+ signal?: (AbortSignal | null) | undefined;
1087
+ window?: null | undefined;
1088
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1089
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1090
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1091
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1092
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1093
+ hookOptions?: {
1094
+ cloneResponse?: boolean;
1095
+ } | undefined;
1096
+ timeout?: number | undefined;
1097
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1098
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1099
+ baseURL?: string | undefined;
1100
+ throw?: boolean | undefined;
1101
+ auth?: ({
1102
+ type: "Bearer";
1103
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1104
+ } | {
1105
+ type: "Basic";
1106
+ username: string | (() => string | undefined) | undefined;
1107
+ password: string | (() => string | undefined) | undefined;
1108
+ } | {
1109
+ type: "Custom";
1110
+ prefix: string | (() => string | undefined) | undefined;
1111
+ value: string | (() => string | undefined) | undefined;
1112
+ }) | undefined;
1113
+ body?: (Partial<{
1114
+ callbackURL?: string | undefined;
1115
+ password?: string | undefined;
1116
+ token?: string | undefined;
1117
+ }> & Record<string, any>) | undefined;
1118
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1119
+ params?: Record<string, any> | undefined;
1120
+ duplex?: "full" | "half" | undefined;
1121
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1122
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1123
+ retryAttempt?: number | undefined;
1124
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1125
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1126
+ disableValidation?: boolean | undefined;
1127
+ }>(data_0?: better_auth.Prettify<{
1128
+ callbackURL?: string | undefined;
1129
+ password?: string | undefined;
1130
+ token?: string | undefined;
1131
+ } & {
1132
+ fetchOptions?: FetchOptions | undefined;
1133
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1134
+ success: boolean;
1135
+ message: string;
1136
+ }, {
1137
+ code?: string;
1138
+ message?: string;
1139
+ }, FetchOptions["throw"] extends true ? true : false>>;
1140
+ } & {
1141
+ resetPassword: {
1142
+ ":token": <FetchOptions extends {
1143
+ cache?: RequestCache | undefined;
1144
+ credentials?: RequestCredentials | undefined;
1145
+ headers?: (HeadersInit & (HeadersInit | {
1146
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1147
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1148
+ authorization: "Bearer" | "Basic";
1149
+ })) | undefined;
1150
+ integrity?: string | undefined;
1151
+ keepalive?: boolean | undefined;
1152
+ method?: string | undefined;
1153
+ mode?: RequestMode | undefined;
1154
+ priority?: RequestPriority | undefined;
1155
+ redirect?: RequestRedirect | undefined;
1156
+ referrer?: string | undefined;
1157
+ referrerPolicy?: ReferrerPolicy | undefined;
1158
+ signal?: (AbortSignal | null) | undefined;
1159
+ window?: null | undefined;
1160
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1161
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1162
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1163
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1164
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1165
+ hookOptions?: {
1166
+ cloneResponse?: boolean;
1167
+ } | undefined;
1168
+ timeout?: number | undefined;
1169
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1170
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1171
+ baseURL?: string | undefined;
1172
+ throw?: boolean | undefined;
1173
+ auth?: ({
1174
+ type: "Bearer";
1175
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1176
+ } | {
1177
+ type: "Basic";
1178
+ username: string | (() => string | undefined) | undefined;
1179
+ password: string | (() => string | undefined) | undefined;
1180
+ } | {
1181
+ type: "Custom";
1182
+ prefix: string | (() => string | undefined) | undefined;
1183
+ value: string | (() => string | undefined) | undefined;
1184
+ }) | undefined;
1185
+ body?: undefined;
1186
+ query?: (Partial<{
1187
+ callbackURL: string;
1188
+ }> & Record<string, any>) | undefined;
1189
+ params?: {
1190
+ token: string;
1191
+ } | undefined;
1192
+ duplex?: "full" | "half" | undefined;
1193
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1194
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1195
+ retryAttempt?: number | undefined;
1196
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1197
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1198
+ disableValidation?: boolean | undefined;
1199
+ }>(data_0: better_auth.Prettify<{
1200
+ query: {
1201
+ callbackURL: string;
1202
+ };
1203
+ fetchOptions?: FetchOptions | undefined;
1204
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
1205
+ code?: string;
1206
+ message?: string;
1207
+ }, FetchOptions["throw"] extends true ? true : false>>;
1208
+ };
1209
+ } & {
1210
+ requestPasswordReset: <FetchOptions extends {
1211
+ cache?: RequestCache | undefined;
1212
+ credentials?: RequestCredentials | undefined;
1213
+ headers?: (HeadersInit & (HeadersInit | {
1214
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1215
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1216
+ authorization: "Bearer" | "Basic";
1217
+ })) | undefined;
1218
+ integrity?: string | undefined;
1219
+ keepalive?: boolean | undefined;
1220
+ method?: string | undefined;
1221
+ mode?: RequestMode | undefined;
1222
+ priority?: RequestPriority | undefined;
1223
+ redirect?: RequestRedirect | undefined;
1224
+ referrer?: string | undefined;
1225
+ referrerPolicy?: ReferrerPolicy | undefined;
1226
+ signal?: (AbortSignal | null) | undefined;
1227
+ window?: null | undefined;
1228
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1229
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1230
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1231
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1232
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1233
+ hookOptions?: {
1234
+ cloneResponse?: boolean;
1235
+ } | undefined;
1236
+ timeout?: number | undefined;
1237
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1238
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1239
+ baseURL?: string | undefined;
1240
+ throw?: boolean | undefined;
1241
+ auth?: ({
1242
+ type: "Bearer";
1243
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1244
+ } | {
1245
+ type: "Basic";
1246
+ username: string | (() => string | undefined) | undefined;
1247
+ password: string | (() => string | undefined) | undefined;
1248
+ } | {
1249
+ type: "Custom";
1250
+ prefix: string | (() => string | undefined) | undefined;
1251
+ value: string | (() => string | undefined) | undefined;
1252
+ }) | undefined;
1253
+ body?: (Partial<{
1254
+ email: string;
1255
+ redirectTo?: string | undefined;
1256
+ }> & Record<string, any>) | undefined;
1257
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1258
+ params?: Record<string, any> | undefined;
1259
+ duplex?: "full" | "half" | undefined;
1260
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1261
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1262
+ retryAttempt?: number | undefined;
1263
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1264
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1265
+ disableValidation?: boolean | undefined;
1266
+ }>(data_0: better_auth.Prettify<{
1267
+ email: string;
1268
+ redirectTo?: string | undefined;
1269
+ } & {
1270
+ fetchOptions?: FetchOptions | undefined;
1271
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1272
+ status: boolean;
1273
+ }, {
1274
+ code?: string;
1275
+ message?: string;
1276
+ }, FetchOptions["throw"] extends true ? true : false>>;
1277
+ } & {
1278
+ resetPassword: {
1279
+ ":token": <FetchOptions extends {
1280
+ cache?: RequestCache | undefined;
1281
+ credentials?: RequestCredentials | undefined;
1282
+ headers?: (HeadersInit & (HeadersInit | {
1283
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1284
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1285
+ authorization: "Bearer" | "Basic";
1286
+ })) | undefined;
1287
+ integrity?: string | undefined;
1288
+ keepalive?: boolean | undefined;
1289
+ method?: string | undefined;
1290
+ mode?: RequestMode | undefined;
1291
+ priority?: RequestPriority | undefined;
1292
+ redirect?: RequestRedirect | undefined;
1293
+ referrer?: string | undefined;
1294
+ referrerPolicy?: ReferrerPolicy | undefined;
1295
+ signal?: (AbortSignal | null) | undefined;
1296
+ window?: null | undefined;
1297
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1298
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1299
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1300
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1301
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1302
+ hookOptions?: {
1303
+ cloneResponse?: boolean;
1304
+ } | undefined;
1305
+ timeout?: number | undefined;
1306
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1307
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1308
+ baseURL?: string | undefined;
1309
+ throw?: boolean | undefined;
1310
+ auth?: ({
1311
+ type: "Bearer";
1312
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1313
+ } | {
1314
+ type: "Basic";
1315
+ username: string | (() => string | undefined) | undefined;
1316
+ password: string | (() => string | undefined) | undefined;
1317
+ } | {
1318
+ type: "Custom";
1319
+ prefix: string | (() => string | undefined) | undefined;
1320
+ value: string | (() => string | undefined) | undefined;
1321
+ }) | undefined;
1322
+ body?: undefined;
1323
+ query?: (Partial<{
1324
+ callbackURL: string;
1325
+ }> & Record<string, any>) | undefined;
1326
+ params?: {
1327
+ token: string;
1328
+ } | undefined;
1329
+ duplex?: "full" | "half" | undefined;
1330
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1331
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1332
+ retryAttempt?: number | undefined;
1333
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1334
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1335
+ disableValidation?: boolean | undefined;
1336
+ }>(data_0: better_auth.Prettify<{
1337
+ query: {
1338
+ callbackURL: string;
1339
+ };
1340
+ fetchOptions?: FetchOptions | undefined;
1341
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
1342
+ code?: string;
1343
+ message?: string;
1344
+ }, FetchOptions["throw"] extends true ? true : false>>;
1345
+ };
1346
+ } & {
1347
+ revokeSession: <FetchOptions extends {
1348
+ cache?: RequestCache | undefined;
1349
+ credentials?: RequestCredentials | undefined;
1350
+ headers?: (HeadersInit & (HeadersInit | {
1351
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1352
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1353
+ authorization: "Bearer" | "Basic";
1354
+ })) | undefined;
1355
+ integrity?: string | undefined;
1356
+ keepalive?: boolean | undefined;
1357
+ method?: string | undefined;
1358
+ mode?: RequestMode | undefined;
1359
+ priority?: RequestPriority | undefined;
1360
+ redirect?: RequestRedirect | undefined;
1361
+ referrer?: string | undefined;
1362
+ referrerPolicy?: ReferrerPolicy | undefined;
1363
+ signal?: (AbortSignal | null) | undefined;
1364
+ window?: null | undefined;
1365
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1366
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1367
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1368
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1369
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1370
+ hookOptions?: {
1371
+ cloneResponse?: boolean;
1372
+ } | undefined;
1373
+ timeout?: number | undefined;
1374
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1375
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1376
+ baseURL?: string | undefined;
1377
+ throw?: boolean | undefined;
1378
+ auth?: ({
1379
+ type: "Bearer";
1380
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1381
+ } | {
1382
+ type: "Basic";
1383
+ username: string | (() => string | undefined) | undefined;
1384
+ password: string | (() => string | undefined) | undefined;
1385
+ } | {
1386
+ type: "Custom";
1387
+ prefix: string | (() => string | undefined) | undefined;
1388
+ value: string | (() => string | undefined) | undefined;
1389
+ }) | undefined;
1390
+ body?: (Partial<{
1391
+ token: string;
1392
+ }> & Record<string, any>) | undefined;
1393
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1394
+ params?: Record<string, any> | undefined;
1395
+ duplex?: "full" | "half" | undefined;
1396
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1397
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1398
+ retryAttempt?: number | undefined;
1399
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1400
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1401
+ disableValidation?: boolean | undefined;
1402
+ }>(data_0: better_auth.Prettify<{
1403
+ token: string;
1404
+ } & {
1405
+ fetchOptions?: FetchOptions | undefined;
1406
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1407
+ status: boolean;
1408
+ }, {
1409
+ code?: string;
1410
+ message?: string;
1411
+ }, FetchOptions["throw"] extends true ? true : false>>;
1412
+ } & {
1413
+ revokeSessions: <FetchOptions extends {
1414
+ cache?: RequestCache | undefined;
1415
+ credentials?: RequestCredentials | undefined;
1416
+ headers?: (HeadersInit & (HeadersInit | {
1417
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1418
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1419
+ authorization: "Bearer" | "Basic";
1420
+ })) | undefined;
1421
+ integrity?: string | undefined;
1422
+ keepalive?: boolean | undefined;
1423
+ method?: string | undefined;
1424
+ mode?: RequestMode | undefined;
1425
+ priority?: RequestPriority | undefined;
1426
+ redirect?: RequestRedirect | undefined;
1427
+ referrer?: string | undefined;
1428
+ referrerPolicy?: ReferrerPolicy | undefined;
1429
+ signal?: (AbortSignal | null) | undefined;
1430
+ window?: null | undefined;
1431
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1432
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1433
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1434
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1435
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1436
+ hookOptions?: {
1437
+ cloneResponse?: boolean;
1438
+ } | undefined;
1439
+ timeout?: number | undefined;
1440
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1441
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1442
+ baseURL?: string | undefined;
1443
+ throw?: boolean | undefined;
1444
+ auth?: ({
1445
+ type: "Bearer";
1446
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1447
+ } | {
1448
+ type: "Basic";
1449
+ username: string | (() => string | undefined) | undefined;
1450
+ password: string | (() => string | undefined) | undefined;
1451
+ } | {
1452
+ type: "Custom";
1453
+ prefix: string | (() => string | undefined) | undefined;
1454
+ value: string | (() => string | undefined) | undefined;
1455
+ }) | undefined;
1456
+ body?: undefined;
1457
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1458
+ params?: Record<string, any> | undefined;
1459
+ duplex?: "full" | "half" | undefined;
1460
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1461
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1462
+ retryAttempt?: number | undefined;
1463
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1464
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1465
+ disableValidation?: boolean | undefined;
1466
+ }>(data_0?: better_auth.Prettify<{
1467
+ query?: Record<string, any> | undefined;
1468
+ fetchOptions?: FetchOptions | undefined;
1469
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1470
+ status: boolean;
1471
+ }, {
1472
+ code?: string;
1473
+ message?: string;
1474
+ }, FetchOptions["throw"] extends true ? true : false>>;
1475
+ } & {
1476
+ revokeOtherSessions: <FetchOptions extends {
1477
+ cache?: RequestCache | undefined;
1478
+ credentials?: RequestCredentials | undefined;
1479
+ headers?: (HeadersInit & (HeadersInit | {
1480
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1481
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1482
+ authorization: "Bearer" | "Basic";
1483
+ })) | undefined;
1484
+ integrity?: string | undefined;
1485
+ keepalive?: boolean | undefined;
1486
+ method?: string | undefined;
1487
+ mode?: RequestMode | undefined;
1488
+ priority?: RequestPriority | undefined;
1489
+ redirect?: RequestRedirect | undefined;
1490
+ referrer?: string | undefined;
1491
+ referrerPolicy?: ReferrerPolicy | undefined;
1492
+ signal?: (AbortSignal | null) | undefined;
1493
+ window?: null | undefined;
1494
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1495
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1496
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1497
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1498
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1499
+ hookOptions?: {
1500
+ cloneResponse?: boolean;
1501
+ } | undefined;
1502
+ timeout?: number | undefined;
1503
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1504
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1505
+ baseURL?: string | undefined;
1506
+ throw?: boolean | undefined;
1507
+ auth?: ({
1508
+ type: "Bearer";
1509
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1510
+ } | {
1511
+ type: "Basic";
1512
+ username: string | (() => string | undefined) | undefined;
1513
+ password: string | (() => string | undefined) | undefined;
1514
+ } | {
1515
+ type: "Custom";
1516
+ prefix: string | (() => string | undefined) | undefined;
1517
+ value: string | (() => string | undefined) | undefined;
1518
+ }) | undefined;
1519
+ body?: undefined;
1520
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1521
+ params?: Record<string, any> | undefined;
1522
+ duplex?: "full" | "half" | undefined;
1523
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1524
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1525
+ retryAttempt?: number | undefined;
1526
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1527
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1528
+ disableValidation?: boolean | undefined;
1529
+ }>(data_0?: better_auth.Prettify<{
1530
+ query?: Record<string, any> | undefined;
1531
+ fetchOptions?: FetchOptions | undefined;
1532
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1533
+ status: boolean;
1534
+ }, {
1535
+ code?: string;
1536
+ message?: string;
1537
+ }, FetchOptions["throw"] extends true ? true : false>>;
1538
+ } & {
1539
+ linkSocial: <FetchOptions extends {
1540
+ cache?: RequestCache | undefined;
1541
+ credentials?: RequestCredentials | undefined;
1542
+ headers?: (HeadersInit & (HeadersInit | {
1543
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1544
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1545
+ authorization: "Bearer" | "Basic";
1546
+ })) | undefined;
1547
+ integrity?: string | undefined;
1548
+ keepalive?: boolean | undefined;
1549
+ method?: string | undefined;
1550
+ mode?: RequestMode | undefined;
1551
+ priority?: RequestPriority | undefined;
1552
+ redirect?: RequestRedirect | undefined;
1553
+ referrer?: string | undefined;
1554
+ referrerPolicy?: ReferrerPolicy | undefined;
1555
+ signal?: (AbortSignal | null) | undefined;
1556
+ window?: null | undefined;
1557
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1558
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1559
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1560
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1561
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1562
+ hookOptions?: {
1563
+ cloneResponse?: boolean;
1564
+ } | undefined;
1565
+ timeout?: number | undefined;
1566
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1567
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1568
+ baseURL?: string | undefined;
1569
+ throw?: boolean | undefined;
1570
+ auth?: ({
1571
+ type: "Bearer";
1572
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1573
+ } | {
1574
+ type: "Basic";
1575
+ username: string | (() => string | undefined) | undefined;
1576
+ password: string | (() => string | undefined) | undefined;
1577
+ } | {
1578
+ type: "Custom";
1579
+ prefix: string | (() => string | undefined) | undefined;
1580
+ value: string | (() => string | undefined) | undefined;
1581
+ }) | undefined;
1582
+ body?: (Partial<{
1583
+ provider: unknown;
1584
+ callbackURL?: string | undefined;
1585
+ idToken?: {
1586
+ token: string;
1587
+ nonce?: string | undefined;
1588
+ accessToken?: string | undefined;
1589
+ refreshToken?: string | undefined;
1590
+ scopes?: string[] | undefined;
1591
+ } | undefined;
1592
+ requestSignUp?: boolean | undefined;
1593
+ scopes?: string[] | undefined;
1594
+ errorCallbackURL?: string | undefined;
1595
+ disableRedirect?: boolean | undefined;
1596
+ }> & Record<string, any>) | undefined;
1597
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1598
+ params?: Record<string, any> | undefined;
1599
+ duplex?: "full" | "half" | undefined;
1600
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1601
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1602
+ retryAttempt?: number | undefined;
1603
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1604
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1605
+ disableValidation?: boolean | undefined;
1606
+ }>(data_0: better_auth.Prettify<{
1607
+ provider: unknown;
1608
+ callbackURL?: string | undefined;
1609
+ idToken?: {
1610
+ token: string;
1611
+ nonce?: string | undefined;
1612
+ accessToken?: string | undefined;
1613
+ refreshToken?: string | undefined;
1614
+ scopes?: string[] | undefined;
1615
+ } | undefined;
1616
+ requestSignUp?: boolean | undefined;
1617
+ scopes?: string[] | undefined;
1618
+ errorCallbackURL?: string | undefined;
1619
+ disableRedirect?: boolean | undefined;
1620
+ } & {
1621
+ fetchOptions?: FetchOptions | undefined;
1622
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1623
+ url: string;
1624
+ redirect: boolean;
1625
+ }, {
1626
+ code?: string;
1627
+ message?: string;
1628
+ }, FetchOptions["throw"] extends true ? true : false>>;
1629
+ } & {
1630
+ listAccounts: <FetchOptions extends {
1631
+ cache?: RequestCache | undefined;
1632
+ credentials?: RequestCredentials | undefined;
1633
+ headers?: (HeadersInit & (HeadersInit | {
1634
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1635
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1636
+ authorization: "Bearer" | "Basic";
1637
+ })) | undefined;
1638
+ integrity?: string | undefined;
1639
+ keepalive?: boolean | undefined;
1640
+ method?: string | undefined;
1641
+ mode?: RequestMode | undefined;
1642
+ priority?: RequestPriority | undefined;
1643
+ redirect?: RequestRedirect | undefined;
1644
+ referrer?: string | undefined;
1645
+ referrerPolicy?: ReferrerPolicy | undefined;
1646
+ signal?: (AbortSignal | null) | undefined;
1647
+ window?: null | undefined;
1648
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1649
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1650
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1651
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1652
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1653
+ hookOptions?: {
1654
+ cloneResponse?: boolean;
1655
+ } | undefined;
1656
+ timeout?: number | undefined;
1657
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1658
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1659
+ baseURL?: string | undefined;
1660
+ throw?: boolean | undefined;
1661
+ auth?: ({
1662
+ type: "Bearer";
1663
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1664
+ } | {
1665
+ type: "Basic";
1666
+ username: string | (() => string | undefined) | undefined;
1667
+ password: string | (() => string | undefined) | undefined;
1668
+ } | {
1669
+ type: "Custom";
1670
+ prefix: string | (() => string | undefined) | undefined;
1671
+ value: string | (() => string | undefined) | undefined;
1672
+ }) | undefined;
1673
+ body?: undefined;
1674
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1675
+ params?: Record<string, any> | undefined;
1676
+ duplex?: "full" | "half" | undefined;
1677
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1678
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1679
+ retryAttempt?: number | undefined;
1680
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1681
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1682
+ disableValidation?: boolean | undefined;
1683
+ }>(data_0?: better_auth.Prettify<{
1684
+ query?: Record<string, any> | undefined;
1685
+ fetchOptions?: FetchOptions | undefined;
1686
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1687
+ id: string;
1688
+ providerId: string;
1689
+ createdAt: Date;
1690
+ updatedAt: Date;
1691
+ accountId: string;
1692
+ scopes: string[];
1693
+ }[], {
1694
+ code?: string;
1695
+ message?: string;
1696
+ }, FetchOptions["throw"] extends true ? true : false>>;
1697
+ } & {
1698
+ deleteUser: {
1699
+ callback: <FetchOptions extends {
1700
+ cache?: RequestCache | undefined;
1701
+ credentials?: RequestCredentials | undefined;
1702
+ headers?: (HeadersInit & (HeadersInit | {
1703
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1704
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1705
+ authorization: "Bearer" | "Basic";
1706
+ })) | undefined;
1707
+ integrity?: string | undefined;
1708
+ keepalive?: boolean | undefined;
1709
+ method?: string | undefined;
1710
+ mode?: RequestMode | undefined;
1711
+ priority?: RequestPriority | undefined;
1712
+ redirect?: RequestRedirect | undefined;
1713
+ referrer?: string | undefined;
1714
+ referrerPolicy?: ReferrerPolicy | undefined;
1715
+ signal?: (AbortSignal | null) | undefined;
1716
+ window?: null | undefined;
1717
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1718
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1719
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1720
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1721
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1722
+ hookOptions?: {
1723
+ cloneResponse?: boolean;
1724
+ } | undefined;
1725
+ timeout?: number | undefined;
1726
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1727
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1728
+ baseURL?: string | undefined;
1729
+ throw?: boolean | undefined;
1730
+ auth?: ({
1731
+ type: "Bearer";
1732
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1733
+ } | {
1734
+ type: "Basic";
1735
+ username: string | (() => string | undefined) | undefined;
1736
+ password: string | (() => string | undefined) | undefined;
1737
+ } | {
1738
+ type: "Custom";
1739
+ prefix: string | (() => string | undefined) | undefined;
1740
+ value: string | (() => string | undefined) | undefined;
1741
+ }) | undefined;
1742
+ body?: undefined;
1743
+ query?: (Partial<{
1744
+ token: string;
1745
+ callbackURL?: string | undefined;
1746
+ }> & Record<string, any>) | undefined;
1747
+ params?: Record<string, any> | undefined;
1748
+ duplex?: "full" | "half" | undefined;
1749
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1750
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1751
+ retryAttempt?: number | undefined;
1752
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1753
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1754
+ disableValidation?: boolean | undefined;
1755
+ }>(data_0: better_auth.Prettify<{
1756
+ query: {
1757
+ token: string;
1758
+ callbackURL?: string | undefined;
1759
+ };
1760
+ fetchOptions?: FetchOptions | undefined;
1761
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1762
+ success: boolean;
1763
+ message: string;
1764
+ }, {
1765
+ code?: string;
1766
+ message?: string;
1767
+ }, FetchOptions["throw"] extends true ? true : false>>;
1768
+ };
1769
+ } & {
1770
+ unlinkAccount: <FetchOptions extends {
1771
+ cache?: RequestCache | undefined;
1772
+ credentials?: RequestCredentials | undefined;
1773
+ headers?: (HeadersInit & (HeadersInit | {
1774
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1775
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1776
+ authorization: "Bearer" | "Basic";
1777
+ })) | undefined;
1778
+ integrity?: string | undefined;
1779
+ keepalive?: boolean | undefined;
1780
+ method?: string | undefined;
1781
+ mode?: RequestMode | undefined;
1782
+ priority?: RequestPriority | undefined;
1783
+ redirect?: RequestRedirect | undefined;
1784
+ referrer?: string | undefined;
1785
+ referrerPolicy?: ReferrerPolicy | undefined;
1786
+ signal?: (AbortSignal | null) | undefined;
1787
+ window?: null | undefined;
1788
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1789
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1790
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1791
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1792
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1793
+ hookOptions?: {
1794
+ cloneResponse?: boolean;
1795
+ } | undefined;
1796
+ timeout?: number | undefined;
1797
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1798
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1799
+ baseURL?: string | undefined;
1800
+ throw?: boolean | undefined;
1801
+ auth?: ({
1802
+ type: "Bearer";
1803
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1804
+ } | {
1805
+ type: "Basic";
1806
+ username: string | (() => string | undefined) | undefined;
1807
+ password: string | (() => string | undefined) | undefined;
1808
+ } | {
1809
+ type: "Custom";
1810
+ prefix: string | (() => string | undefined) | undefined;
1811
+ value: string | (() => string | undefined) | undefined;
1812
+ }) | undefined;
1813
+ body?: (Partial<{
1814
+ providerId: string;
1815
+ accountId?: string | undefined;
1816
+ }> & Record<string, any>) | undefined;
1817
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1818
+ params?: Record<string, any> | undefined;
1819
+ duplex?: "full" | "half" | undefined;
1820
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1821
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1822
+ retryAttempt?: number | undefined;
1823
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1824
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1825
+ disableValidation?: boolean | undefined;
1826
+ }>(data_0: better_auth.Prettify<{
1827
+ providerId: string;
1828
+ accountId?: string | undefined;
1829
+ } & {
1830
+ fetchOptions?: FetchOptions | undefined;
1831
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1832
+ status: boolean;
1833
+ }, {
1834
+ code?: string;
1835
+ message?: string;
1836
+ }, FetchOptions["throw"] extends true ? true : false>>;
1837
+ } & {
1838
+ refreshToken: <FetchOptions extends {
1839
+ cache?: RequestCache | undefined;
1840
+ credentials?: RequestCredentials | undefined;
1841
+ headers?: (HeadersInit & (HeadersInit | {
1842
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1843
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1844
+ authorization: "Bearer" | "Basic";
1845
+ })) | undefined;
1846
+ integrity?: string | undefined;
1847
+ keepalive?: boolean | undefined;
1848
+ method?: string | undefined;
1849
+ mode?: RequestMode | undefined;
1850
+ priority?: RequestPriority | undefined;
1851
+ redirect?: RequestRedirect | undefined;
1852
+ referrer?: string | undefined;
1853
+ referrerPolicy?: ReferrerPolicy | undefined;
1854
+ signal?: (AbortSignal | null) | undefined;
1855
+ window?: null | undefined;
1856
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1857
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1858
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1859
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1860
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1861
+ hookOptions?: {
1862
+ cloneResponse?: boolean;
1863
+ } | undefined;
1864
+ timeout?: number | undefined;
1865
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1866
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1867
+ baseURL?: string | undefined;
1868
+ throw?: boolean | undefined;
1869
+ auth?: ({
1870
+ type: "Bearer";
1871
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1872
+ } | {
1873
+ type: "Basic";
1874
+ username: string | (() => string | undefined) | undefined;
1875
+ password: string | (() => string | undefined) | undefined;
1876
+ } | {
1877
+ type: "Custom";
1878
+ prefix: string | (() => string | undefined) | undefined;
1879
+ value: string | (() => string | undefined) | undefined;
1880
+ }) | undefined;
1881
+ body?: (Partial<{
1882
+ providerId: string;
1883
+ accountId?: string | undefined;
1884
+ userId?: string | undefined;
1885
+ }> & Record<string, any>) | undefined;
1886
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1887
+ params?: Record<string, any> | undefined;
1888
+ duplex?: "full" | "half" | undefined;
1889
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1890
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1891
+ retryAttempt?: number | undefined;
1892
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1893
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1894
+ disableValidation?: boolean | undefined;
1895
+ }>(data_0: better_auth.Prettify<{
1896
+ providerId: string;
1897
+ accountId?: string | undefined;
1898
+ userId?: string | undefined;
1899
+ } & {
1900
+ fetchOptions?: FetchOptions | undefined;
1901
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.OAuth2Tokens, {
1902
+ code?: string;
1903
+ message?: string;
1904
+ }, FetchOptions["throw"] extends true ? true : false>>;
1905
+ } & {
1906
+ getAccessToken: <FetchOptions extends {
1907
+ cache?: RequestCache | undefined;
1908
+ credentials?: RequestCredentials | undefined;
1909
+ headers?: (HeadersInit & (HeadersInit | {
1910
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1911
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1912
+ authorization: "Bearer" | "Basic";
1913
+ })) | undefined;
1914
+ integrity?: string | undefined;
1915
+ keepalive?: boolean | undefined;
1916
+ method?: string | undefined;
1917
+ mode?: RequestMode | undefined;
1918
+ priority?: RequestPriority | undefined;
1919
+ redirect?: RequestRedirect | undefined;
1920
+ referrer?: string | undefined;
1921
+ referrerPolicy?: ReferrerPolicy | undefined;
1922
+ signal?: (AbortSignal | null) | undefined;
1923
+ window?: null | undefined;
1924
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1925
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1926
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1927
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1928
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1929
+ hookOptions?: {
1930
+ cloneResponse?: boolean;
1931
+ } | undefined;
1932
+ timeout?: number | undefined;
1933
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
1934
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
1935
+ baseURL?: string | undefined;
1936
+ throw?: boolean | undefined;
1937
+ auth?: ({
1938
+ type: "Bearer";
1939
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1940
+ } | {
1941
+ type: "Basic";
1942
+ username: string | (() => string | undefined) | undefined;
1943
+ password: string | (() => string | undefined) | undefined;
1944
+ } | {
1945
+ type: "Custom";
1946
+ prefix: string | (() => string | undefined) | undefined;
1947
+ value: string | (() => string | undefined) | undefined;
1948
+ }) | undefined;
1949
+ body?: (Partial<{
1950
+ providerId: string;
1951
+ accountId?: string | undefined;
1952
+ userId?: string | undefined;
1953
+ }> & Record<string, any>) | undefined;
1954
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1955
+ params?: Record<string, any> | undefined;
1956
+ duplex?: "full" | "half" | undefined;
1957
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1958
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
1959
+ retryAttempt?: number | undefined;
1960
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1961
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1962
+ disableValidation?: boolean | undefined;
1963
+ }>(data_0: better_auth.Prettify<{
1964
+ providerId: string;
1965
+ accountId?: string | undefined;
1966
+ userId?: string | undefined;
1967
+ } & {
1968
+ fetchOptions?: FetchOptions | undefined;
1969
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1970
+ accessToken: string;
1971
+ accessTokenExpiresAt: Date | undefined;
1972
+ scopes: string[];
1973
+ idToken: string | undefined;
1974
+ }, {
1975
+ code?: string;
1976
+ message?: string;
1977
+ }, FetchOptions["throw"] extends true ? true : false>>;
1978
+ } & {
1979
+ accountInfo: <FetchOptions extends {
1980
+ cache?: RequestCache | undefined;
1981
+ credentials?: RequestCredentials | undefined;
1982
+ headers?: (HeadersInit & (HeadersInit | {
1983
+ accept: "application/json" | "text/plain" | "application/octet-stream";
1984
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1985
+ authorization: "Bearer" | "Basic";
1986
+ })) | undefined;
1987
+ integrity?: string | undefined;
1988
+ keepalive?: boolean | undefined;
1989
+ method?: string | undefined;
1990
+ mode?: RequestMode | undefined;
1991
+ priority?: RequestPriority | undefined;
1992
+ redirect?: RequestRedirect | undefined;
1993
+ referrer?: string | undefined;
1994
+ referrerPolicy?: ReferrerPolicy | undefined;
1995
+ signal?: (AbortSignal | null) | undefined;
1996
+ window?: null | undefined;
1997
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1998
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1999
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
2000
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
2001
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
2002
+ hookOptions?: {
2003
+ cloneResponse?: boolean;
2004
+ } | undefined;
2005
+ timeout?: number | undefined;
2006
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
2007
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
2008
+ baseURL?: string | undefined;
2009
+ throw?: boolean | undefined;
2010
+ auth?: ({
2011
+ type: "Bearer";
2012
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
2013
+ } | {
2014
+ type: "Basic";
2015
+ username: string | (() => string | undefined) | undefined;
2016
+ password: string | (() => string | undefined) | undefined;
2017
+ } | {
2018
+ type: "Custom";
2019
+ prefix: string | (() => string | undefined) | undefined;
2020
+ value: string | (() => string | undefined) | undefined;
2021
+ }) | undefined;
2022
+ body?: (Partial<{
2023
+ accountId: string;
2024
+ }> & Record<string, any>) | undefined;
2025
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
2026
+ params?: Record<string, any> | undefined;
2027
+ duplex?: "full" | "half" | undefined;
2028
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
2029
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
2030
+ retryAttempt?: number | undefined;
2031
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2032
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
2033
+ disableValidation?: boolean | undefined;
2034
+ }>(data_0: better_auth.Prettify<{
2035
+ accountId: string;
2036
+ } & {
2037
+ fetchOptions?: FetchOptions | undefined;
2038
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2039
+ user: better_auth.OAuth2UserInfo;
2040
+ data: Record<string, any>;
2041
+ }, {
2042
+ code?: string;
2043
+ message?: string;
2044
+ }, FetchOptions["throw"] extends true ? true : false>>;
2045
+ } & {
2046
+ signUp: {
2047
+ email: <FetchOptions extends {
2048
+ cache?: RequestCache | undefined;
2049
+ credentials?: RequestCredentials | undefined;
2050
+ headers?: (HeadersInit & (HeadersInit | {
2051
+ accept: "application/json" | "text/plain" | "application/octet-stream";
2052
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
2053
+ authorization: "Bearer" | "Basic";
2054
+ })) | undefined;
2055
+ integrity?: string | undefined;
2056
+ keepalive?: boolean | undefined;
2057
+ method?: string | undefined;
2058
+ mode?: RequestMode | undefined;
2059
+ priority?: RequestPriority | undefined;
2060
+ redirect?: RequestRedirect | undefined;
2061
+ referrer?: string | undefined;
2062
+ referrerPolicy?: ReferrerPolicy | undefined;
2063
+ signal?: (AbortSignal | null) | undefined;
2064
+ window?: null | undefined;
2065
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
2066
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
2067
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
2068
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
2069
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
2070
+ hookOptions?: {
2071
+ cloneResponse?: boolean;
2072
+ } | undefined;
2073
+ timeout?: number | undefined;
2074
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
2075
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
2076
+ baseURL?: string | undefined;
2077
+ throw?: boolean | undefined;
2078
+ auth?: ({
2079
+ type: "Bearer";
2080
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
2081
+ } | {
2082
+ type: "Basic";
2083
+ username: string | (() => string | undefined) | undefined;
2084
+ password: string | (() => string | undefined) | undefined;
2085
+ } | {
2086
+ type: "Custom";
2087
+ prefix: string | (() => string | undefined) | undefined;
2088
+ value: string | (() => string | undefined) | undefined;
2089
+ }) | undefined;
2090
+ body?: (Partial<{
2091
+ name: string;
2092
+ email: string;
2093
+ password: string;
2094
+ image?: string;
2095
+ callbackURL?: string;
2096
+ rememberMe?: boolean;
2097
+ }> & Record<string, any>) | undefined;
2098
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
2099
+ params?: Record<string, any> | undefined;
2100
+ duplex?: "full" | "half" | undefined;
2101
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
2102
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
2103
+ retryAttempt?: number | undefined;
2104
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2105
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
2106
+ disableValidation?: boolean | undefined;
2107
+ }>(data_0: better_auth.Prettify<{
2108
+ email: string;
2109
+ name: string;
2110
+ password: string;
2111
+ image?: string;
2112
+ callbackURL?: string;
2113
+ fetchOptions?: FetchOptions | undefined;
2114
+ } & {} & {}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
2115
+ token: null;
2116
+ user: {
2117
+ id: string;
2118
+ email: string;
2119
+ name: string;
2120
+ image: string | null | undefined;
2121
+ emailVerified: boolean;
2122
+ createdAt: Date;
2123
+ updatedAt: Date;
2124
+ };
2125
+ } | {
2126
+ token: string;
2127
+ user: {
2128
+ id: string;
2129
+ email: string;
2130
+ name: string;
2131
+ image: string | null | undefined;
2132
+ emailVerified: boolean;
2133
+ createdAt: Date;
2134
+ updatedAt: Date;
2135
+ };
2136
+ }>, {
2137
+ code?: string;
2138
+ message?: string;
2139
+ }, FetchOptions["throw"] extends true ? true : false>>;
2140
+ };
2141
+ } & {
2142
+ updateUser: <FetchOptions extends {
2143
+ cache?: RequestCache | undefined;
2144
+ credentials?: RequestCredentials | undefined;
2145
+ headers?: (HeadersInit & (HeadersInit | {
2146
+ accept: "application/json" | "text/plain" | "application/octet-stream";
2147
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
2148
+ authorization: "Bearer" | "Basic";
2149
+ })) | undefined;
2150
+ integrity?: string | undefined;
2151
+ keepalive?: boolean | undefined;
2152
+ method?: string | undefined;
2153
+ mode?: RequestMode | undefined;
2154
+ priority?: RequestPriority | undefined;
2155
+ redirect?: RequestRedirect | undefined;
2156
+ referrer?: string | undefined;
2157
+ referrerPolicy?: ReferrerPolicy | undefined;
2158
+ signal?: (AbortSignal | null) | undefined;
2159
+ window?: null | undefined;
2160
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
2161
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
2162
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
2163
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
2164
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
2165
+ hookOptions?: {
2166
+ cloneResponse?: boolean;
2167
+ } | undefined;
2168
+ timeout?: number | undefined;
2169
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
2170
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
2171
+ baseURL?: string | undefined;
2172
+ throw?: boolean | undefined;
2173
+ auth?: ({
2174
+ type: "Bearer";
2175
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
2176
+ } | {
2177
+ type: "Basic";
2178
+ username: string | (() => string | undefined) | undefined;
2179
+ password: string | (() => string | undefined) | undefined;
2180
+ } | {
2181
+ type: "Custom";
2182
+ prefix: string | (() => string | undefined) | undefined;
2183
+ value: string | (() => string | undefined) | undefined;
2184
+ }) | undefined;
2185
+ body?: (Partial<Partial<{}> & {
2186
+ name?: string;
2187
+ image?: string;
2188
+ }> & Record<string, any>) | undefined;
2189
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
2190
+ params?: Record<string, any> | undefined;
2191
+ duplex?: "full" | "half" | undefined;
2192
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
2193
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
2194
+ retryAttempt?: number | undefined;
2195
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2196
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
2197
+ disableValidation?: boolean | undefined;
2198
+ }>(data_0?: better_auth.Prettify<{
2199
+ image?: string | null;
2200
+ name?: string;
2201
+ fetchOptions?: FetchOptions | undefined;
2202
+ } & Partial<{} & {}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2203
+ status: boolean;
2204
+ }, {
2205
+ code?: string;
2206
+ message?: string;
2207
+ }, FetchOptions["throw"] extends true ? true : false>>;
2208
+ } & {
2209
+ listSessions: <FetchOptions extends {
2210
+ cache?: RequestCache | undefined;
2211
+ credentials?: RequestCredentials | undefined;
2212
+ headers?: (HeadersInit & (HeadersInit | {
2213
+ accept: "application/json" | "text/plain" | "application/octet-stream";
2214
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
2215
+ authorization: "Bearer" | "Basic";
2216
+ })) | undefined;
2217
+ integrity?: string | undefined;
2218
+ keepalive?: boolean | undefined;
2219
+ method?: string | undefined;
2220
+ mode?: RequestMode | undefined;
2221
+ priority?: RequestPriority | undefined;
2222
+ redirect?: RequestRedirect | undefined;
2223
+ referrer?: string | undefined;
2224
+ referrerPolicy?: ReferrerPolicy | undefined;
2225
+ signal?: (AbortSignal | null) | undefined;
2226
+ window?: null | undefined;
2227
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
2228
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
2229
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
2230
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
2231
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
2232
+ hookOptions?: {
2233
+ cloneResponse?: boolean;
2234
+ } | undefined;
2235
+ timeout?: number | undefined;
2236
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
2237
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
2238
+ baseURL?: string | undefined;
2239
+ throw?: boolean | undefined;
2240
+ auth?: ({
2241
+ type: "Bearer";
2242
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
2243
+ } | {
2244
+ type: "Basic";
2245
+ username: string | (() => string | undefined) | undefined;
2246
+ password: string | (() => string | undefined) | undefined;
2247
+ } | {
2248
+ type: "Custom";
2249
+ prefix: string | (() => string | undefined) | undefined;
2250
+ value: string | (() => string | undefined) | undefined;
2251
+ }) | undefined;
2252
+ body?: undefined;
2253
+ query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
2254
+ params?: Record<string, any> | undefined;
2255
+ duplex?: "full" | "half" | undefined;
2256
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
2257
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
2258
+ retryAttempt?: number | undefined;
2259
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2260
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
2261
+ disableValidation?: boolean | undefined;
2262
+ }>(data_0?: better_auth.Prettify<{
2263
+ query?: Record<string, any> | undefined;
2264
+ fetchOptions?: FetchOptions | undefined;
2265
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.Prettify<{
2266
+ id: string;
2267
+ createdAt: Date;
2268
+ updatedAt: Date;
2269
+ userId: string;
2270
+ expiresAt: Date;
2271
+ token: string;
2272
+ ipAddress?: string | null | undefined | undefined;
2273
+ userAgent?: string | null | undefined | undefined;
2274
+ }>[], {
2275
+ code?: string;
2276
+ message?: string;
2277
+ }, FetchOptions["throw"] extends true ? true : false>>;
2278
+ } & {
2279
+ getSession: <FetchOptions extends {
2280
+ cache?: RequestCache | undefined;
2281
+ credentials?: RequestCredentials | undefined;
2282
+ headers?: (HeadersInit & (HeadersInit | {
2283
+ accept: "application/json" | "text/plain" | "application/octet-stream";
2284
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
2285
+ authorization: "Bearer" | "Basic";
2286
+ })) | undefined;
2287
+ integrity?: string | undefined;
2288
+ keepalive?: boolean | undefined;
2289
+ method?: string | undefined;
2290
+ mode?: RequestMode | undefined;
2291
+ priority?: RequestPriority | undefined;
2292
+ redirect?: RequestRedirect | undefined;
2293
+ referrer?: string | undefined;
2294
+ referrerPolicy?: ReferrerPolicy | undefined;
2295
+ signal?: (AbortSignal | null) | undefined;
2296
+ window?: null | undefined;
2297
+ onRequest?: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
2298
+ onResponse?: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
2299
+ onSuccess?: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
2300
+ onError?: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
2301
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
2302
+ hookOptions?: {
2303
+ cloneResponse?: boolean;
2304
+ } | undefined;
2305
+ timeout?: number | undefined;
2306
+ customFetchImpl?: _better_fetch_fetch.FetchEsque | undefined;
2307
+ plugins?: _better_fetch_fetch.BetterFetchPlugin[] | undefined;
2308
+ baseURL?: string | undefined;
2309
+ throw?: boolean | undefined;
2310
+ auth?: ({
2311
+ type: "Bearer";
2312
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
2313
+ } | {
2314
+ type: "Basic";
2315
+ username: string | (() => string | undefined) | undefined;
2316
+ password: string | (() => string | undefined) | undefined;
2317
+ } | {
2318
+ type: "Custom";
2319
+ prefix: string | (() => string | undefined) | undefined;
2320
+ value: string | (() => string | undefined) | undefined;
2321
+ }) | undefined;
2322
+ body?: undefined;
2323
+ query?: (Partial<{
2324
+ disableCookieCache?: string | boolean | undefined;
2325
+ disableRefresh?: boolean | undefined;
2326
+ }> & Record<string, any>) | undefined;
2327
+ params?: Record<string, any> | undefined;
2328
+ duplex?: "full" | "half" | undefined;
2329
+ jsonParser?: ((text: string) => Promise<any> | any) | undefined;
2330
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
2331
+ retryAttempt?: number | undefined;
2332
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2333
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
2334
+ disableValidation?: boolean | undefined;
2335
+ }>(data_0?: better_auth.Prettify<{
2336
+ query?: {
2337
+ disableCookieCache?: string | boolean | undefined;
2338
+ disableRefresh?: boolean | undefined;
2339
+ } | undefined;
2340
+ fetchOptions?: FetchOptions | undefined;
2341
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2342
+ user: Omit<{
2343
+ id: string;
2344
+ createdAt: Date;
2345
+ updatedAt: Date;
2346
+ email: string;
2347
+ emailVerified: boolean;
2348
+ name: string;
2349
+ image?: string | null | undefined | undefined;
2350
+ } & {
2351
+ userId: string;
2352
+ }, "userId"> & {
2353
+ id: string;
2354
+ };
2355
+ session: {
2356
+ id: string;
2357
+ createdAt: Date;
2358
+ updatedAt: Date;
2359
+ userId: string;
2360
+ expiresAt: Date;
2361
+ token: string;
2362
+ ipAddress?: string | null | undefined | undefined;
2363
+ userAgent?: string | null | undefined | undefined;
2364
+ } & {
2365
+ userId: string;
2366
+ };
2367
+ }, {
2368
+ code?: string;
2369
+ message?: string;
2370
+ }, FetchOptions["throw"] extends true ? true : false>>;
2371
+ } & {
2372
+ getCookie: () => string;
2373
+ updateSession: () => void;
2374
+ getSessionData: () => any;
2375
+ } & {
2376
+ useSession: nanostores.Atom<{
2377
+ data: {
2378
+ user: Omit<{
2379
+ id: string;
2380
+ createdAt: Date;
2381
+ updatedAt: Date;
2382
+ email: string;
2383
+ emailVerified: boolean;
2384
+ name: string;
2385
+ image?: string | null | undefined | undefined;
2386
+ } & {
2387
+ userId: string;
2388
+ }, "userId"> & {
2389
+ id: string;
2390
+ };
2391
+ session: {
2392
+ id: string;
2393
+ createdAt: Date;
2394
+ updatedAt: Date;
2395
+ userId: string;
2396
+ expiresAt: Date;
2397
+ token: string;
2398
+ ipAddress?: string | null | undefined | undefined;
2399
+ userAgent?: string | null | undefined | undefined;
2400
+ } & {
2401
+ userId: string;
2402
+ };
2403
+ } | null;
2404
+ error: _better_fetch_fetch.BetterFetchError | null;
2405
+ isPending: boolean;
2406
+ }>;
2407
+ $fetch: _better_fetch_fetch.BetterFetch<{
2408
+ plugins: (_better_fetch_fetch.BetterFetchPlugin | {
2409
+ id: string;
2410
+ name: string;
2411
+ hooks: {
2412
+ onSuccess: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
2413
+ onError: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
2414
+ onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
2415
+ onResponse: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
2416
+ };
2417
+ } | {
2418
+ id: string;
2419
+ name: string;
2420
+ hooks: {
2421
+ onSuccess(context: _better_fetch_fetch.SuccessContext<any>): void;
2422
+ };
2423
+ })[];
2424
+ cache?: RequestCache | undefined;
2425
+ credentials?: RequestCredentials;
2426
+ headers?: (HeadersInit & (HeadersInit | {
2427
+ accept: "application/json" | "text/plain" | "application/octet-stream";
2428
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
2429
+ authorization: "Bearer" | "Basic";
2430
+ })) | undefined;
2431
+ integrity?: string | undefined;
2432
+ keepalive?: boolean | undefined;
2433
+ method: string;
2434
+ mode?: RequestMode | undefined;
2435
+ priority?: RequestPriority | undefined;
2436
+ redirect?: RequestRedirect | undefined;
2437
+ referrer?: string | undefined;
2438
+ referrerPolicy?: ReferrerPolicy | undefined;
2439
+ signal?: (AbortSignal | null) | undefined;
2440
+ window?: null | undefined;
2441
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
2442
+ hookOptions?: {
2443
+ cloneResponse?: boolean;
2444
+ } | undefined;
2445
+ timeout?: number | undefined;
2446
+ customFetchImpl: _better_fetch_fetch.FetchEsque;
2447
+ baseURL: string;
2448
+ throw?: boolean | undefined;
2449
+ auth?: ({
2450
+ type: "Bearer";
2451
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
2452
+ } | {
2453
+ type: "Basic";
2454
+ username: string | (() => string | undefined) | undefined;
2455
+ password: string | (() => string | undefined) | undefined;
2456
+ } | {
2457
+ type: "Custom";
2458
+ prefix: string | (() => string | undefined) | undefined;
2459
+ value: string | (() => string | undefined) | undefined;
2460
+ }) | undefined;
2461
+ body?: any;
2462
+ query?: any;
2463
+ params?: any;
2464
+ duplex?: "full" | "half" | undefined;
2465
+ jsonParser: (text: string) => Promise<any> | any;
2466
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
2467
+ retryAttempt?: number | undefined;
2468
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2469
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
2470
+ disableValidation?: boolean | undefined;
2471
+ }, unknown, unknown, {}>;
2472
+ $store: {
2473
+ notify: (signal?: Omit<string, "$sessionSignal"> | "$sessionSignal") => void;
2474
+ listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
2475
+ atoms: Record<string, nanostores.WritableAtom<any>>;
2476
+ };
2477
+ $Infer: {
2478
+ Session: {
2479
+ user: Omit<{
2480
+ id: string;
2481
+ createdAt: Date;
2482
+ updatedAt: Date;
2483
+ email: string;
2484
+ emailVerified: boolean;
2485
+ name: string;
2486
+ image?: string | null | undefined | undefined;
2487
+ } & {
2488
+ userId: string;
2489
+ }, "userId"> & {
2490
+ id: string;
2491
+ };
2492
+ session: {
2493
+ id: string;
2494
+ createdAt: Date;
2495
+ updatedAt: Date;
2496
+ userId: string;
2497
+ expiresAt: Date;
2498
+ token: string;
2499
+ ipAddress?: string | null | undefined | undefined;
2500
+ userAgent?: string | null | undefined | undefined;
2501
+ } & {
2502
+ userId: string;
2503
+ };
2504
+ };
2505
+ };
2506
+ $ERROR_CODES: {
2507
+ USER_NOT_FOUND: string;
2508
+ FAILED_TO_CREATE_USER: string;
2509
+ FAILED_TO_CREATE_SESSION: string;
2510
+ FAILED_TO_UPDATE_USER: string;
2511
+ FAILED_TO_GET_SESSION: string;
2512
+ INVALID_PASSWORD: string;
2513
+ INVALID_EMAIL: string;
2514
+ INVALID_EMAIL_OR_PASSWORD: string;
2515
+ SOCIAL_ACCOUNT_ALREADY_LINKED: string;
2516
+ PROVIDER_NOT_FOUND: string;
2517
+ INVALID_TOKEN: string;
2518
+ ID_TOKEN_NOT_SUPPORTED: string;
2519
+ FAILED_TO_GET_USER_INFO: string;
2520
+ USER_EMAIL_NOT_FOUND: string;
2521
+ EMAIL_NOT_VERIFIED: string;
2522
+ PASSWORD_TOO_SHORT: string;
2523
+ PASSWORD_TOO_LONG: string;
2524
+ USER_ALREADY_EXISTS: string;
2525
+ EMAIL_CAN_NOT_BE_UPDATED: string;
2526
+ CREDENTIAL_ACCOUNT_NOT_FOUND: string;
2527
+ SESSION_EXPIRED: string;
2528
+ FAILED_TO_UNLINK_LAST_ACCOUNT: string;
2529
+ ACCOUNT_NOT_FOUND: string;
2530
+ USER_ALREADY_HAS_PASSWORD: string;
2531
+ };
2532
+ }>;
2533
+ /** Provide a configured Better Auth client via DI (default convex+crossDomain plugins) */
2534
+ declare function provideAuthClient(opts: ProvideAuthClientOptions): Provider;
2535
+
2536
+ type QueryRef = FunctionReference<'query'>;
2537
+ type KeepMode = 'none' | 'last';
2538
+ interface ConvexResourceOptions {
2539
+ keep?: KeepMode;
2540
+ }
2541
+ declare const CONVEX_RESOURCE_OPTIONS: InjectionToken<Required<ConvexResourceOptions>>;
2542
+ declare function provideConvexResourceOptions(opts: Partial<ConvexResourceOptions>): Provider;
2543
+ type NoArgsQuery = QueryRef & {
2544
+ _args: Record<string, never>;
2545
+ };
2546
+ /** Overloads */
2547
+ declare function convexLiveResource<Q extends NoArgsQuery>(query: Q, opts?: ConvexResourceOptions): ResourceRef<FunctionReturnType<Q> | undefined>;
2548
+ declare function convexLiveResource<Q extends NoArgsQuery>(query: Q, params: () => {} | undefined, opts?: ConvexResourceOptions): ResourceRef<FunctionReturnType<Q> | undefined>;
2549
+ declare function convexLiveResource<Q extends QueryRef>(query: Q, params: () => Q['_args'] | undefined, opts?: ConvexResourceOptions): ResourceRef<FunctionReturnType<Q> | undefined>;
2550
+
2551
+ interface ConvexAngularOptions {
2552
+ /** Convex deployment URL, e.g. https://xxx.convex.cloud */
2553
+ convexUrl: string;
2554
+ /** Better Auth base URL (convex site url), e.g. https://xxx.convex.site */
2555
+ authBaseURL: string;
2556
+ /** Skew before JWT expiry to refresh token */
2557
+ authSkewMs?: number;
2558
+ /** Default keep mode for live resources ('last' | 'none') */
2559
+ keep?: KeepMode;
2560
+ /**
2561
+ * Optional: user-provided Better Auth client.
2562
+ * Must include convexClient() and crossDomainClient() plugins.
2563
+ */
2564
+ authClient?: AuthClient;
2565
+ }
2566
+ /**
2567
+ * Single entry-point provider to wire Convex + Better Auth + resource defaults.
2568
+ * Behavior:
2569
+ * - If opts.authClient is provided, we use it (and verify required plugins).
2570
+ * - Else we create a default Better Auth client using authBaseURL with required plugins.
2571
+ */
2572
+ declare function provideConvexAngular(opts: ConvexAngularOptions): Provider[];
2573
+
2574
+ /** Minimal surface this library relies on from Better Auth client */
2575
+ interface AuthClientRequired {
2576
+ convex: {
2577
+ token: () => Promise<{
2578
+ data?: {
2579
+ token?: string;
2580
+ } | null;
2581
+ }>;
2582
+ };
2583
+ crossDomain: {
2584
+ oneTimeToken: {
2585
+ verify: (args: {
2586
+ token: string;
2587
+ }) => Promise<{
2588
+ data?: {
2589
+ session?: {
2590
+ token?: string;
2591
+ };
2592
+ };
2593
+ }>;
2594
+ };
2595
+ };
2596
+ getSession: (o?: {
2597
+ fetchOptions?: RequestInit;
2598
+ }) => Promise<unknown>;
2599
+ updateSession: () => void;
2600
+ }
2601
+ interface ConvexBetterAuthOptions {
2602
+ /** Convex deployment URL, e.g. https://xxx.convex.cloud */
2603
+ convexUrl: string;
2604
+ /** Milliseconds before JWT expiry to refresh (default 45s in this provider) */
2605
+ authSkewMs?: number;
2606
+ authClient?: AuthClientRequired;
2607
+ }
2608
+ /**
2609
+ * Registers the Convex client in DI and connects it to Better Auth for JWT retrieval.
2610
+ * Consumers still need to provide the Better Auth HTTP client via provideAuthClient().
2611
+ */
2612
+ declare function provideConvexBetterAuth(opts: ConvexBetterAuthOptions): Provider[];
2613
+ /**
2614
+ * Optional environment initializer to handle OTT (?ott=...) once and upgrade to a cookie session.
2615
+ * Keep separate from main provider for explicit opt-in.
2616
+ */
2617
+ declare function provideBetterAuthOttBootstrap(): _angular_core.EnvironmentProviders;
2618
+
2619
+ type MutationRef = FunctionReference<'mutation'>;
2620
+ type NoArgsMutation = MutationRef & {
2621
+ _args: Record<string, never>;
2622
+ };
2623
+ type IfEmptyArgs$1<M extends MutationRef, TIfEmpty, TIfNot> = keyof M['_args'] extends never ? TIfEmpty : TIfNot;
2624
+ interface ConvexMutationOptions<M extends MutationRef> {
2625
+ optimisticUpdate?: OptimisticUpdate<FunctionArgs<M>>;
2626
+ onSuccess?: (data: FunctionReturnType<M>) => void;
2627
+ onError?: (err: Error) => void;
2628
+ /** concurrency: queue = sequential, drop = ignore while inflight, replace = prefer latest */
2629
+ mode?: 'queue' | 'drop' | 'replace';
2630
+ /** simple retry */
2631
+ retries?: number;
2632
+ retryDelayMs?: (attempt: number) => number;
2633
+ }
2634
+ type RunFn$1<M extends MutationRef> = IfEmptyArgs$1<M, (args?: FunctionArgs<M>) => Promise<FunctionReturnType<M>>, (args: FunctionArgs<M>) => Promise<FunctionReturnType<M>>>;
2635
+ interface ConvexMutationResource<M extends MutationRef> {
2636
+ /** imperative trigger */
2637
+ run: RunFn$1<M>;
2638
+ /** resource-shaped state (bind in templates if you like) */
2639
+ state: ResourceRef<FunctionReturnType<M> | undefined>;
2640
+ /** convenience signals */
2641
+ data: Signal<FunctionReturnType<M> | undefined>;
2642
+ error: Signal<Error | undefined>;
2643
+ isRunning: Signal<boolean>;
2644
+ reset(): void;
2645
+ }
2646
+ /** Overloads for nice run() arg ergonomics */
2647
+ declare function convexMutationResource<M extends NoArgsMutation>(mutation: M, opts?: ConvexMutationOptions<M>): ConvexMutationResource<M>;
2648
+ declare function convexMutationResource<M extends MutationRef>(mutation: M, opts?: ConvexMutationOptions<M>): ConvexMutationResource<M>;
2649
+
2650
+ type ActionRef = FunctionReference<'action'>;
2651
+ type NoArgsAction = ActionRef & {
2652
+ _args: Record<string, never>;
2653
+ };
2654
+ type IfEmptyArgs<A extends ActionRef, TIfEmpty, TIfNot> = keyof A['_args'] extends never ? TIfEmpty : TIfNot;
2655
+ interface ConvexActionOptions<A extends ActionRef> {
2656
+ onSuccess?: (data: FunctionReturnType<A>) => void;
2657
+ onError?: (err: Error) => void;
2658
+ /** concurrency: queue = sequential, drop = ignore while inflight, replace = prefer latest */
2659
+ mode?: 'queue' | 'drop' | 'replace';
2660
+ /** simple retry */
2661
+ retries?: number;
2662
+ retryDelayMs?: (attempt: number) => number;
2663
+ }
2664
+ type RunFn<A extends ActionRef> = IfEmptyArgs<A, (args?: FunctionArgs<A>) => Promise<FunctionReturnType<A>>, (args: FunctionArgs<A>) => Promise<FunctionReturnType<A>>>;
2665
+ interface ConvexActionResource<A extends ActionRef> {
2666
+ run: RunFn<A>;
2667
+ state: ResourceRef<FunctionReturnType<A> | undefined>;
2668
+ data: Signal<FunctionReturnType<A> | undefined>;
2669
+ error: Signal<Error | undefined>;
2670
+ isRunning: Signal<boolean>;
2671
+ reset(): void;
2672
+ }
2673
+ /** Overloads for nice run() arg ergonomics */
2674
+ declare function convexActionResource<A extends NoArgsAction>(action: A, opts?: ConvexActionOptions<A>): ConvexActionResource<A>;
2675
+ declare function convexActionResource<A extends ActionRef>(action: A, opts?: ConvexActionOptions<A>): ConvexActionResource<A>;
2676
+
2677
+ export { AUTH_CLIENT, CONVEX, CONVEX_RESOURCE_OPTIONS, ConvexAngularClient, convexActionResource, convexLiveResource, convexMutationResource, injectConvex, provideAuthClient, provideBetterAuthOttBootstrap, provideConvexAngular, provideConvexBetterAuth, provideConvexResourceOptions };
2678
+ export type { ActionRef, AuthClient, AuthSnapshot, ConvexActionOptions, ConvexActionResource, ConvexAngularOptions, ConvexBetterAuthOptions, ConvexMutationOptions, ConvexMutationResource, ConvexResourceOptions, FetchAccessToken, KeepMode, MutationRef, ProvideAuthClientOptions, QueryRef };