Add type definition for error-subclass (#27811)

This commit is contained in:
Liam McLoughlin
2018-08-02 10:07:56 -07:00
committed by Sheetal Nandi
parent ebbce89f44
commit ea7afee98f
4 changed files with 39 additions and 0 deletions
@@ -0,0 +1,7 @@
import ErrorSubclass from 'error-subclass';
class ExampleError extends ErrorSubclass {
static displayName = 'ExampleError';
}
throw new ExampleError('Something went wrong!');
+8
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;
}
+23
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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }