import { OperatorFunction } from 'rxjs'; import { HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; /** * Success code you can use for catching success response. * If you need error code, use error catching. */ declare type CodeRange = 100 | 101 | 102 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308; /** * Function for handling response. */ declare type ResponseBodyHandler = (responseBody: Body, responseHeaders?: HttpHeaders) => void; /** * Error throws when handler gets unexpected response code * or content type in {@link HttpResponse}. */ export declare class UnexpectedResponse extends Error { code: number; message: string; response: HttpResponse; conditions: { codes: CodeRange[]; contentTypes: string[]; }; constructor(code: number, message: string, response: HttpResponse, conditions: { codes: CodeRange[]; contentTypes: string[]; }); } /** * Handle response with specified `code` and `contentType`, * using response body, and continue with no result changes. * * @param code * @param contentType * @param handler */ export declare function tapResponse(code: CodeRange | CodeRange[], contentType: string | string[], handler: ResponseBodyHandler): OperatorFunction, HttpResponse | HttpEvent>; /** * Handle response with specified `code`, * using response body, and continue with no result changes. * * @param code * @param contentType * @param handler */ export declare function tapResponse(code: CodeRange | CodeRange[], handler: ResponseBodyHandler): OperatorFunction, HttpResponse | HttpEvent>; /** * Handle response using response body, and continue with no result changes. * * @param code * @param contentType * @param handler */ export declare function tapResponse(handler: ResponseBodyHandler): OperatorFunction, HttpResponse | HttpEvent>; /** * Filter responses by code and content type. * Other events and responses with other code/type will be ignored. * * Maps value from {@link HttpResponse} to `HttpResponse.body`. * * @param code * @param contentTypes * @param throwIfOther * Throw error at getting {@link HttpResponse} with code/type not matching * to conditions. */ export declare function pickResponseBody(codes?: CodeRange | CodeRange[], contentTypes?: string | string[], throwIfOther?: boolean): OperatorFunction, S>; export {};