diff --git a/types/error-subclass/error-subclass-tests.ts b/types/error-subclass/error-subclass-tests.ts new file mode 100644 index 0000000000..9944bba159 --- /dev/null +++ b/types/error-subclass/error-subclass-tests.ts @@ -0,0 +1,7 @@ +import ErrorSubclass from 'error-subclass'; + +class ExampleError extends ErrorSubclass { + static displayName = 'ExampleError'; +} + +throw new ExampleError('Something went wrong!'); diff --git a/types/error-subclass/index.d.ts b/types/error-subclass/index.d.ts new file mode 100644 index 0000000000..55add2c057 --- /dev/null +++ b/types/error-subclass/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for error-subclass 2.2 +// Project: https://github.com/spudly/error-subclass#readme +// Definitions by: Fitbit +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default class ErrorSubclass extends Error { + static displayName: string; +} diff --git a/types/error-subclass/tsconfig.json b/types/error-subclass/tsconfig.json new file mode 100644 index 0000000000..1574ebeea2 --- /dev/null +++ b/types/error-subclass/tsconfig.json @@ -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" + ] +} diff --git a/types/error-subclass/tslint.json b/types/error-subclass/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/error-subclass/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }