import { HttpieError, HttpieErrorOptions } from "./HttpieCommonError"; import { getDecompressionError, getFetchError, getParserError } from "../common/errors"; type MessageOfGetDecompressionError = Parameters[0]["message"]; type MessageOfGetParserError = Parameters[0]["message"]; type MessageOfGetFetchError = Parameters[0]["message"]; interface HttpieHandlerErrorOptions extends HttpieErrorOptions { /** @description original error */ error?: Error; message: T; } interface HttpieDecompressionErrorOptions extends HttpieHandlerErrorOptions { /** @description original body as buffer */ buffer: Buffer; /** @description encodings from 'content-encoding' header */ encodings: string[]; } interface HttpieParserErrorOptions extends HttpieHandlerErrorOptions { /** @description content-type from 'content-type' header without params */ contentType: string; /** @description original body as buffer */ buffer: Buffer; /** @description body as string */ text: string | null; } declare class HttpieHandlerError extends HttpieError { reason: Error | null; constructor(message: string, options: HttpieHandlerErrorOptions); } export declare class HttpieFetchBodyError extends HttpieHandlerError { constructor(options: HttpieHandlerErrorOptions, ...args: any[]); } export declare class HttpieDecompressionError extends HttpieHandlerError { buffer: Buffer; encodings: string[]; constructor(options: HttpieDecompressionErrorOptions, ...args: any[]); } export declare class HttpieParserError extends HttpieHandlerError { contentType: string; buffer: Buffer; text: string | null; constructor(options: HttpieParserErrorOptions, ...args: any[]); } export {};