export declare class ClientResponse { private readonly statusVal; private readonly headersVal; private readonly bodyString; constructor(statusVal: number, headersVal: Headers, bodyString: string); status(): number; ok(): boolean; body(): string; json(): T; headers(): Record; header(name: string): string | null; } export declare class ResponseStub { readonly body: any; readonly status: number; readonly headers: Record; constructor(body: any, status?: number, headers?: Record); toResponse(): ClientResponse; } export declare class ResponseSequence { private stubs; private index; push(body: any, status?: number, headers?: Record): this; pushCallback(callback: () => ResponseStub): this; next(): ClientResponse; } export declare class ClientRequest { private readonly urlVal; private readonly methodVal; private readonly headersVal; private readonly dataVal; constructor(urlVal: string, methodVal: string, headersVal: Record, dataVal: any); url(): string; method(): string; headers(): Record; hasHeader(name: string): boolean; header(name: string): string | undefined; data(): any; } export declare class PendingRequest { private readonly factory; private headersVal; private tokenVal?; private bodyFormat; private timeoutMs?; private retryTimes; private retryDelayMs; constructor(factory: HttpFactory); withHeaders(headers: Record): this; withToken(token: string, type?: string): this; asJson(): this; asFormUrlEncoded(): this; timeout(ms: number): this; retry(times: number, delayMs?: number): this; get(url: string, query?: Record): Promise; post(url: string, data?: any): Promise; put(url: string, data?: any): Promise; patch(url: string, data?: any): Promise; delete(url: string, data?: any): Promise; send(method: string, url: string, data?: any): Promise; } export type FakeCallback = (request: ClientRequest) => any; export declare class HttpFactory { private fakeStubs; private fakingAll; private defaultFakeStub?; private recordedPairs; isFaking(): boolean; fake(stubs?: Record | FakeCallback): this; response(body: any, status?: number, headers?: Record): ResponseStub; sequence(): ResponseSequence; resolveFake(url: string, method: string, headers: Record, data: any): ClientResponse; private resolveStubValue; record(request: ClientRequest, response: ClientResponse): void; clear(): void; assertSent(callback: (request: ClientRequest, response: ClientResponse) => boolean): void; assertNotSent(callback: (request: ClientRequest, response: ClientResponse) => boolean): void; assertNothingSent(): void; private newPendingRequest; withHeaders(headers: Record): PendingRequest; withToken(token: string, type?: string): PendingRequest; asJson(): PendingRequest; asFormUrlEncoded(): PendingRequest; timeout(ms: number): PendingRequest; retry(times: number, delayMs?: number): PendingRequest; get(url: string, query?: Record): Promise; post(url: string, data?: any): Promise; put(url: string, data?: any): Promise; patch(url: string, data?: any): Promise; delete(url: string, data?: any): Promise; } export declare function matchUrl(url: string, pattern: string): boolean; export declare const Http: HttpFactory; //# sourceMappingURL=client.d.ts.map