UNPKG

1.98 kBTypeScriptView Raw
1import { HttpOperationResponse } from "../httpOperationResponse";
2import { WebResourceLike } from "../webResource";
3import { BaseRequestPolicy, RequestPolicy, RequestPolicyFactory, RequestPolicyOptionsLike } from "./requestPolicy";
4export interface RetryData {
5 retryCount: number;
6 retryInterval: number;
7 error?: RetryError;
8}
9export interface RetryError extends Error {
10 message: string;
11 code?: string;
12 innerError?: RetryError;
13}
14export declare function exponentialRetryPolicy(retryCount?: number, retryInterval?: number, minRetryInterval?: number, maxRetryInterval?: number): RequestPolicyFactory;
15/**
16 * @class
17 * Instantiates a new "ExponentialRetryPolicyFilter" instance.
18 */
19export declare class ExponentialRetryPolicy extends BaseRequestPolicy {
20 /**
21 * The client retry count.
22 */
23 retryCount: number;
24 /**
25 * The client retry interval in milliseconds.
26 */
27 retryInterval: number;
28 /**
29 * The minimum retry interval in milliseconds.
30 */
31 minRetryInterval: number;
32 /**
33 * The maximum retry interval in milliseconds.
34 */
35 maxRetryInterval: number;
36 /**
37 * @constructor
38 * @param {RequestPolicy} nextPolicy The next RequestPolicy in the pipeline chain.
39 * @param {RequestPolicyOptionsLike} options The options for this RequestPolicy.
40 * @param {number} [retryCount] The client retry count.
41 * @param {number} [retryInterval] The client retry interval, in milliseconds.
42 * @param {number} [minRetryInterval] The minimum retry interval, in milliseconds.
43 * @param {number} [maxRetryInterval] The maximum retry interval, in milliseconds.
44 */
45 constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptionsLike, retryCount?: number, retryInterval?: number, minRetryInterval?: number, maxRetryInterval?: number);
46 sendRequest(request: WebResourceLike): Promise<HttpOperationResponse>;
47}
48//# sourceMappingURL=exponentialRetryPolicy.d.ts.map
\No newline at end of file