Files
DefinitelyTyped/types/hystrixjs/tsconfig.json
rcannon 01d17fcb39 [hystrixjs] Strengthen type hints
This adds type hints for builders, commands and their respective
callbacks functions out to seven arity, while leaving the nonspecific
versions for backwards compatibility. This allows
`commandFactory.getOrCreate()` to create fully type hinted callback
signatures, both for the builder and the command.

```js
const command = commandFactory.
  getOrCreate<ResponseType, Arg1Type, Arg2Type>();
```

I also replaced all references to `Q` with `PromiseLike`, and added the
missing `hystrix.promise.implementation` configuration option, which
allows changing the underlying promise implementation.

This allows things like:

```js
const Bluebird = require("bluebird");
HystrixConfig.init({
  "hystrix.promise.implementation": Bluebird
});
(command.execute() as Bluebird<any>).catch(() => true);
```

...although I couldn't figure out how to more elegantly express that
Bluebird type.

Also made the fallback signature match the implementation.
2017-11-10 23:29:21 -08:00

26 lines
531 B
JSON

{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"paths": {},
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"hystrixjs-tests.ts"
]
}