import BotchedError, { ErrorOptions } from './BotchedError'; import { httpErrorCodes } from './HttpErrors'; declare type httpErrorCodesPreset = typeof httpErrorCodes & { [statusCode: number]: typeof BotchedError; }; export declare type StatusCodeToHttpError = { [P in keyof httpErrorCodesPreset]: InstanceType; }; declare function createError(statusCode: T | number, message?: string, ...params: any[]): StatusCodeToHttpError[T]; declare function createError(statusCode?: T | number, options?: ErrorOptions | Error, message?: string, ...params: any[]): StatusCodeToHttpError[T]; export default createError;