mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
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.
|
||
|---|---|---|
| .. | ||
| hystrixjs-tests.ts | ||
| index.d.ts | ||
| tsconfig.json | ||
| tslint.json | ||