http-retrier
Version:
43 lines • 1.74 kB
TypeScript
import { AxiosError, AxiosHeaders, AxiosResponse } from "axios";
import { HttpRetrierResponse, HttpStatusCodes, HttpStatusMessage, HttpRetrierOutputConverter } from "./types.js";
export declare class HttpRetrierResponseInit {
url: string;
method: string;
status: HttpStatusCodes;
statusText: HttpStatusMessage;
headers: AxiosHeaders;
attempt: number;
input: any;
output: any;
/**
* Create a new HttpRetrierResponseInit object
* @param {string} url - The URL to request
* @param {string} method - The HTTP method to use
* @param {any} input - The input data to send with the request
*/
constructor(url: string, method: string | undefined, input: any);
/**
* Update the status and statusText properties
* @param {HttpStatusCodes} status - The new status code
*/
private set _status(value);
/**
* Update the response object with the given response and attempt
* @param {AxiosResponse} response - The response object to update
* @param {number} attempt - The attempt number
*/
update(response: AxiosResponse, attempt: number): void;
/**
* Update the response object with the given error and attempt
* @param {AxiosError | any} error - The error object to update
* @param {number} attempt - The attempt number
*/
error(error: AxiosError | any, attempt: number): void;
/**
* Create a new HttpRetrierResponse object
* @param {OutputConverter} outputConverter - The output converter to use
* @returns {HttpRetrierResponse} A new HttpRetrierResponse object
*/
create(outputConverter?: HttpRetrierOutputConverter): HttpRetrierResponse;
}
//# sourceMappingURL=response.d.ts.map