@types/http-errors

  • Version 1.8.1
  • Published
  • 5.69 kB
  • No dependencies
  • MIT license

Install

npm i @types/http-errors
yarn add @types/http-errors
pnpm add @types/http-errors

Overview

TypeScript definitions for http-errors

Index

Variables

variable createHttpError

const createHttpError: createHttpError.CreateHttpError & {
[code: string]: createHttpError.HttpErrorConstructor;
HttpError: createHttpError.HttpErrorConstructor;
} & Record<
| 'BadRequest'
| 'Unauthorized'
| 'PaymentRequired'
| 'Forbidden'
| 'NotFound'
| 'MethodNotAllowed'
| 'NotAcceptable'
| 'ProxyAuthenticationRequired'
| 'RequestTimeout'
| 'Conflict'
| 'Gone'
| 'LengthRequired'
| 'PreconditionFailed'
| 'PayloadTooLarge'
| 'URITooLong'
| 'UnsupportedMediaType'
| 'RangeNotSatisfiable'
| 'ExpectationFailed'
| 'ImATeapot'
| 'MisdirectedRequest'
| 'UnprocessableEntity'
| 'Locked'
| 'FailedDependency'
| 'UnorderedCollection'
| 'UpgradeRequired'
| 'PreconditionRequired'
| 'TooManyRequests'
| 'RequestHeaderFieldsTooLarge'
| 'UnavailableForLegalReasons'
| 'InternalServerError'
| 'NotImplemented'
| 'BadGateway'
| 'ServiceUnavailable'
| 'GatewayTimeout'
| 'HTTPVersionNotSupported'
| 'VariantAlsoNegotiates'
| 'InsufficientStorage'
| 'LoopDetected'
| 'BandwidthLimitExceeded'
| 'NotExtended'
| 'NetworkAuthenticationRequire'
| '400'
| '401'
| '402'
| '403'
| '404'
| '405'
| '406'
| '407'
| '408'
| '409'
| '410'
| '411'
| '412'
| '413'
| '414'
| '415'
| '416'
| '417'
| '418'
| '421'
| '422'
| '423'
| '424'
| '425'
| '426'
| '428'
| '429'
| '431'
| '451'
| '500'
| '501'
| '502'
| '503'
| '504'
| '505'
| '506'
| '507'
| '508'
| '509'
| '510'
| '511',
createHttpError.HttpErrorConstructor
> & { isHttpError: createHttpError.IsHttpError };

    Interfaces

    interface HttpError

    interface HttpError extends Error {}

      property expose

      expose: boolean;

        property headers

        headers?:
        | {
        [key: string]: string;
        }
        | undefined;

          property status

          status: number;

            property statusCode

            statusCode: number;

              index signature

              [key: string]: any;

                Type Aliases

                type CreateHttpError

                type CreateHttpError = (...args: UnknownError[]) => HttpError;

                  type HttpErrorConstructor

                  type HttpErrorConstructor = new (msg?: string) => HttpError;

                    type IsHttpError

                    type IsHttpError = (error: unknown) => error is HttpError;

                      type NamedConstructors

                      type NamedConstructors = {
                      [code: string]: HttpErrorConstructor;
                      HttpError: HttpErrorConstructor;
                      } & Record<
                      | 'BadRequest'
                      | 'Unauthorized'
                      | 'PaymentRequired'
                      | 'Forbidden'
                      | 'NotFound'
                      | 'MethodNotAllowed'
                      | 'NotAcceptable'
                      | 'ProxyAuthenticationRequired'
                      | 'RequestTimeout'
                      | 'Conflict'
                      | 'Gone'
                      | 'LengthRequired'
                      | 'PreconditionFailed'
                      | 'PayloadTooLarge'
                      | 'URITooLong'
                      | 'UnsupportedMediaType'
                      | 'RangeNotSatisfiable'
                      | 'ExpectationFailed'
                      | 'ImATeapot'
                      | 'MisdirectedRequest'
                      | 'UnprocessableEntity'
                      | 'Locked'
                      | 'FailedDependency'
                      | 'UnorderedCollection'
                      | 'UpgradeRequired'
                      | 'PreconditionRequired'
                      | 'TooManyRequests'
                      | 'RequestHeaderFieldsTooLarge'
                      | 'UnavailableForLegalReasons'
                      | 'InternalServerError'
                      | 'NotImplemented'
                      | 'BadGateway'
                      | 'ServiceUnavailable'
                      | 'GatewayTimeout'
                      | 'HTTPVersionNotSupported'
                      | 'VariantAlsoNegotiates'
                      | 'InsufficientStorage'
                      | 'LoopDetected'
                      | 'BandwidthLimitExceeded'
                      | 'NotExtended'
                      | 'NetworkAuthenticationRequire'
                      | '400'
                      | '401'
                      | '402'
                      | '403'
                      | '404'
                      | '405'
                      | '406'
                      | '407'
                      | '408'
                      | '409'
                      | '410'
                      | '411'
                      | '412'
                      | '413'
                      | '414'
                      | '415'
                      | '416'
                      | '417'
                      | '418'
                      | '421'
                      | '422'
                      | '423'
                      | '424'
                      | '425'
                      | '426'
                      | '428'
                      | '429'
                      | '431'
                      | '451'
                      | '500'
                      | '501'
                      | '502'
                      | '503'
                      | '504'
                      | '505'
                      | '506'
                      | '507'
                      | '508'
                      | '509'
                      | '510'
                      | '511',
                      HttpErrorConstructor
                      >;

                        type UnknownError

                        type UnknownError = Error | string | number | { [key: string]: any };

                          Package Files (1)

                          Dependencies (0)

                          No dependencies.

                          Dev Dependencies (0)

                          No dev dependencies.

                          Peer Dependencies (0)

                          No peer dependencies.

                          Badge

                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/http-errors.

                          • Markdown
                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/http-errors)
                          • HTML
                            <a href="https://www.jsdocs.io/package/@types/http-errors"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>