Fix return values of rethrowResult and retryResult

Bug: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33242

To make the type definition consistent with both the implementation and api docs as indicated in the bug, we are updating the return values of `rethrowResult` and `retryResult` to return a `DecisionInfo` object.

Additionally the `DecisionInfo` object will have it's `consistency` field made optional and a new optional field of `useCurrentHost` is added.
This commit is contained in:
Steven Bell
2019-02-21 13:02:13 -08:00
committed by GitHub
parent ce69227629
commit 307c2e4e4e

View File

@@ -87,7 +87,8 @@ export namespace policies {
interface DecisionInfo {
decision: number;
consistency: number;
consistency?: number;
useCurrentHost?: boolean;
}
interface RequestInfo {
@@ -115,8 +116,8 @@ export namespace policies {
onReadTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, isDataPresent: boolean): DecisionInfo;
onUnavailable(requestInfo: RequestInfo, consistency: types.consistencies, required: number, alive: number): DecisionInfo;
onWriteTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, writeType: string): DecisionInfo;
rethrowResult(): { decision: retryDecision };
retryResult(consistency?: types.consistencies, useCurrentHost?: boolean): { decision: retryDecision, consistency: types.consistencies, useCurrentHost: boolean };
rethrowResult(): DecisionInfo;
retryResult(consistency?: types.consistencies, useCurrentHost?: boolean): DecisionInfo;
}
}