@uprtcl/http-provider
Version:
_Prtcl provider wrappers around the native fetch api
25 lines (24 loc) • 1.14 kB
TypeScript
import { ConnectionLogged } from '@uprtcl/evees';
import { HttpAuthenticatedConnection } from './http.auth.connection.if';
import { HttpConnection, PostResult } from './http.connection';
export declare class HttpMultiConnection implements HttpConnection, ConnectionLogged {
readonly host: string;
private connections;
private selected?;
constructor(host: string, connections: Map<string, HttpAuthenticatedConnection>, selected?: string | undefined);
select(selected: string): void;
connection(): HttpAuthenticatedConnection;
get userId(): string | undefined;
connect(): Promise<void>;
isConnected(): Promise<boolean>;
disconnect(): Promise<void>;
isLogged(): Promise<boolean>;
login(): Promise<void>;
logout(): Promise<void>;
get<T>(url: string): Promise<T>;
getWithPut<T>(url: string, body: any): Promise<T>;
put(url: string, body: any): Promise<PostResult>;
post(url: string, body: any): Promise<PostResult>;
delete(url: string, body: any): Promise<PostResult>;
putOrPost(url: string, body: any, method: string): Promise<PostResult>;
}