| import { AuthResponse, AuthResponsePassword, SSOResponse, GenerateLinkProperties, GenerateLinkResponse, User, UserResponse, WeakPassword } from './types'; |
| export type Fetch = typeof fetch; |
| |
| interface GoTrueSessionData { |
| access_token?: string; |
| refresh_token?: string; |
| expires_in?: number; |
| expires_at?: number; |
| user?: User; |
| [key: string]: any; |
| } |
| |
| interface GoTrueSessionPasswordData extends GoTrueSessionData { |
| weak_password?: WeakPassword; |
| } |
| |
| interface GoTrueUserData { |
| user?: User; |
| [key: string]: any; |
| } |
| |
| type GoTrueGenerateLinkData = GenerateLinkProperties & Record<string, any>; |
| export interface FetchOptions { |
| headers?: { |
| [key: string]: string; |
| }; |
| noResolveJson?: boolean; |
| } |
| export interface FetchParameters { |
| signal?: AbortSignal; |
| } |
| export type RequestMethodType = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; |
| export declare function handleError(error: unknown): Promise<void>; |
| interface GotrueRequestOptions extends FetchOptions { |
| jwt?: string; |
| redirectTo?: string; |
| body?: object; |
| query?: { |
| [key: string]: string; |
| }; |
| |
| |
| |
| xform?: (data: any) => any; |
| } |
| export declare function _request(fetcher: Fetch, method: RequestMethodType, url: string, options?: GotrueRequestOptions): Promise<any>; |
| export declare function _sessionResponse(data: GoTrueSessionData): AuthResponse; |
| export declare function _sessionResponsePassword(data: GoTrueSessionPasswordData): AuthResponsePassword; |
| export declare function _userResponse(data: GoTrueUserData): UserResponse; |
| export declare function _ssoResponse(data: Record<string, any>): SSOResponse; |
| export declare function _generateLinkResponse(data: GoTrueGenerateLinkData): GenerateLinkResponse; |
| export declare function _noResolveJsonResponse(data: Response): Response; |
| export {}; |
| |