UNPKG

@uprtcl/http-provider

Version:

_Prtcl provider wrappers around the native fetch api

27 lines (26 loc) 990 B
import { HttpAuthenticatedConnection } from './http.auth.connection.if'; import { HttpConnection } from './http.connection'; import { PostResult } from './http.connection'; interface TestUser { userId: string; jwt: string; } export declare class HttpSupertest implements HttpConnection { readonly host: string; user: TestUser; constructor(host: string, user: TestUser); connection(): HttpAuthenticatedConnection; connect(): Promise<void>; isConnected(): Promise<boolean>; disconnect(): Promise<void>; login(): Promise<void>; isLogged(): Promise<boolean>; 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): Promise<PostResult>; putOrPost(url: string, body: any, method: string): Promise<PostResult>; } export {};