mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
Type check RetryStrategyOptions props explicitly
This commit is contained in:
@@ -30,6 +30,12 @@ client = redis.createClient(num, str, options);
|
||||
// Test the `retry_strategy` property
|
||||
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
|
||||
function retryStrategyNumber(options: redis.RetryStrategyOptions): number {
|
||||
// Ensure that the properties of RetryStrategyOptions are resilient to breaking change.
|
||||
// If the properties of the interface changes, the variables below will also need to be adapted.
|
||||
var error: Error = options.error;
|
||||
var total_retry_time: number = options.total_retry_time;
|
||||
var times_connected: number = options.times_connected;
|
||||
var attempt: number = options.attempt;
|
||||
return 5000;
|
||||
}
|
||||
function retryStrategyError(options: redis.RetryStrategyOptions): Error {
|
||||
|
||||
Reference in New Issue
Block a user