mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-06 12:36:49 +08: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.
26 lines
531 B
JSON
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"
|
|
]
|
|
}
|