type SocketResponse<T = any> = {
  id?: number | null;
  jsonrpc: string;
  result?: T;
  notification?: string;
  params?: any;
  error?: {
    code: number;
    message: string;
    data?: any;
  };
};

type SocketSendOptions = {
  timeout?: number;
};

declare function Client(endpoint: string, opts?: SocketSendOptions): Promise<{
    subscribe: (namespace: string, cb: (params: any[]) => void) => Promise<SocketResponse>;
    unsubscribe: (namespace: string) => Promise<SocketResponse<any>>;
    close: () => void;
} & {
    [k: string]: <T>(...args: any) => Promise<SocketResponse<T>>;
}>;

export { Client as BrowserClient };
