[loud-rejection] add typings (#18877)

* [loud-rejection] add typings

* [loud-rejection] make callback arg mandatory
This commit is contained in:
Dimitri Benin
2017-08-14 11:09:02 -07:00
committed by Mohamed Hegazy
parent fec1061e55
commit 9ec9fb5742
4 changed files with 38 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for loud-rejection 1.6
// Project: https://github.com/sindresorhus/loud-rejection#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = loudRejection;
declare function loudRejection(log?: (stack: string) => void): void;
@@ -0,0 +1,7 @@
import loudRejection = require('loud-rejection');
import 'loud-rejection/register';
loudRejection();
loudRejection(stack => {
stack; // $ExpectType string
});
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"loud-rejection-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }