@types/err
TypeScript icon, indicating that this package has built-in type declarations

2.1.2 • Public • Published

Installation

npm install --save @types/err

Summary

This package contains type definitions for err (https://github.com/IonicaBizau/err#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/err.

index.d.ts

export = Err;

/** Values required if the only argument to the constructor is an object. */
interface RequiredData {
    message: string;
    code: string;
}

/** Arbitrary data to include in the error. */
type Data = Record<string, string>;

/** Create a custom error object. */
declare class Err extends Error {
    constructor(error: string | Error, code?: string, data?: Data);
    constructor(error: string | Error, data: Data);
    constructor(error: RequiredData & Data);
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by Jimmy Cuadra.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/err

Weekly Downloads

174

Version

2.1.2

License

MIT

Unpacked Size

3.46 kB

Total Files

5

Last publish

Collaborators

  • types