import * as _homer0_jimple from '@homer0/jimple'; import { J as Jimpex } from '../../index-DAUqbQ6h.js'; import { Statuses } from '../../utils/fns/statuses.js'; import { AppError, AppErrorContext } from './appError.js'; import '../../types/express.js'; import 'express'; import '../../types/http.js'; import 'https'; import 'http'; import 'spdy'; import 'node-fetch'; import '../../types/utils.js'; import '@homer0/path-utils'; import '@homer0/simple-logger'; import '@homer0/simple-config'; import '@homer0/events-hub'; import 'statuses'; /** * A type of error to be used on HTTP requests. This is the most common type of error used * by Jimpex. * * @group Services * @group Services/HTTPError */ declare class HTTPError extends AppError { /** * @param message The error message. * @param status The HTTP status code. * @param context Context information related to the error. * @param statuses A reference to the service that generates HTTP status codes. This * is in case the implementation wants to use a special version from * the container; otherwise, it will use the `statuses` library * directly. */ constructor(message: string, status?: number | string, context?: AppErrorContext, statuses?: Statuses); } /** * Shorthand for `new HTTPError()`. * * @param args The same parameters as the {@link HTTPError} constructor. * @returns A new instance of {@link HTTPError}. * @group Services * @group Services/HTTPError */ declare const createHTTPError: (...args: ConstructorParameters) => HTTPError; /** * The type of the function that generates a new instance of {@link HTTPError}. * This is exported to make it easy to type the dependency injection. * * @group Services/HTTPError */ type CreateHTTPErrorFn = typeof createHTTPError; /** * THe type of the {@link HTTPError} class. * This is exported to make it easy to type the dependency injection. * * @group Services/HTTPError */ type HTTPErrorClass = typeof HTTPError; /** * A service provider that will register both the {@link HTTPError} and a generator * function on the container. `HTTPError` will be the key for class, and `httpError` will * be for the generator function. * * @example * * // Register it on the container * container.register(httpErrorProvider); * // Getting access to the class. * const HTTPError = container.get('HTTPError'); * // Getting access to the function. * const httpError = container.get('httpError'); * * @group Providers * @group Services/HTTPError */ declare const httpErrorProvider: _homer0_jimple.Resource<"provider", "register", _homer0_jimple.ProviderRegisterFn>; export { type CreateHTTPErrorFn, HTTPError, type HTTPErrorClass, createHTTPError, httpErrorProvider };