UNPKG

@ewb/reach

Version:
25 lines (24 loc) 733 B
import { IReachOptions } from '../types'; export interface IReachApiOptions { csrf?: { cookie: string; }; options?: Partial<IReachOptions>; headers?: Headers; logout?: (response: Response) => void; } export declare class ReachApi { readonly url: string; private opts; private _socketIds; private _onLogout; constructor(url: string, opts: IReachApiOptions); get socketIds(): string[]; set onLogout(fn: IReachApiOptions['logout']); headers(): Headers; options(): Partial<IReachOptions>; getCSRFHeaderToken(): null | [string, string]; logout(response: Response): void; addSocket(id: string): void; deleteSocket(id: string): void; }