export interface PlatformInfo { name: string; version?: string; extra?: string; userAgent?: string; } export type HTTPMethod = | "OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "TRACE" | "CONNECT"; export interface ProgressEvent { loaded: number; percent?: number; total?: number; } export interface AbortSignal { readonly aborted: boolean; addEventListener: (type: string, listener: () => any) => any; removeEventListener: (type: string, listener: () => any) => any; } export interface RequestOptions { method?: HTTPMethod; headers?: Record; data?: Record; onprogress?: (event: ProgressEvent) => void; signal?: AbortSignal; } export interface Response { status?: number; ok?: boolean; headers?: object; data?: object; } export interface FormDataPart { field: string; data: any; name: string; } export declare type SyncStorage = { async?: false; getItem: (key: string) => string | null; setItem: (key: string, value: string) => any; removeItem: (key: string) => any; clear: () => any; }; export declare type AsyncStorage = { async: true; getItem: (key: string) => Promise; setItem: (key: string, value: string) => Promise; removeItem: (key: string) => Promise; clear: () => Promise; }; export declare type Storage = SyncStorage | AsyncStorage; export interface WebSocket { addEventListener( event: string, handler: (...args: any[]) => any, ...args: any[] ): any; removeEventListener( event: string, handler: (...args: any[]) => any, ...args: any[] ): any; send(data: string | ArrayBuffer): any; close(): any; } export interface AuthData { [key: string]: any; } export interface AuthInfo { authData: AuthData; provider: string; platform?: string; } export interface Adapters { platformInfo: PlatformInfo; request: (url: string, options?: RequestOptions) => Promise; upload: ( url: string, file: FormDataPart, options?: RequestOptions ) => Promise; storage: Storage; WebSocket: { new (url: string, protocols?: string | string[]): WebSocket; }; getAuthInfo: (...args: any[]) => Promise; }