@choiceform/shared-auth 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/init.d.ts CHANGED
@@ -20,6 +20,11 @@ export declare function initAuth(config: {
20
20
  plugins?: AuthConfig["plugins"];
21
21
  /** @deprecated 建议在 ProtectedRoute 组件中通过 onUnauthorized 回调处理导航 */
22
22
  signInPath?: string;
23
+ /**
24
+ * 跳过错误时的 token 清除(开发环境用)
25
+ * 启用后,网络错误、解析错误等不会清除 token,避免开发时频繁登出
26
+ */
27
+ skipTokenCleanupOnError?: boolean;
23
28
  tokenStorageKey?: string;
24
29
  }): {
25
30
  getCurrentUser: () => import("./types").SessionUser | null;
@@ -63,76 +68,24 @@ export declare function initAuth(config: {
63
68
  };
64
69
  authClient: {
65
70
  signIn: {
66
- social: <FetchOptions extends {
67
- method?: string | undefined;
68
- headers?: (HeadersInit & (HeadersInit | {
69
- accept: "application/json" | "text/plain" | "application/octet-stream";
70
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
71
- authorization: "Bearer" | "Basic";
72
- })) | undefined;
73
- cache?: RequestCache | undefined;
74
- credentials?: RequestCredentials | undefined;
75
- integrity?: string | undefined;
76
- keepalive?: boolean | undefined;
77
- mode?: RequestMode | undefined;
78
- priority?: RequestPriority | undefined;
79
- redirect?: RequestRedirect | undefined;
80
- referrer?: string | undefined;
81
- referrerPolicy?: ReferrerPolicy | undefined;
82
- signal?: (AbortSignal | null) | undefined;
83
- window?: null | undefined;
84
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
85
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
86
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
87
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
88
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
89
- hookOptions?: {
90
- cloneResponse?: boolean;
71
+ social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
72
+ provider: unknown;
73
+ callbackURL?: string | undefined;
74
+ newUserCallbackURL?: string | undefined;
75
+ errorCallbackURL?: string | undefined;
76
+ disableRedirect?: boolean | undefined;
77
+ idToken?: {
78
+ token: string;
79
+ nonce?: string | undefined;
80
+ accessToken?: string | undefined;
81
+ refreshToken?: string | undefined;
82
+ expiresAt?: number | undefined;
91
83
  } | undefined;
92
- timeout?: number | undefined;
93
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
94
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
95
- baseURL?: string | undefined;
96
- throw?: boolean | undefined;
97
- auth?: ({
98
- type: "Bearer";
99
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
100
- } | {
101
- type: "Basic";
102
- username: string | (() => string | undefined) | undefined;
103
- password: string | (() => string | undefined) | undefined;
104
- } | {
105
- type: "Custom";
106
- prefix: string | (() => string | undefined) | undefined;
107
- value: string | (() => string | undefined) | undefined;
108
- }) | undefined;
109
- body?: (Partial<{
110
- provider: unknown;
111
- callbackURL?: string | undefined;
112
- newUserCallbackURL?: string | undefined;
113
- errorCallbackURL?: string | undefined;
114
- disableRedirect?: boolean | undefined;
115
- idToken?: {
116
- token: string;
117
- nonce?: string | undefined;
118
- accessToken?: string | undefined;
119
- refreshToken?: string | undefined;
120
- expiresAt?: number | undefined;
121
- } | undefined;
122
- scopes?: string[] | undefined;
123
- requestSignUp?: boolean | undefined;
124
- loginHint?: string | undefined;
125
- }> & Record<string, any>) | undefined;
126
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
127
- params?: Record<string, any> | undefined;
128
- duplex?: "full" | "half" | undefined;
129
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
130
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
131
- retryAttempt?: number | undefined;
132
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
133
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
134
- disableValidation?: boolean | undefined;
135
- }>(data_0: import("better-auth").Prettify<{
84
+ scopes?: string[] | undefined;
85
+ requestSignUp?: boolean | undefined;
86
+ loginHint?: string | undefined;
87
+ additionalData?: Record<string, any> | undefined;
88
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
136
89
  provider: unknown;
137
90
  callbackURL?: string | undefined;
138
91
  newUserCallbackURL?: string | undefined;
@@ -148,6 +101,7 @@ export declare function initAuth(config: {
148
101
  scopes?: string[] | undefined;
149
102
  requestSignUp?: boolean | undefined;
150
103
  loginHint?: string | undefined;
104
+ additionalData?: Record<string, any> | undefined;
151
105
  } & {
152
106
  fetchOptions?: FetchOptions | undefined;
153
107
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
@@ -167,141 +121,35 @@ export declare function initAuth(config: {
167
121
  url: string;
168
122
  redirect: boolean;
169
123
  }>, {
170
- code?: string;
171
- message?: string;
124
+ code?: string | undefined;
125
+ message?: string | undefined;
172
126
  }, FetchOptions["throw"] extends true ? true : false>>;
173
127
  };
174
128
  } & {
175
- signOut: <FetchOptions extends {
176
- method?: string | undefined;
177
- headers?: (HeadersInit & (HeadersInit | {
178
- accept: "application/json" | "text/plain" | "application/octet-stream";
179
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
180
- authorization: "Bearer" | "Basic";
181
- })) | undefined;
182
- cache?: RequestCache | undefined;
183
- credentials?: RequestCredentials | undefined;
184
- integrity?: string | undefined;
185
- keepalive?: boolean | undefined;
186
- mode?: RequestMode | undefined;
187
- priority?: RequestPriority | undefined;
188
- redirect?: RequestRedirect | undefined;
189
- referrer?: string | undefined;
190
- referrerPolicy?: ReferrerPolicy | undefined;
191
- signal?: (AbortSignal | null) | undefined;
192
- window?: null | undefined;
193
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
194
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
195
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
196
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
197
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
198
- hookOptions?: {
199
- cloneResponse?: boolean;
200
- } | undefined;
201
- timeout?: number | undefined;
202
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
203
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
204
- baseURL?: string | undefined;
205
- throw?: boolean | undefined;
206
- auth?: ({
207
- type: "Bearer";
208
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
209
- } | {
210
- type: "Basic";
211
- username: string | (() => string | undefined) | undefined;
212
- password: string | (() => string | undefined) | undefined;
213
- } | {
214
- type: "Custom";
215
- prefix: string | (() => string | undefined) | undefined;
216
- value: string | (() => string | undefined) | undefined;
217
- }) | undefined;
218
- body?: undefined;
219
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
220
- params?: Record<string, any> | undefined;
221
- duplex?: "full" | "half" | undefined;
222
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
223
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
224
- retryAttempt?: number | undefined;
225
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
226
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
227
- disableValidation?: boolean | undefined;
228
- }>(data_0?: import("better-auth").Prettify<{
129
+ signOut: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
229
130
  query?: Record<string, any> | undefined;
230
131
  fetchOptions?: FetchOptions | undefined;
231
132
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
232
133
  success: boolean;
233
134
  }, {
234
- code?: string;
235
- message?: string;
135
+ code?: string | undefined;
136
+ message?: string | undefined;
236
137
  }, FetchOptions["throw"] extends true ? true : false>>;
237
138
  } & {
238
139
  signUp: {
239
- email: <FetchOptions extends {
240
- method?: string | undefined;
241
- headers?: (HeadersInit & (HeadersInit | {
242
- accept: "application/json" | "text/plain" | "application/octet-stream";
243
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
244
- authorization: "Bearer" | "Basic";
245
- })) | undefined;
246
- cache?: RequestCache | undefined;
247
- credentials?: RequestCredentials | undefined;
248
- integrity?: string | undefined;
249
- keepalive?: boolean | undefined;
250
- mode?: RequestMode | undefined;
251
- priority?: RequestPriority | undefined;
252
- redirect?: RequestRedirect | undefined;
253
- referrer?: string | undefined;
254
- referrerPolicy?: ReferrerPolicy | undefined;
255
- signal?: (AbortSignal | null) | undefined;
256
- window?: null | undefined;
257
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
258
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
259
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
260
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
261
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
262
- hookOptions?: {
263
- cloneResponse?: boolean;
264
- } | undefined;
265
- timeout?: number | undefined;
266
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
267
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
268
- baseURL?: string | undefined;
269
- throw?: boolean | undefined;
270
- auth?: ({
271
- type: "Bearer";
272
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
273
- } | {
274
- type: "Basic";
275
- username: string | (() => string | undefined) | undefined;
276
- password: string | (() => string | undefined) | undefined;
277
- } | {
278
- type: "Custom";
279
- prefix: string | (() => string | undefined) | undefined;
280
- value: string | (() => string | undefined) | undefined;
281
- }) | undefined;
282
- body?: (Partial<{
283
- name: string;
284
- email: string;
285
- password: string;
286
- image?: string;
287
- callbackURL?: string;
288
- rememberMe?: boolean;
289
- }> & Record<string, any>) | undefined;
290
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
291
- params?: Record<string, any> | undefined;
292
- duplex?: "full" | "half" | undefined;
293
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
294
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
295
- retryAttempt?: number | undefined;
296
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
297
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
298
- disableValidation?: boolean | undefined;
299
- }>(data_0: import("better-auth").Prettify<{
140
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
141
+ name: string;
142
+ email: string;
143
+ password: string;
144
+ image?: string | undefined;
145
+ callbackURL?: string | undefined;
146
+ rememberMe?: boolean | undefined;
147
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
300
148
  email: string;
301
149
  name: string;
302
150
  password: string;
303
- image?: string;
304
- callbackURL?: string;
151
+ image?: string | undefined;
152
+ callbackURL?: string | undefined;
305
153
  fetchOptions?: FetchOptions | undefined;
306
154
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
307
155
  token: null;
@@ -326,71 +174,18 @@ export declare function initAuth(config: {
326
174
  updatedAt: Date;
327
175
  };
328
176
  }>, {
329
- code?: string;
330
- message?: string;
177
+ code?: string | undefined;
178
+ message?: string | undefined;
331
179
  }, FetchOptions["throw"] extends true ? true : false>>;
332
180
  };
333
181
  } & {
334
182
  signIn: {
335
- email: <FetchOptions extends {
336
- method?: string | undefined;
337
- headers?: (HeadersInit & (HeadersInit | {
338
- accept: "application/json" | "text/plain" | "application/octet-stream";
339
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
340
- authorization: "Bearer" | "Basic";
341
- })) | undefined;
342
- cache?: RequestCache | undefined;
343
- credentials?: RequestCredentials | undefined;
344
- integrity?: string | undefined;
345
- keepalive?: boolean | undefined;
346
- mode?: RequestMode | undefined;
347
- priority?: RequestPriority | undefined;
348
- redirect?: RequestRedirect | undefined;
349
- referrer?: string | undefined;
350
- referrerPolicy?: ReferrerPolicy | undefined;
351
- signal?: (AbortSignal | null) | undefined;
352
- window?: null | undefined;
353
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
354
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
355
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
356
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
357
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
358
- hookOptions?: {
359
- cloneResponse?: boolean;
360
- } | undefined;
361
- timeout?: number | undefined;
362
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
363
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
364
- baseURL?: string | undefined;
365
- throw?: boolean | undefined;
366
- auth?: ({
367
- type: "Bearer";
368
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
369
- } | {
370
- type: "Basic";
371
- username: string | (() => string | undefined) | undefined;
372
- password: string | (() => string | undefined) | undefined;
373
- } | {
374
- type: "Custom";
375
- prefix: string | (() => string | undefined) | undefined;
376
- value: string | (() => string | undefined) | undefined;
377
- }) | undefined;
378
- body?: (Partial<{
379
- email: string;
380
- password: string;
381
- callbackURL?: string | undefined;
382
- rememberMe?: boolean | undefined;
383
- }> & Record<string, any>) | undefined;
384
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
385
- params?: Record<string, any> | undefined;
386
- duplex?: "full" | "half" | undefined;
387
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
388
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
389
- retryAttempt?: number | undefined;
390
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
391
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
392
- disableValidation?: boolean | undefined;
393
- }>(data_0: import("better-auth").Prettify<{
183
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
184
+ email: string;
185
+ password: string;
186
+ callbackURL?: string | undefined;
187
+ rememberMe?: boolean | undefined;
188
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
394
189
  email: string;
395
190
  password: string;
396
191
  callbackURL?: string | undefined;
@@ -411,138 +206,17 @@ export declare function initAuth(config: {
411
206
  updatedAt: Date;
412
207
  };
413
208
  }, {
414
- code?: string;
415
- message?: string;
209
+ code?: string | undefined;
210
+ message?: string | undefined;
416
211
  }, FetchOptions["throw"] extends true ? true : false>>;
417
212
  };
418
213
  } & {
419
- forgetPassword: <FetchOptions extends {
420
- method?: string | undefined;
421
- headers?: (HeadersInit & (HeadersInit | {
422
- accept: "application/json" | "text/plain" | "application/octet-stream";
423
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
424
- authorization: "Bearer" | "Basic";
425
- })) | undefined;
426
- cache?: RequestCache | undefined;
427
- credentials?: RequestCredentials | undefined;
428
- integrity?: string | undefined;
429
- keepalive?: boolean | undefined;
430
- mode?: RequestMode | undefined;
431
- priority?: RequestPriority | undefined;
432
- redirect?: RequestRedirect | undefined;
433
- referrer?: string | undefined;
434
- referrerPolicy?: ReferrerPolicy | undefined;
435
- signal?: (AbortSignal | null) | undefined;
436
- window?: null | undefined;
437
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
438
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
439
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
440
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
441
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
442
- hookOptions?: {
443
- cloneResponse?: boolean;
444
- } | undefined;
445
- timeout?: number | undefined;
446
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
447
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
448
- baseURL?: string | undefined;
449
- throw?: boolean | undefined;
450
- auth?: ({
451
- type: "Bearer";
452
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
453
- } | {
454
- type: "Basic";
455
- username: string | (() => string | undefined) | undefined;
456
- password: string | (() => string | undefined) | undefined;
457
- } | {
458
- type: "Custom";
459
- prefix: string | (() => string | undefined) | undefined;
460
- value: string | (() => string | undefined) | undefined;
461
- }) | undefined;
462
- body?: (Partial<{
463
- email: string;
464
- redirectTo?: string | undefined;
465
- }> & Record<string, any>) | undefined;
466
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
467
- params?: Record<string, any> | undefined;
468
- duplex?: "full" | "half" | undefined;
469
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
470
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
471
- retryAttempt?: number | undefined;
472
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
473
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
474
- disableValidation?: boolean | undefined;
475
- }>(data_0: import("better-auth").Prettify<{
476
- email: string;
477
- redirectTo?: string | undefined;
478
- } & {
479
- fetchOptions?: FetchOptions | undefined;
480
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
481
- status: boolean;
482
- }, {
483
- code?: string;
484
- message?: string;
485
- }, FetchOptions["throw"] extends true ? true : false>>;
486
- } & {
487
- resetPassword: <FetchOptions extends {
488
- method?: string | undefined;
489
- headers?: (HeadersInit & (HeadersInit | {
490
- accept: "application/json" | "text/plain" | "application/octet-stream";
491
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
492
- authorization: "Bearer" | "Basic";
493
- })) | undefined;
494
- cache?: RequestCache | undefined;
495
- credentials?: RequestCredentials | undefined;
496
- integrity?: string | undefined;
497
- keepalive?: boolean | undefined;
498
- mode?: RequestMode | undefined;
499
- priority?: RequestPriority | undefined;
500
- redirect?: RequestRedirect | undefined;
501
- referrer?: string | undefined;
502
- referrerPolicy?: ReferrerPolicy | undefined;
503
- signal?: (AbortSignal | null) | undefined;
504
- window?: null | undefined;
505
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
506
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
507
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
508
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
509
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
510
- hookOptions?: {
511
- cloneResponse?: boolean;
512
- } | undefined;
513
- timeout?: number | undefined;
514
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
515
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
516
- baseURL?: string | undefined;
517
- throw?: boolean | undefined;
518
- auth?: ({
519
- type: "Bearer";
520
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
521
- } | {
522
- type: "Basic";
523
- username: string | (() => string | undefined) | undefined;
524
- password: string | (() => string | undefined) | undefined;
525
- } | {
526
- type: "Custom";
527
- prefix: string | (() => string | undefined) | undefined;
528
- value: string | (() => string | undefined) | undefined;
529
- }) | undefined;
530
- body?: (Partial<{
531
- newPassword: string;
532
- token?: string | undefined;
533
- }> & Record<string, any>) | undefined;
534
- query?: (Partial<{
535
- token?: string | undefined;
536
- }> & Record<string, any>) | undefined;
537
- params?: Record<string, any> | undefined;
538
- duplex?: "full" | "half" | undefined;
539
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
540
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
541
- retryAttempt?: number | undefined;
542
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
543
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
544
- disableValidation?: boolean | undefined;
545
- }>(data_0: import("better-auth").Prettify<{
214
+ resetPassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
215
+ newPassword: string;
216
+ token?: string | undefined;
217
+ }> & Record<string, any>, Partial<{
218
+ token?: string | undefined;
219
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
546
220
  newPassword: string;
547
221
  token?: string | undefined;
548
222
  } & {
@@ -550,67 +224,14 @@ export declare function initAuth(config: {
550
224
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
551
225
  status: boolean;
552
226
  }, {
553
- code?: string;
554
- message?: string;
227
+ code?: string | undefined;
228
+ message?: string | undefined;
555
229
  }, FetchOptions["throw"] extends true ? true : false>>;
556
230
  } & {
557
- verifyEmail: <FetchOptions extends {
558
- method?: string | undefined;
559
- headers?: (HeadersInit & (HeadersInit | {
560
- accept: "application/json" | "text/plain" | "application/octet-stream";
561
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
562
- authorization: "Bearer" | "Basic";
563
- })) | undefined;
564
- cache?: RequestCache | undefined;
565
- credentials?: RequestCredentials | undefined;
566
- integrity?: string | undefined;
567
- keepalive?: boolean | undefined;
568
- mode?: RequestMode | undefined;
569
- priority?: RequestPriority | undefined;
570
- redirect?: RequestRedirect | undefined;
571
- referrer?: string | undefined;
572
- referrerPolicy?: ReferrerPolicy | undefined;
573
- signal?: (AbortSignal | null) | undefined;
574
- window?: null | undefined;
575
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
576
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
577
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
578
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
579
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
580
- hookOptions?: {
581
- cloneResponse?: boolean;
582
- } | undefined;
583
- timeout?: number | undefined;
584
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
585
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
586
- baseURL?: string | undefined;
587
- throw?: boolean | undefined;
588
- auth?: ({
589
- type: "Bearer";
590
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
591
- } | {
592
- type: "Basic";
593
- username: string | (() => string | undefined) | undefined;
594
- password: string | (() => string | undefined) | undefined;
595
- } | {
596
- type: "Custom";
597
- prefix: string | (() => string | undefined) | undefined;
598
- value: string | (() => string | undefined) | undefined;
599
- }) | undefined;
600
- body?: undefined;
601
- query?: (Partial<{
602
- token: string;
603
- callbackURL?: string | undefined;
604
- }> & Record<string, any>) | undefined;
605
- params?: Record<string, any> | undefined;
606
- duplex?: "full" | "half" | undefined;
607
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
608
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
609
- retryAttempt?: number | undefined;
610
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
611
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
612
- disableValidation?: boolean | undefined;
613
- }>(data_0: import("better-auth").Prettify<{
231
+ verifyEmail: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
232
+ token: string;
233
+ callbackURL?: string | undefined;
234
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
614
235
  query: {
615
236
  token: string;
616
237
  callbackURL?: string | undefined;
@@ -618,6 +239,53 @@ export declare function initAuth(config: {
618
239
  fetchOptions?: FetchOptions | undefined;
619
240
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<void | {
620
241
  status: boolean;
242
+ }>, {
243
+ code?: string | undefined;
244
+ message?: string | undefined;
245
+ }, FetchOptions["throw"] extends true ? true : false>>;
246
+ } & {
247
+ sendVerificationEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
248
+ email: string;
249
+ callbackURL?: string | undefined;
250
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
251
+ email: string;
252
+ callbackURL?: string | undefined;
253
+ } & {
254
+ fetchOptions?: FetchOptions | undefined;
255
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
256
+ status: boolean;
257
+ }, {
258
+ code?: string | undefined;
259
+ message?: string | undefined;
260
+ }, FetchOptions["throw"] extends true ? true : false>>;
261
+ } & {
262
+ changeEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
263
+ newEmail: string;
264
+ callbackURL?: string | undefined;
265
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
266
+ newEmail: string;
267
+ callbackURL?: string | undefined;
268
+ } & {
269
+ fetchOptions?: FetchOptions | undefined;
270
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
271
+ status: boolean;
272
+ }, {
273
+ code?: string | undefined;
274
+ message?: string | undefined;
275
+ }, FetchOptions["throw"] extends true ? true : false>>;
276
+ } & {
277
+ changePassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
278
+ newPassword: string;
279
+ currentPassword: string;
280
+ revokeOtherSessions?: boolean | undefined;
281
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
282
+ newPassword: string;
283
+ currentPassword: string;
284
+ revokeOtherSessions?: boolean | undefined;
285
+ } & {
286
+ fetchOptions?: FetchOptions | undefined;
287
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
288
+ token: string | null;
621
289
  user: {
622
290
  id: string;
623
291
  email: string;
@@ -627,631 +295,79 @@ export declare function initAuth(config: {
627
295
  createdAt: Date;
628
296
  updatedAt: Date;
629
297
  };
630
- } | {
298
+ }, {
299
+ code?: string | undefined;
300
+ message?: string | undefined;
301
+ }, FetchOptions["throw"] extends true ? true : false>>;
302
+ } & {
303
+ updateUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<Partial<{}> & {
304
+ name?: string | undefined;
305
+ image?: string | undefined;
306
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
307
+ image?: (string | null) | undefined;
308
+ name?: string | undefined;
309
+ fetchOptions?: FetchOptions | undefined;
310
+ } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
631
311
  status: boolean;
632
- user: null;
633
- }>, {
634
- code?: string;
635
- message?: string;
312
+ }, {
313
+ code?: string | undefined;
314
+ message?: string | undefined;
636
315
  }, FetchOptions["throw"] extends true ? true : false>>;
637
316
  } & {
638
- sendVerificationEmail: <FetchOptions extends {
639
- method?: string | undefined;
640
- headers?: (HeadersInit & (HeadersInit | {
641
- accept: "application/json" | "text/plain" | "application/octet-stream";
642
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
643
- authorization: "Bearer" | "Basic";
644
- })) | undefined;
645
- cache?: RequestCache | undefined;
646
- credentials?: RequestCredentials | undefined;
647
- integrity?: string | undefined;
648
- keepalive?: boolean | undefined;
649
- mode?: RequestMode | undefined;
650
- priority?: RequestPriority | undefined;
651
- redirect?: RequestRedirect | undefined;
652
- referrer?: string | undefined;
653
- referrerPolicy?: ReferrerPolicy | undefined;
654
- signal?: (AbortSignal | null) | undefined;
655
- window?: null | undefined;
656
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
657
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
658
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
659
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
660
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
661
- hookOptions?: {
662
- cloneResponse?: boolean;
663
- } | undefined;
664
- timeout?: number | undefined;
665
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
666
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
667
- baseURL?: string | undefined;
668
- throw?: boolean | undefined;
669
- auth?: ({
670
- type: "Bearer";
671
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
672
- } | {
673
- type: "Basic";
674
- username: string | (() => string | undefined) | undefined;
675
- password: string | (() => string | undefined) | undefined;
676
- } | {
677
- type: "Custom";
678
- prefix: string | (() => string | undefined) | undefined;
679
- value: string | (() => string | undefined) | undefined;
680
- }) | undefined;
681
- body?: (Partial<{
682
- email: string;
683
- callbackURL?: string | undefined;
684
- }> & Record<string, any>) | undefined;
685
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
686
- params?: Record<string, any> | undefined;
687
- duplex?: "full" | "half" | undefined;
688
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
689
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
690
- retryAttempt?: number | undefined;
691
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
692
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
693
- disableValidation?: boolean | undefined;
694
- }>(data_0: import("better-auth").Prettify<{
695
- email: string;
696
- callbackURL?: string | undefined;
697
- } & {
698
- fetchOptions?: FetchOptions | undefined;
699
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
700
- status: boolean;
701
- }, {
702
- code?: string;
703
- message?: string;
704
- }, FetchOptions["throw"] extends true ? true : false>>;
705
- } & {
706
- changeEmail: <FetchOptions extends {
707
- method?: string | undefined;
708
- headers?: (HeadersInit & (HeadersInit | {
709
- accept: "application/json" | "text/plain" | "application/octet-stream";
710
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
711
- authorization: "Bearer" | "Basic";
712
- })) | undefined;
713
- cache?: RequestCache | undefined;
714
- credentials?: RequestCredentials | undefined;
715
- integrity?: string | undefined;
716
- keepalive?: boolean | undefined;
717
- mode?: RequestMode | undefined;
718
- priority?: RequestPriority | undefined;
719
- redirect?: RequestRedirect | undefined;
720
- referrer?: string | undefined;
721
- referrerPolicy?: ReferrerPolicy | undefined;
722
- signal?: (AbortSignal | null) | undefined;
723
- window?: null | undefined;
724
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
725
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
726
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
727
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
728
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
729
- hookOptions?: {
730
- cloneResponse?: boolean;
731
- } | undefined;
732
- timeout?: number | undefined;
733
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
734
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
735
- baseURL?: string | undefined;
736
- throw?: boolean | undefined;
737
- auth?: ({
738
- type: "Bearer";
739
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
740
- } | {
741
- type: "Basic";
742
- username: string | (() => string | undefined) | undefined;
743
- password: string | (() => string | undefined) | undefined;
744
- } | {
745
- type: "Custom";
746
- prefix: string | (() => string | undefined) | undefined;
747
- value: string | (() => string | undefined) | undefined;
748
- }) | undefined;
749
- body?: (Partial<{
750
- newEmail: string;
751
- callbackURL?: string | undefined;
752
- }> & Record<string, any>) | undefined;
753
- query?: (Partial<Record<string, any>> & 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?: import("@better-fetch/fetch").RetryOptions | undefined;
758
- retryAttempt?: number | undefined;
759
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
760
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
761
- disableValidation?: boolean | undefined;
762
- }>(data_0: import("better-auth").Prettify<{
763
- newEmail: string;
764
- callbackURL?: string | undefined;
765
- } & {
766
- fetchOptions?: FetchOptions | undefined;
767
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
768
- status: boolean;
769
- }, {
770
- code?: string;
771
- message?: string;
772
- }, FetchOptions["throw"] extends true ? true : false>>;
773
- } & {
774
- changePassword: <FetchOptions extends {
775
- method?: string | undefined;
776
- headers?: (HeadersInit & (HeadersInit | {
777
- accept: "application/json" | "text/plain" | "application/octet-stream";
778
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
779
- authorization: "Bearer" | "Basic";
780
- })) | undefined;
781
- cache?: RequestCache | undefined;
782
- credentials?: RequestCredentials | undefined;
783
- integrity?: string | undefined;
784
- keepalive?: boolean | 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: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
793
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
794
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
795
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
796
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
797
- hookOptions?: {
798
- cloneResponse?: boolean;
799
- } | undefined;
800
- timeout?: number | undefined;
801
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
802
- plugins?: import("@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?: (Partial<{
818
- newPassword: string;
819
- currentPassword: string;
820
- revokeOtherSessions?: boolean | undefined;
821
- }> & Record<string, any>) | undefined;
822
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
823
- params?: Record<string, any> | undefined;
824
- duplex?: "full" | "half" | undefined;
825
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
826
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
827
- retryAttempt?: number | undefined;
828
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
829
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
830
- disableValidation?: boolean | undefined;
831
- }>(data_0: import("better-auth").Prettify<{
832
- newPassword: string;
833
- currentPassword: string;
834
- revokeOtherSessions?: boolean | undefined;
835
- } & {
836
- fetchOptions?: FetchOptions | undefined;
837
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
838
- token: string | null;
839
- user: {
840
- id: string;
841
- email: string;
842
- name: string;
843
- image: string | null | undefined;
844
- emailVerified: boolean;
845
- createdAt: Date;
846
- updatedAt: Date;
847
- };
848
- }, {
849
- code?: string;
850
- message?: string;
851
- }, FetchOptions["throw"] extends true ? true : false>>;
852
- } & {
853
- updateUser: <FetchOptions extends {
854
- method?: string | undefined;
855
- headers?: (HeadersInit & (HeadersInit | {
856
- accept: "application/json" | "text/plain" | "application/octet-stream";
857
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
858
- authorization: "Bearer" | "Basic";
859
- })) | undefined;
860
- cache?: RequestCache | undefined;
861
- credentials?: RequestCredentials | undefined;
862
- integrity?: string | undefined;
863
- keepalive?: boolean | undefined;
864
- mode?: RequestMode | undefined;
865
- priority?: RequestPriority | undefined;
866
- redirect?: RequestRedirect | undefined;
867
- referrer?: string | undefined;
868
- referrerPolicy?: ReferrerPolicy | undefined;
869
- signal?: (AbortSignal | null) | undefined;
870
- window?: null | undefined;
871
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
872
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
873
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
874
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
875
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
876
- hookOptions?: {
877
- cloneResponse?: boolean;
878
- } | undefined;
879
- timeout?: number | undefined;
880
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
881
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
882
- baseURL?: string | undefined;
883
- throw?: boolean | undefined;
884
- auth?: ({
885
- type: "Bearer";
886
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
887
- } | {
888
- type: "Basic";
889
- username: string | (() => string | undefined) | undefined;
890
- password: string | (() => string | undefined) | undefined;
891
- } | {
892
- type: "Custom";
893
- prefix: string | (() => string | undefined) | undefined;
894
- value: string | (() => string | undefined) | undefined;
895
- }) | undefined;
896
- body?: (Partial<Partial<{}> & {
897
- name?: string;
898
- image?: string;
899
- }> & Record<string, any>) | undefined;
900
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
901
- params?: Record<string, any> | undefined;
902
- duplex?: "full" | "half" | undefined;
903
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
904
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
905
- retryAttempt?: number | undefined;
906
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
907
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
908
- disableValidation?: boolean | undefined;
909
- }>(data_0?: import("better-auth").Prettify<{
910
- image?: string | null;
911
- name?: string;
912
- fetchOptions?: FetchOptions | undefined;
913
- } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
914
- status: boolean;
915
- }, {
916
- code?: string;
917
- message?: string;
918
- }, FetchOptions["throw"] extends true ? true : false>>;
919
- } & {
920
- deleteUser: <FetchOptions extends {
921
- method?: string | undefined;
922
- headers?: (HeadersInit & (HeadersInit | {
923
- accept: "application/json" | "text/plain" | "application/octet-stream";
924
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
925
- authorization: "Bearer" | "Basic";
926
- })) | undefined;
927
- cache?: RequestCache | undefined;
928
- credentials?: RequestCredentials | undefined;
929
- integrity?: string | undefined;
930
- keepalive?: boolean | undefined;
931
- mode?: RequestMode | undefined;
932
- priority?: RequestPriority | undefined;
933
- redirect?: RequestRedirect | undefined;
934
- referrer?: string | undefined;
935
- referrerPolicy?: ReferrerPolicy | undefined;
936
- signal?: (AbortSignal | null) | undefined;
937
- window?: null | undefined;
938
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
939
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
940
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
941
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
942
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
943
- hookOptions?: {
944
- cloneResponse?: boolean;
945
- } | undefined;
946
- timeout?: number | undefined;
947
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
948
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
949
- baseURL?: string | undefined;
950
- throw?: boolean | undefined;
951
- auth?: ({
952
- type: "Bearer";
953
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
954
- } | {
955
- type: "Basic";
956
- username: string | (() => string | undefined) | undefined;
957
- password: string | (() => string | undefined) | undefined;
958
- } | {
959
- type: "Custom";
960
- prefix: string | (() => string | undefined) | undefined;
961
- value: string | (() => string | undefined) | undefined;
962
- }) | undefined;
963
- body?: (Partial<{
964
- callbackURL?: string | undefined;
965
- password?: string | undefined;
966
- token?: string | undefined;
967
- }> & Record<string, any>) | undefined;
968
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
969
- params?: Record<string, any> | undefined;
970
- duplex?: "full" | "half" | undefined;
971
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
972
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
973
- retryAttempt?: number | undefined;
974
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
975
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
976
- disableValidation?: boolean | undefined;
977
- }>(data_0?: import("better-auth").Prettify<{
317
+ deleteUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
978
318
  callbackURL?: string | undefined;
979
319
  password?: string | undefined;
980
320
  token?: string | undefined;
981
- } & {
982
- fetchOptions?: FetchOptions | undefined;
983
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
984
- success: boolean;
985
- message: string;
986
- }, {
987
- code?: string;
988
- message?: string;
989
- }, FetchOptions["throw"] extends true ? true : false>>;
990
- } & {
991
- resetPassword: {
992
- ":token": <FetchOptions extends {
993
- method?: string | 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
- cache?: RequestCache | undefined;
1000
- credentials?: RequestCredentials | undefined;
1001
- integrity?: string | undefined;
1002
- keepalive?: boolean | undefined;
1003
- mode?: RequestMode | undefined;
1004
- priority?: RequestPriority | undefined;
1005
- redirect?: RequestRedirect | undefined;
1006
- referrer?: string | undefined;
1007
- referrerPolicy?: ReferrerPolicy | undefined;
1008
- signal?: (AbortSignal | null) | undefined;
1009
- window?: null | undefined;
1010
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1011
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1012
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1013
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1014
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1015
- hookOptions?: {
1016
- cloneResponse?: boolean;
1017
- } | undefined;
1018
- timeout?: number | undefined;
1019
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1020
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1021
- baseURL?: string | undefined;
1022
- throw?: boolean | undefined;
1023
- auth?: ({
1024
- type: "Bearer";
1025
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1026
- } | {
1027
- type: "Basic";
1028
- username: string | (() => string | undefined) | undefined;
1029
- password: string | (() => string | undefined) | undefined;
1030
- } | {
1031
- type: "Custom";
1032
- prefix: string | (() => string | undefined) | undefined;
1033
- value: string | (() => string | undefined) | undefined;
1034
- }) | undefined;
1035
- body?: undefined;
1036
- query?: (Partial<{
1037
- callbackURL: string;
1038
- }> & Record<string, any>) | undefined;
1039
- params?: {
1040
- token: string;
1041
- } | undefined;
1042
- duplex?: "full" | "half" | undefined;
1043
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1044
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1045
- retryAttempt?: number | undefined;
1046
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1047
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1048
- disableValidation?: boolean | undefined;
1049
- }>(data_0: import("better-auth").Prettify<{
1050
- query: {
1051
- callbackURL: string;
1052
- };
1053
- fetchOptions?: FetchOptions | undefined;
1054
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<never, {
1055
- code?: string;
1056
- message?: string;
1057
- }, FetchOptions["throw"] extends true ? true : false>>;
1058
- };
1059
- } & {
1060
- requestPasswordReset: <FetchOptions extends {
1061
- method?: string | undefined;
1062
- headers?: (HeadersInit & (HeadersInit | {
1063
- accept: "application/json" | "text/plain" | "application/octet-stream";
1064
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1065
- authorization: "Bearer" | "Basic";
1066
- })) | undefined;
1067
- cache?: RequestCache | undefined;
1068
- credentials?: RequestCredentials | undefined;
1069
- integrity?: string | undefined;
1070
- keepalive?: boolean | undefined;
1071
- mode?: RequestMode | undefined;
1072
- priority?: RequestPriority | undefined;
1073
- redirect?: RequestRedirect | undefined;
1074
- referrer?: string | undefined;
1075
- referrerPolicy?: ReferrerPolicy | undefined;
1076
- signal?: (AbortSignal | null) | undefined;
1077
- window?: null | undefined;
1078
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1079
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1080
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1081
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1082
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1083
- hookOptions?: {
1084
- cloneResponse?: boolean;
1085
- } | undefined;
1086
- timeout?: number | undefined;
1087
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1088
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1089
- baseURL?: string | undefined;
1090
- throw?: boolean | undefined;
1091
- auth?: ({
1092
- type: "Bearer";
1093
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1094
- } | {
1095
- type: "Basic";
1096
- username: string | (() => string | undefined) | undefined;
1097
- password: string | (() => string | undefined) | undefined;
1098
- } | {
1099
- type: "Custom";
1100
- prefix: string | (() => string | undefined) | undefined;
1101
- value: string | (() => string | undefined) | undefined;
1102
- }) | undefined;
1103
- body?: (Partial<{
1104
- email: string;
1105
- redirectTo?: string | undefined;
1106
- }> & Record<string, any>) | undefined;
1107
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1108
- params?: Record<string, any> | undefined;
1109
- duplex?: "full" | "half" | undefined;
1110
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1111
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1112
- retryAttempt?: number | undefined;
1113
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1114
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1115
- disableValidation?: boolean | undefined;
1116
- }>(data_0: import("better-auth").Prettify<{
1117
- email: string;
1118
- redirectTo?: string | undefined;
1119
- } & {
1120
- fetchOptions?: FetchOptions | undefined;
1121
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1122
- status: boolean;
1123
- message: string;
1124
- }, {
1125
- code?: string;
1126
- message?: string;
1127
- }, FetchOptions["throw"] extends true ? true : false>>;
1128
- } & {
1129
- resetPassword: {
1130
- ":token": <FetchOptions extends {
1131
- method?: string | undefined;
1132
- headers?: (HeadersInit & (HeadersInit | {
1133
- accept: "application/json" | "text/plain" | "application/octet-stream";
1134
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1135
- authorization: "Bearer" | "Basic";
1136
- })) | undefined;
1137
- cache?: RequestCache | undefined;
1138
- credentials?: RequestCredentials | undefined;
1139
- integrity?: string | undefined;
1140
- keepalive?: boolean | undefined;
1141
- mode?: RequestMode | undefined;
1142
- priority?: RequestPriority | undefined;
1143
- redirect?: RequestRedirect | undefined;
1144
- referrer?: string | undefined;
1145
- referrerPolicy?: ReferrerPolicy | undefined;
1146
- signal?: (AbortSignal | null) | undefined;
1147
- window?: null | undefined;
1148
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1149
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1150
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1151
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1152
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1153
- hookOptions?: {
1154
- cloneResponse?: boolean;
1155
- } | undefined;
1156
- timeout?: number | undefined;
1157
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1158
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1159
- baseURL?: string | undefined;
1160
- throw?: boolean | undefined;
1161
- auth?: ({
1162
- type: "Bearer";
1163
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1164
- } | {
1165
- type: "Basic";
1166
- username: string | (() => string | undefined) | undefined;
1167
- password: string | (() => string | undefined) | undefined;
1168
- } | {
1169
- type: "Custom";
1170
- prefix: string | (() => string | undefined) | undefined;
1171
- value: string | (() => string | undefined) | undefined;
1172
- }) | undefined;
1173
- body?: undefined;
1174
- query?: (Partial<{
1175
- callbackURL: string;
1176
- }> & Record<string, any>) | undefined;
1177
- params?: {
1178
- token: string;
1179
- } | undefined;
1180
- duplex?: "full" | "half" | undefined;
1181
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1182
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1183
- retryAttempt?: number | undefined;
1184
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1185
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1186
- disableValidation?: boolean | undefined;
1187
- }>(data_0: import("better-auth").Prettify<{
1188
- query: {
1189
- callbackURL: string;
1190
- };
1191
- fetchOptions?: FetchOptions | undefined;
1192
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<never, {
1193
- code?: string;
1194
- message?: string;
1195
- }, FetchOptions["throw"] extends true ? true : false>>;
1196
- };
1197
- } & {
1198
- listSessions: <FetchOptions extends {
1199
- method?: string | undefined;
1200
- headers?: (HeadersInit & (HeadersInit | {
1201
- accept: "application/json" | "text/plain" | "application/octet-stream";
1202
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1203
- authorization: "Bearer" | "Basic";
1204
- })) | undefined;
1205
- cache?: RequestCache | undefined;
1206
- credentials?: RequestCredentials | undefined;
1207
- integrity?: string | undefined;
1208
- keepalive?: boolean | undefined;
1209
- mode?: RequestMode | undefined;
1210
- priority?: RequestPriority | undefined;
1211
- redirect?: RequestRedirect | undefined;
1212
- referrer?: string | undefined;
1213
- referrerPolicy?: ReferrerPolicy | undefined;
1214
- signal?: (AbortSignal | null) | undefined;
1215
- window?: null | undefined;
1216
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1217
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1218
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1219
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1220
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1221
- hookOptions?: {
1222
- cloneResponse?: boolean;
1223
- } | undefined;
1224
- timeout?: number | undefined;
1225
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1226
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1227
- baseURL?: string | undefined;
1228
- throw?: boolean | undefined;
1229
- auth?: ({
1230
- type: "Bearer";
1231
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1232
- } | {
1233
- type: "Basic";
1234
- username: string | (() => string | undefined) | undefined;
1235
- password: string | (() => string | undefined) | undefined;
1236
- } | {
1237
- type: "Custom";
1238
- prefix: string | (() => string | undefined) | undefined;
1239
- value: string | (() => string | undefined) | undefined;
1240
- }) | undefined;
1241
- body?: undefined;
1242
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1243
- params?: Record<string, any> | undefined;
1244
- duplex?: "full" | "half" | undefined;
1245
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1246
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1247
- retryAttempt?: number | undefined;
1248
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1249
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1250
- disableValidation?: boolean | undefined;
1251
- }>(data_0?: import("better-auth").Prettify<{
321
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
322
+ callbackURL?: string | undefined;
323
+ password?: string | undefined;
324
+ token?: string | undefined;
325
+ } & {
326
+ fetchOptions?: FetchOptions | undefined;
327
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
328
+ success: boolean;
329
+ message: string;
330
+ }, {
331
+ code?: string | undefined;
332
+ message?: string | undefined;
333
+ }, FetchOptions["throw"] extends true ? true : false>>;
334
+ } & {
335
+ requestPasswordReset: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
336
+ email: string;
337
+ redirectTo?: string | undefined;
338
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
339
+ email: string;
340
+ redirectTo?: string | undefined;
341
+ } & {
342
+ fetchOptions?: FetchOptions | undefined;
343
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
344
+ status: boolean;
345
+ message: string;
346
+ }, {
347
+ code?: string | undefined;
348
+ message?: string | undefined;
349
+ }, FetchOptions["throw"] extends true ? true : false>>;
350
+ } & {
351
+ resetPassword: {
352
+ ":token": <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
353
+ callbackURL: string;
354
+ }> & Record<string, any>, {
355
+ token: string;
356
+ }>>(data_0: import("better-auth/client/plugins").Prettify<{
357
+ query: {
358
+ callbackURL: string;
359
+ };
360
+ fetchOptions?: FetchOptions | undefined;
361
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<never, {
362
+ code?: string | undefined;
363
+ message?: string | undefined;
364
+ }, FetchOptions["throw"] extends true ? true : false>>;
365
+ };
366
+ } & {
367
+ listSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
1252
368
  query?: Record<string, any> | undefined;
1253
369
  fetchOptions?: FetchOptions | undefined;
1254
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("better-auth").Prettify<{
370
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("better-auth/client/plugins").Prettify<{
1255
371
  id: string;
1256
372
  createdAt: Date;
1257
373
  updatedAt: Date;
@@ -1261,270 +377,44 @@ export declare function initAuth(config: {
1261
377
  ipAddress?: string | null | undefined | undefined;
1262
378
  userAgent?: string | null | undefined | undefined;
1263
379
  }>[], {
1264
- code?: string;
1265
- message?: string;
380
+ code?: string | undefined;
381
+ message?: string | undefined;
1266
382
  }, FetchOptions["throw"] extends true ? true : false>>;
1267
383
  } & {
1268
- revokeSession: <FetchOptions extends {
1269
- method?: string | undefined;
1270
- headers?: (HeadersInit & (HeadersInit | {
1271
- accept: "application/json" | "text/plain" | "application/octet-stream";
1272
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1273
- authorization: "Bearer" | "Basic";
1274
- })) | undefined;
1275
- cache?: RequestCache | undefined;
1276
- credentials?: RequestCredentials | undefined;
1277
- integrity?: string | undefined;
1278
- keepalive?: boolean | undefined;
1279
- mode?: RequestMode | undefined;
1280
- priority?: RequestPriority | undefined;
1281
- redirect?: RequestRedirect | undefined;
1282
- referrer?: string | undefined;
1283
- referrerPolicy?: ReferrerPolicy | undefined;
1284
- signal?: (AbortSignal | null) | undefined;
1285
- window?: null | undefined;
1286
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1287
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1288
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1289
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1290
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1291
- hookOptions?: {
1292
- cloneResponse?: boolean;
1293
- } | undefined;
1294
- timeout?: number | undefined;
1295
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1296
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1297
- baseURL?: string | undefined;
1298
- throw?: boolean | undefined;
1299
- auth?: ({
1300
- type: "Bearer";
1301
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1302
- } | {
1303
- type: "Basic";
1304
- username: string | (() => string | undefined) | undefined;
1305
- password: string | (() => string | undefined) | undefined;
1306
- } | {
1307
- type: "Custom";
1308
- prefix: string | (() => string | undefined) | undefined;
1309
- value: string | (() => string | undefined) | undefined;
1310
- }) | undefined;
1311
- body?: (Partial<{
1312
- token: string;
1313
- }> & Record<string, any>) | undefined;
1314
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1315
- params?: Record<string, any> | undefined;
1316
- duplex?: "full" | "half" | undefined;
1317
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1318
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1319
- retryAttempt?: number | undefined;
1320
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1321
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1322
- disableValidation?: boolean | undefined;
1323
- }>(data_0: import("better-auth").Prettify<{
384
+ revokeSession: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
385
+ token: string;
386
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
1324
387
  token: string;
1325
388
  } & {
1326
389
  fetchOptions?: FetchOptions | undefined;
1327
390
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1328
391
  status: boolean;
1329
392
  }, {
1330
- code?: string;
1331
- message?: string;
393
+ code?: string | undefined;
394
+ message?: string | undefined;
1332
395
  }, FetchOptions["throw"] extends true ? true : false>>;
1333
396
  } & {
1334
- revokeSessions: <FetchOptions extends {
1335
- method?: string | undefined;
1336
- headers?: (HeadersInit & (HeadersInit | {
1337
- accept: "application/json" | "text/plain" | "application/octet-stream";
1338
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1339
- authorization: "Bearer" | "Basic";
1340
- })) | undefined;
1341
- cache?: RequestCache | undefined;
1342
- credentials?: RequestCredentials | undefined;
1343
- integrity?: string | undefined;
1344
- keepalive?: boolean | undefined;
1345
- mode?: RequestMode | undefined;
1346
- priority?: RequestPriority | undefined;
1347
- redirect?: RequestRedirect | undefined;
1348
- referrer?: string | undefined;
1349
- referrerPolicy?: ReferrerPolicy | undefined;
1350
- signal?: (AbortSignal | null) | undefined;
1351
- window?: null | undefined;
1352
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1353
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1354
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1355
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1356
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1357
- hookOptions?: {
1358
- cloneResponse?: boolean;
1359
- } | undefined;
1360
- timeout?: number | undefined;
1361
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1362
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1363
- baseURL?: string | undefined;
1364
- throw?: boolean | undefined;
1365
- auth?: ({
1366
- type: "Bearer";
1367
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1368
- } | {
1369
- type: "Basic";
1370
- username: string | (() => string | undefined) | undefined;
1371
- password: string | (() => string | undefined) | undefined;
1372
- } | {
1373
- type: "Custom";
1374
- prefix: string | (() => string | undefined) | undefined;
1375
- value: string | (() => string | undefined) | undefined;
1376
- }) | undefined;
1377
- body?: undefined;
1378
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1379
- params?: Record<string, any> | undefined;
1380
- duplex?: "full" | "half" | undefined;
1381
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1382
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1383
- retryAttempt?: number | undefined;
1384
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1385
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1386
- disableValidation?: boolean | undefined;
1387
- }>(data_0?: import("better-auth").Prettify<{
397
+ revokeSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
1388
398
  query?: Record<string, any> | undefined;
1389
399
  fetchOptions?: FetchOptions | undefined;
1390
400
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1391
401
  status: boolean;
1392
402
  }, {
1393
- code?: string;
1394
- message?: string;
403
+ code?: string | undefined;
404
+ message?: string | undefined;
1395
405
  }, FetchOptions["throw"] extends true ? true : false>>;
1396
406
  } & {
1397
- revokeOtherSessions: <FetchOptions extends {
1398
- method?: string | undefined;
1399
- headers?: (HeadersInit & (HeadersInit | {
1400
- accept: "application/json" | "text/plain" | "application/octet-stream";
1401
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1402
- authorization: "Bearer" | "Basic";
1403
- })) | undefined;
1404
- cache?: RequestCache | undefined;
1405
- credentials?: RequestCredentials | undefined;
1406
- integrity?: string | undefined;
1407
- keepalive?: boolean | undefined;
1408
- mode?: RequestMode | undefined;
1409
- priority?: RequestPriority | undefined;
1410
- redirect?: RequestRedirect | undefined;
1411
- referrer?: string | undefined;
1412
- referrerPolicy?: ReferrerPolicy | undefined;
1413
- signal?: (AbortSignal | null) | undefined;
1414
- window?: null | undefined;
1415
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1416
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1417
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1418
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1419
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1420
- hookOptions?: {
1421
- cloneResponse?: boolean;
1422
- } | undefined;
1423
- timeout?: number | undefined;
1424
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1425
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1426
- baseURL?: string | undefined;
1427
- throw?: boolean | undefined;
1428
- auth?: ({
1429
- type: "Bearer";
1430
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1431
- } | {
1432
- type: "Basic";
1433
- username: string | (() => string | undefined) | undefined;
1434
- password: string | (() => string | undefined) | undefined;
1435
- } | {
1436
- type: "Custom";
1437
- prefix: string | (() => string | undefined) | undefined;
1438
- value: string | (() => string | undefined) | undefined;
1439
- }) | undefined;
1440
- body?: undefined;
1441
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1442
- params?: Record<string, any> | undefined;
1443
- duplex?: "full" | "half" | undefined;
1444
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1445
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1446
- retryAttempt?: number | undefined;
1447
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1448
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1449
- disableValidation?: boolean | undefined;
1450
- }>(data_0?: import("better-auth").Prettify<{
407
+ revokeOtherSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
1451
408
  query?: Record<string, any> | undefined;
1452
409
  fetchOptions?: FetchOptions | undefined;
1453
410
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1454
411
  status: boolean;
1455
412
  }, {
1456
- code?: string;
1457
- message?: string;
413
+ code?: string | undefined;
414
+ message?: string | undefined;
1458
415
  }, FetchOptions["throw"] extends true ? true : false>>;
1459
416
  } & {
1460
- linkSocial: <FetchOptions extends {
1461
- method?: string | undefined;
1462
- headers?: (HeadersInit & (HeadersInit | {
1463
- accept: "application/json" | "text/plain" | "application/octet-stream";
1464
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1465
- authorization: "Bearer" | "Basic";
1466
- })) | undefined;
1467
- cache?: RequestCache | undefined;
1468
- credentials?: RequestCredentials | undefined;
1469
- integrity?: string | undefined;
1470
- keepalive?: boolean | undefined;
1471
- mode?: RequestMode | undefined;
1472
- priority?: RequestPriority | undefined;
1473
- redirect?: RequestRedirect | undefined;
1474
- referrer?: string | undefined;
1475
- referrerPolicy?: ReferrerPolicy | undefined;
1476
- signal?: (AbortSignal | null) | undefined;
1477
- window?: null | undefined;
1478
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1479
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1480
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1481
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1482
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1483
- hookOptions?: {
1484
- cloneResponse?: boolean;
1485
- } | undefined;
1486
- timeout?: number | undefined;
1487
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1488
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1489
- baseURL?: string | undefined;
1490
- throw?: boolean | undefined;
1491
- auth?: ({
1492
- type: "Bearer";
1493
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1494
- } | {
1495
- type: "Basic";
1496
- username: string | (() => string | undefined) | undefined;
1497
- password: string | (() => string | undefined) | undefined;
1498
- } | {
1499
- type: "Custom";
1500
- prefix: string | (() => string | undefined) | undefined;
1501
- value: string | (() => string | undefined) | undefined;
1502
- }) | undefined;
1503
- body?: (Partial<{
1504
- provider: unknown;
1505
- callbackURL?: string | undefined;
1506
- idToken?: {
1507
- token: string;
1508
- nonce?: string | undefined;
1509
- accessToken?: string | undefined;
1510
- refreshToken?: string | undefined;
1511
- scopes?: string[] | undefined;
1512
- } | undefined;
1513
- requestSignUp?: boolean | undefined;
1514
- scopes?: string[] | undefined;
1515
- errorCallbackURL?: string | undefined;
1516
- disableRedirect?: boolean | undefined;
1517
- }> & Record<string, any>) | undefined;
1518
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1519
- params?: Record<string, any> | undefined;
1520
- duplex?: "full" | "half" | undefined;
1521
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1522
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1523
- retryAttempt?: number | undefined;
1524
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1525
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1526
- disableValidation?: boolean | undefined;
1527
- }>(data_0: import("better-auth").Prettify<{
417
+ linkSocial: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1528
418
  provider: unknown;
1529
419
  callbackURL?: string | undefined;
1530
420
  idToken?: {
@@ -1538,70 +428,33 @@ export declare function initAuth(config: {
1538
428
  scopes?: string[] | undefined;
1539
429
  errorCallbackURL?: string | undefined;
1540
430
  disableRedirect?: boolean | undefined;
1541
- } & {
1542
- fetchOptions?: FetchOptions | undefined;
1543
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1544
- url: string;
1545
- redirect: boolean;
1546
- }, {
1547
- code?: string;
1548
- message?: string;
1549
- }, FetchOptions["throw"] extends true ? true : false>>;
1550
- } & {
1551
- listAccounts: <FetchOptions extends {
1552
- method?: string | undefined;
1553
- headers?: (HeadersInit & (HeadersInit | {
1554
- accept: "application/json" | "text/plain" | "application/octet-stream";
1555
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1556
- authorization: "Bearer" | "Basic";
1557
- })) | undefined;
1558
- cache?: RequestCache | undefined;
1559
- credentials?: RequestCredentials | undefined;
1560
- integrity?: string | undefined;
1561
- keepalive?: boolean | undefined;
1562
- mode?: RequestMode | undefined;
1563
- priority?: RequestPriority | undefined;
1564
- redirect?: RequestRedirect | undefined;
1565
- referrer?: string | undefined;
1566
- referrerPolicy?: ReferrerPolicy | undefined;
1567
- signal?: (AbortSignal | null) | undefined;
1568
- window?: null | undefined;
1569
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1570
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1571
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1572
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1573
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1574
- hookOptions?: {
1575
- cloneResponse?: boolean;
1576
- } | undefined;
1577
- timeout?: number | undefined;
1578
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1579
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1580
- baseURL?: string | undefined;
1581
- throw?: boolean | undefined;
1582
- auth?: ({
1583
- type: "Bearer";
1584
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1585
- } | {
1586
- type: "Basic";
1587
- username: string | (() => string | undefined) | undefined;
1588
- password: string | (() => string | undefined) | undefined;
1589
- } | {
1590
- type: "Custom";
1591
- prefix: string | (() => string | undefined) | undefined;
1592
- value: string | (() => string | undefined) | undefined;
1593
- }) | undefined;
1594
- body?: undefined;
1595
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1596
- params?: Record<string, any> | undefined;
1597
- duplex?: "full" | "half" | undefined;
1598
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1599
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1600
- retryAttempt?: number | undefined;
1601
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1602
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1603
- disableValidation?: boolean | undefined;
1604
- }>(data_0?: import("better-auth").Prettify<{
431
+ additionalData?: Record<string, any> | undefined;
432
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
433
+ provider: unknown;
434
+ callbackURL?: string | undefined;
435
+ idToken?: {
436
+ token: string;
437
+ nonce?: string | undefined;
438
+ accessToken?: string | undefined;
439
+ refreshToken?: string | undefined;
440
+ scopes?: string[] | undefined;
441
+ } | undefined;
442
+ requestSignUp?: boolean | undefined;
443
+ scopes?: string[] | undefined;
444
+ errorCallbackURL?: string | undefined;
445
+ disableRedirect?: boolean | undefined;
446
+ additionalData?: Record<string, any> | undefined;
447
+ } & {
448
+ fetchOptions?: FetchOptions | undefined;
449
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
450
+ url: string;
451
+ redirect: boolean;
452
+ }, {
453
+ code?: string | undefined;
454
+ message?: string | undefined;
455
+ }, FetchOptions["throw"] extends true ? true : false>>;
456
+ } & {
457
+ listAccounts: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
1605
458
  query?: Record<string, any> | undefined;
1606
459
  fetchOptions?: FetchOptions | undefined;
1607
460
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
@@ -1610,70 +463,18 @@ export declare function initAuth(config: {
1610
463
  createdAt: Date;
1611
464
  updatedAt: Date;
1612
465
  accountId: string;
466
+ userId: string;
1613
467
  scopes: string[];
1614
468
  }[], {
1615
- code?: string;
1616
- message?: string;
469
+ code?: string | undefined;
470
+ message?: string | undefined;
1617
471
  }, FetchOptions["throw"] extends true ? true : false>>;
1618
472
  } & {
1619
473
  deleteUser: {
1620
- callback: <FetchOptions extends {
1621
- method?: string | undefined;
1622
- headers?: (HeadersInit & (HeadersInit | {
1623
- accept: "application/json" | "text/plain" | "application/octet-stream";
1624
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1625
- authorization: "Bearer" | "Basic";
1626
- })) | undefined;
1627
- cache?: RequestCache | undefined;
1628
- credentials?: RequestCredentials | undefined;
1629
- integrity?: string | undefined;
1630
- keepalive?: boolean | undefined;
1631
- mode?: RequestMode | undefined;
1632
- priority?: RequestPriority | undefined;
1633
- redirect?: RequestRedirect | undefined;
1634
- referrer?: string | undefined;
1635
- referrerPolicy?: ReferrerPolicy | undefined;
1636
- signal?: (AbortSignal | null) | undefined;
1637
- window?: null | undefined;
1638
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1639
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1640
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1641
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1642
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1643
- hookOptions?: {
1644
- cloneResponse?: boolean;
1645
- } | undefined;
1646
- timeout?: number | undefined;
1647
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1648
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1649
- baseURL?: string | undefined;
1650
- throw?: boolean | undefined;
1651
- auth?: ({
1652
- type: "Bearer";
1653
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1654
- } | {
1655
- type: "Basic";
1656
- username: string | (() => string | undefined) | undefined;
1657
- password: string | (() => string | undefined) | undefined;
1658
- } | {
1659
- type: "Custom";
1660
- prefix: string | (() => string | undefined) | undefined;
1661
- value: string | (() => string | undefined) | undefined;
1662
- }) | undefined;
1663
- body?: undefined;
1664
- query?: (Partial<{
1665
- token: string;
1666
- callbackURL?: string | undefined;
1667
- }> & Record<string, any>) | undefined;
1668
- params?: Record<string, any> | undefined;
1669
- duplex?: "full" | "half" | undefined;
1670
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1671
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1672
- retryAttempt?: number | undefined;
1673
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1674
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1675
- disableValidation?: boolean | undefined;
1676
- }>(data_0: import("better-auth").Prettify<{
474
+ callback: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
475
+ token: string;
476
+ callbackURL?: string | undefined;
477
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
1677
478
  query: {
1678
479
  token: string;
1679
480
  callbackURL?: string | undefined;
@@ -1683,68 +484,15 @@ export declare function initAuth(config: {
1683
484
  success: boolean;
1684
485
  message: string;
1685
486
  }, {
1686
- code?: string;
1687
- message?: string;
487
+ code?: string | undefined;
488
+ message?: string | undefined;
1688
489
  }, FetchOptions["throw"] extends true ? true : false>>;
1689
490
  };
1690
491
  } & {
1691
- unlinkAccount: <FetchOptions extends {
1692
- method?: string | undefined;
1693
- headers?: (HeadersInit & (HeadersInit | {
1694
- accept: "application/json" | "text/plain" | "application/octet-stream";
1695
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1696
- authorization: "Bearer" | "Basic";
1697
- })) | undefined;
1698
- cache?: RequestCache | undefined;
1699
- credentials?: RequestCredentials | undefined;
1700
- integrity?: string | undefined;
1701
- keepalive?: boolean | undefined;
1702
- mode?: RequestMode | undefined;
1703
- priority?: RequestPriority | undefined;
1704
- redirect?: RequestRedirect | undefined;
1705
- referrer?: string | undefined;
1706
- referrerPolicy?: ReferrerPolicy | undefined;
1707
- signal?: (AbortSignal | null) | undefined;
1708
- window?: null | undefined;
1709
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1710
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1711
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1712
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1713
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1714
- hookOptions?: {
1715
- cloneResponse?: boolean;
1716
- } | undefined;
1717
- timeout?: number | undefined;
1718
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1719
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1720
- baseURL?: string | undefined;
1721
- throw?: boolean | undefined;
1722
- auth?: ({
1723
- type: "Bearer";
1724
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1725
- } | {
1726
- type: "Basic";
1727
- username: string | (() => string | undefined) | undefined;
1728
- password: string | (() => string | undefined) | undefined;
1729
- } | {
1730
- type: "Custom";
1731
- prefix: string | (() => string | undefined) | undefined;
1732
- value: string | (() => string | undefined) | undefined;
1733
- }) | undefined;
1734
- body?: (Partial<{
1735
- providerId: string;
1736
- accountId?: string | undefined;
1737
- }> & Record<string, any>) | undefined;
1738
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1739
- params?: Record<string, any> | undefined;
1740
- duplex?: "full" | "half" | undefined;
1741
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1742
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1743
- retryAttempt?: number | undefined;
1744
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1745
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1746
- disableValidation?: boolean | undefined;
1747
- }>(data_0: import("better-auth").Prettify<{
492
+ unlinkAccount: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
493
+ providerId: string;
494
+ accountId?: string | undefined;
495
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
1748
496
  providerId: string;
1749
497
  accountId?: string | undefined;
1750
498
  } & {
@@ -1752,136 +500,39 @@ export declare function initAuth(config: {
1752
500
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1753
501
  status: boolean;
1754
502
  }, {
1755
- code?: string;
1756
- message?: string;
503
+ code?: string | undefined;
504
+ message?: string | undefined;
1757
505
  }, FetchOptions["throw"] extends true ? true : false>>;
1758
506
  } & {
1759
- refreshToken: <FetchOptions extends {
1760
- method?: string | undefined;
1761
- headers?: (HeadersInit & (HeadersInit | {
1762
- accept: "application/json" | "text/plain" | "application/octet-stream";
1763
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1764
- authorization: "Bearer" | "Basic";
1765
- })) | undefined;
1766
- cache?: RequestCache | undefined;
1767
- credentials?: RequestCredentials | undefined;
1768
- integrity?: string | undefined;
1769
- keepalive?: boolean | undefined;
1770
- mode?: RequestMode | undefined;
1771
- priority?: RequestPriority | undefined;
1772
- redirect?: RequestRedirect | undefined;
1773
- referrer?: string | undefined;
1774
- referrerPolicy?: ReferrerPolicy | undefined;
1775
- signal?: (AbortSignal | null) | undefined;
1776
- window?: null | undefined;
1777
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1778
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1779
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1780
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1781
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1782
- hookOptions?: {
1783
- cloneResponse?: boolean;
1784
- } | undefined;
1785
- timeout?: number | undefined;
1786
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1787
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1788
- baseURL?: string | undefined;
1789
- throw?: boolean | undefined;
1790
- auth?: ({
1791
- type: "Bearer";
1792
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1793
- } | {
1794
- type: "Basic";
1795
- username: string | (() => string | undefined) | undefined;
1796
- password: string | (() => string | undefined) | undefined;
1797
- } | {
1798
- type: "Custom";
1799
- prefix: string | (() => string | undefined) | undefined;
1800
- value: string | (() => string | undefined) | undefined;
1801
- }) | undefined;
1802
- body?: (Partial<{
1803
- providerId: string;
1804
- accountId?: string | undefined;
1805
- userId?: string | undefined;
1806
- }> & Record<string, any>) | undefined;
1807
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1808
- params?: Record<string, any> | undefined;
1809
- duplex?: "full" | "half" | undefined;
1810
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1811
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1812
- retryAttempt?: number | undefined;
1813
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1814
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1815
- disableValidation?: boolean | undefined;
1816
- }>(data_0: import("better-auth").Prettify<{
507
+ refreshToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
508
+ providerId: string;
509
+ accountId?: string | undefined;
510
+ userId?: string | undefined;
511
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
1817
512
  providerId: string;
1818
513
  accountId?: string | undefined;
1819
514
  userId?: string | undefined;
1820
515
  } & {
1821
516
  fetchOptions?: FetchOptions | undefined;
1822
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<any, {
1823
- code?: string;
1824
- message?: string;
517
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
518
+ accessToken: string | undefined;
519
+ refreshToken: string | undefined;
520
+ accessTokenExpiresAt: Date | undefined;
521
+ refreshTokenExpiresAt: Date | undefined;
522
+ scope: string | null | undefined;
523
+ idToken: string | null | undefined;
524
+ providerId: string;
525
+ accountId: string;
526
+ }, {
527
+ code?: string | undefined;
528
+ message?: string | undefined;
1825
529
  }, FetchOptions["throw"] extends true ? true : false>>;
1826
530
  } & {
1827
- getAccessToken: <FetchOptions extends {
1828
- method?: string | undefined;
1829
- headers?: (HeadersInit & (HeadersInit | {
1830
- accept: "application/json" | "text/plain" | "application/octet-stream";
1831
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1832
- authorization: "Bearer" | "Basic";
1833
- })) | undefined;
1834
- cache?: RequestCache | undefined;
1835
- credentials?: RequestCredentials | undefined;
1836
- integrity?: string | undefined;
1837
- keepalive?: boolean | undefined;
1838
- mode?: RequestMode | undefined;
1839
- priority?: RequestPriority | undefined;
1840
- redirect?: RequestRedirect | undefined;
1841
- referrer?: string | undefined;
1842
- referrerPolicy?: ReferrerPolicy | undefined;
1843
- signal?: (AbortSignal | null) | undefined;
1844
- window?: null | undefined;
1845
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1846
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1847
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1848
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1849
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1850
- hookOptions?: {
1851
- cloneResponse?: boolean;
1852
- } | undefined;
1853
- timeout?: number | undefined;
1854
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1855
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1856
- baseURL?: string | undefined;
1857
- throw?: boolean | undefined;
1858
- auth?: ({
1859
- type: "Bearer";
1860
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1861
- } | {
1862
- type: "Basic";
1863
- username: string | (() => string | undefined) | undefined;
1864
- password: string | (() => string | undefined) | undefined;
1865
- } | {
1866
- type: "Custom";
1867
- prefix: string | (() => string | undefined) | undefined;
1868
- value: string | (() => string | undefined) | undefined;
1869
- }) | undefined;
1870
- body?: (Partial<{
1871
- providerId: string;
1872
- accountId?: string | undefined;
1873
- userId?: string | undefined;
1874
- }> & Record<string, any>) | undefined;
1875
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1876
- params?: Record<string, any> | undefined;
1877
- duplex?: "full" | "half" | undefined;
1878
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1879
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1880
- retryAttempt?: number | undefined;
1881
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1882
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1883
- disableValidation?: boolean | undefined;
1884
- }>(data_0: import("better-auth").Prettify<{
531
+ getAccessToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
532
+ providerId: string;
533
+ accountId?: string | undefined;
534
+ userId?: string | undefined;
535
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
1885
536
  providerId: string;
1886
537
  accountId?: string | undefined;
1887
538
  userId?: string | undefined;
@@ -1893,134 +544,29 @@ export declare function initAuth(config: {
1893
544
  scopes: string[];
1894
545
  idToken: string | undefined;
1895
546
  }, {
1896
- code?: string;
1897
- message?: string;
547
+ code?: string | undefined;
548
+ message?: string | undefined;
1898
549
  }, FetchOptions["throw"] extends true ? true : false>>;
1899
550
  } & {
1900
- accountInfo: <FetchOptions extends {
1901
- method?: string | undefined;
1902
- headers?: (HeadersInit & (HeadersInit | {
1903
- accept: "application/json" | "text/plain" | "application/octet-stream";
1904
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1905
- authorization: "Bearer" | "Basic";
1906
- })) | undefined;
1907
- cache?: RequestCache | undefined;
1908
- credentials?: RequestCredentials | undefined;
1909
- integrity?: string | undefined;
1910
- keepalive?: boolean | undefined;
1911
- mode?: RequestMode | undefined;
1912
- priority?: RequestPriority | undefined;
1913
- redirect?: RequestRedirect | undefined;
1914
- referrer?: string | undefined;
1915
- referrerPolicy?: ReferrerPolicy | undefined;
1916
- signal?: (AbortSignal | null) | undefined;
1917
- window?: null | undefined;
1918
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1919
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1920
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1921
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1922
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1923
- hookOptions?: {
1924
- cloneResponse?: boolean;
551
+ accountInfo: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
552
+ accountId?: string | undefined;
553
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
554
+ query?: {
555
+ accountId?: string | undefined;
1925
556
  } | undefined;
1926
- timeout?: number | undefined;
1927
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1928
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1929
- baseURL?: string | undefined;
1930
- throw?: boolean | undefined;
1931
- auth?: ({
1932
- type: "Bearer";
1933
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1934
- } | {
1935
- type: "Basic";
1936
- username: string | (() => string | undefined) | undefined;
1937
- password: string | (() => string | undefined) | undefined;
1938
- } | {
1939
- type: "Custom";
1940
- prefix: string | (() => string | undefined) | undefined;
1941
- value: string | (() => string | undefined) | undefined;
1942
- }) | undefined;
1943
- body?: (Partial<{
1944
- accountId: string;
1945
- }> & Record<string, any>) | undefined;
1946
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1947
- params?: Record<string, any> | undefined;
1948
- duplex?: "full" | "half" | undefined;
1949
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1950
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1951
- retryAttempt?: number | undefined;
1952
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1953
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1954
- disableValidation?: boolean | undefined;
1955
- }>(data_0: import("better-auth").Prettify<{
1956
- accountId: string;
1957
- } & {
1958
557
  fetchOptions?: FetchOptions | undefined;
1959
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1960
- user: packages_core_dist_oauth2.OAuth2UserInfo;
558
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
559
+ user: import("better-auth").OAuth2UserInfo;
1961
560
  data: Record<string, any>;
1962
561
  }, {
1963
- code?: string;
1964
- message?: string;
562
+ code?: string | undefined;
563
+ message?: string | undefined;
1965
564
  }, FetchOptions["throw"] extends true ? true : false>>;
1966
565
  } & {
1967
- getSession: <FetchOptions extends {
1968
- method?: string | undefined;
1969
- headers?: (HeadersInit & (HeadersInit | {
1970
- accept: "application/json" | "text/plain" | "application/octet-stream";
1971
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1972
- authorization: "Bearer" | "Basic";
1973
- })) | undefined;
1974
- cache?: RequestCache | undefined;
1975
- credentials?: RequestCredentials | undefined;
1976
- integrity?: string | undefined;
1977
- keepalive?: boolean | undefined;
1978
- mode?: RequestMode | undefined;
1979
- priority?: RequestPriority | undefined;
1980
- redirect?: RequestRedirect | undefined;
1981
- referrer?: string | undefined;
1982
- referrerPolicy?: ReferrerPolicy | undefined;
1983
- signal?: (AbortSignal | null) | undefined;
1984
- window?: null | undefined;
1985
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1986
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1987
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1988
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1989
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1990
- hookOptions?: {
1991
- cloneResponse?: boolean;
1992
- } | undefined;
1993
- timeout?: number | undefined;
1994
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1995
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1996
- baseURL?: string | undefined;
1997
- throw?: boolean | undefined;
1998
- auth?: ({
1999
- type: "Bearer";
2000
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
2001
- } | {
2002
- type: "Basic";
2003
- username: string | (() => string | undefined) | undefined;
2004
- password: string | (() => string | undefined) | undefined;
2005
- } | {
2006
- type: "Custom";
2007
- prefix: string | (() => string | undefined) | undefined;
2008
- value: string | (() => string | undefined) | undefined;
2009
- }) | undefined;
2010
- body?: undefined;
2011
- query?: (Partial<{
2012
- disableCookieCache?: unknown;
2013
- disableRefresh?: unknown;
2014
- }> & Record<string, any>) | undefined;
2015
- params?: Record<string, any> | undefined;
2016
- duplex?: "full" | "half" | undefined;
2017
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
2018
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
2019
- retryAttempt?: number | undefined;
2020
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2021
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
2022
- disableValidation?: boolean | undefined;
2023
- }>(data_0?: import("better-auth").Prettify<{
566
+ getSession: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
567
+ disableCookieCache?: unknown;
568
+ disableRefresh?: unknown;
569
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
2024
570
  query?: {
2025
571
  disableCookieCache?: unknown;
2026
572
  disableRefresh?: unknown;
@@ -2047,8 +593,8 @@ export declare function initAuth(config: {
2047
593
  userAgent?: string | null | undefined;
2048
594
  };
2049
595
  } | null, {
2050
- code?: string;
2051
- message?: string;
596
+ code?: string | undefined;
597
+ message?: string | undefined;
2052
598
  }, FetchOptions["throw"] extends true ? true : false>>;
2053
599
  } & {
2054
600
  useSession: () => {
@@ -2078,7 +624,7 @@ export declare function initAuth(config: {
2078
624
  error: import("@better-fetch/fetch").BetterFetchError | null;
2079
625
  refetch: (queryParams?: {
2080
626
  query?: import("better-auth").SessionQueryParams;
2081
- }) => void;
627
+ } | undefined) => Promise<void>;
2082
628
  };
2083
629
  $Infer: {
2084
630
  Session: {
@@ -2108,18 +654,25 @@ export declare function initAuth(config: {
2108
654
  id: string;
2109
655
  name: string;
2110
656
  hooks: {
2111
- onSuccess: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
2112
- onError: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
2113
- onRequest: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
2114
- onResponse: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
657
+ onSuccess(context: import("@better-fetch/fetch").SuccessContext<any>): void;
2115
658
  };
2116
659
  } | {
2117
660
  id: string;
2118
661
  name: string;
2119
662
  hooks: {
2120
- onSuccess(context: import("@better-fetch/fetch").SuccessContext<any>): void;
663
+ onRequest<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>): void;
664
+ };
665
+ } | {
666
+ id: string;
667
+ name: string;
668
+ hooks: {
669
+ onSuccess: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
670
+ onError: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
671
+ onRequest: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
672
+ onResponse: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
2121
673
  };
2122
674
  })[];
675
+ cache?: RequestCache | undefined;
2123
676
  method: string;
2124
677
  headers?: (HeadersInit & (HeadersInit | {
2125
678
  accept: "application/json" | "text/plain" | "application/octet-stream";
@@ -2127,7 +680,6 @@ export declare function initAuth(config: {
2127
680
  authorization: "Bearer" | "Basic";
2128
681
  })) | undefined;
2129
682
  redirect?: RequestRedirect | undefined;
2130
- cache?: RequestCache | undefined;
2131
683
  credentials?: RequestCredentials;
2132
684
  integrity?: string | undefined;
2133
685
  keepalive?: boolean | undefined;
@@ -2167,9 +719,10 @@ export declare function initAuth(config: {
2167
719
  output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2168
720
  errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
2169
721
  disableValidation?: boolean | undefined;
722
+ disableSignal?: boolean | undefined;
2170
723
  }, unknown, unknown, {}>;
2171
724
  $store: {
2172
- notify: (signal?: Omit<string, "$sessionSignal"> | "$sessionSignal") => void;
725
+ notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
2173
726
  listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
2174
727
  atoms: Record<string, import("nanostores").WritableAtom<any>>;
2175
728
  };