@typed/http
Version:
HTTP requests for node and browsers
14 lines • 950 B
TypeScript
import { Either, Left, Right } from '@typed/either';
import { Json } from './Json';
import { HttpOptions, HttpResponse, TestHttpEnv } from './types';
/**
* Create a test-friendly http environment
* @param testHttp :: (url -> HttpOptions -> Either Error HttpResponse)
* @param timer :: Timer
*/
export declare function createTestHttpEnv(testHttp: (url: string, options: HttpOptions) => Either<Error, HttpResponse> | PromiseLike<Either<Error, HttpResponse>>): TestHttpEnv;
export declare function createSuccessfulResponse<A = unknown>(options?: Partial<HttpResponse<A>>): Right<HttpResponse<A>>;
export declare function createFailedResponse(error: Error): Left<Error>;
export declare function createHttpResponse<A>(options?: Partial<HttpResponse<A>>): HttpResponse<A>;
export declare function createJsonResponse<A extends Json>(jsonReadyValue: A, options?: Partial<HttpResponse<A>>): HttpResponse<A>;
//# sourceMappingURL=createTestHttpEnv.d.ts.map