import { TokenProvider } from './token-provider'; import { Subscription, SubscribeOptions } from './subscription'; import { ResumableSubscribeOptions, ResumableSubscription } from './resumable-subscription'; import { RetryStrategy } from './retry-strategy'; export interface BaseClientOptions { host: string; encrypted?: boolean; timeout?: number; XMLHttpRequest?: Function; } export declare type Headers = { [key: string]: string; }; export interface Event { eventId: string; headers: Headers; body: any; } export interface RequestOptions { method: string; path: string; tokenProvider?: TokenProvider; jwt?: string; headers?: Headers; body?: any; retryStrategy?: RetryStrategy; } export declare function responseHeadersObj(headerStr: string): Headers; export declare class ErrorResponse extends Error { statusCode: number; headers: Headers; info: any; constructor(statusCode: number, headers: Headers, info: any); static fromXHR(xhr: XMLHttpRequest): ErrorResponse; } export declare class NetworkError extends Error { error: string; constructor(error: string); } export declare enum XhrReadyState { UNSENT = 0, OPENED = 1, HEADERS_RECEIVED = 2, LOADING = 3, DONE = 4, } export declare class BaseClient { private options; private baseURL; private XMLHttpRequest; constructor(options: BaseClientOptions); request(options: RequestOptions): Promise; newSubscription(subOptions: SubscribeOptions): Subscription; newResumableSubscription(subOptions: ResumableSubscribeOptions): ResumableSubscription; private createXHR(baseURL, options); }