mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 12:37:16 +08:00
Merge pull request #28427 from woutervh-/create-nested-error-stacks
@types/nested-error-stacks Added typings for nested-error-stacks
This commit is contained in:
10
types/nested-error-stacks/index.d.ts
vendored
Normal file
10
types/nested-error-stacks/index.d.ts
vendored
Normal file
@@ -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 <https://github.com/woutervh->
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class NestedError extends Error {
|
||||
constructor(message?: any, nested?: Error);
|
||||
}
|
||||
|
||||
export = NestedError;
|
||||
6
types/nested-error-stacks/nested-error-stacks-tests.ts
Normal file
6
types/nested-error-stacks/nested-error-stacks-tests.ts
Normal file
@@ -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;
|
||||
23
types/nested-error-stacks/tsconfig.json
Normal file
23
types/nested-error-stacks/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
3
types/nested-error-stacks/tslint.json
Normal file
3
types/nested-error-stacks/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user