Add type definition for error-subclass (#27811)

This commit is contained in:
Liam McLoughlin
2018-08-02 18:07:56 +01:00
committed by Sheetal Nandi
parent ebbce89f44
commit ea7afee98f
4 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
import ErrorSubclass from 'error-subclass';
class ExampleError extends ErrorSubclass {
static displayName = 'ExampleError';
}
throw new ExampleError('Something went wrong!');

8
types/error-subclass/index.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
// Type definitions for error-subclass 2.2
// Project: https://github.com/spudly/error-subclass#readme
// Definitions by: Fitbit <https://github.com/fitbit>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export default class ErrorSubclass extends Error {
static displayName: string;
}

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": [
"index.d.ts",
"error-subclass-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }