diff --git a/types/nested-error-stacks/index.d.ts b/types/nested-error-stacks/index.d.ts new file mode 100644 index 0000000000..29d629a50b --- /dev/null +++ b/types/nested-error-stacks/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for nested-error-stacks 2.1 +// Project: https://github.com/mdlavin/nested-error-stacks +// Definitions by: Wouter van Heeswijk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class NestedError extends Error { + constructor(message?: any, nested?: Error); +} + +export = NestedError; diff --git a/types/nested-error-stacks/nested-error-stacks-tests.ts b/types/nested-error-stacks/nested-error-stacks-tests.ts new file mode 100644 index 0000000000..52a9a55495 --- /dev/null +++ b/types/nested-error-stacks/nested-error-stacks-tests.ts @@ -0,0 +1,6 @@ +import NestedErrorStacks = require('nested-error-stacks'); + +const error = new NestedErrorStacks('Top level error', new Error('Nested error')); +const message = error.message; +const name = error.name; +const stack = error.stack; diff --git a/types/nested-error-stacks/tsconfig.json b/types/nested-error-stacks/tsconfig.json new file mode 100644 index 0000000000..2954204b36 --- /dev/null +++ b/types/nested-error-stacks/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "nested-error-stacks-tests.ts" + ] +} \ No newline at end of file diff --git a/types/nested-error-stacks/tslint.json b/types/nested-error-stacks/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/nested-error-stacks/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}