{"version":3,"file":"DefaultReconnectPolicy.js","sourceRoot":"","sources":["../../src/DefaultReconnectPolicy.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,+GAA+G;;AAI/G,wDAAwD;AACxD,IAAM,oCAAoC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAE3E,eAAe;AACf;IAGI,gCAAY,WAAsB;QAC9B,IAAI,CAAC,WAAW,GAAG,WAAW,KAAK,SAAS,CAAC,CAAC,CAAK,WAAW,SAAE,IAAI,GAAE,CAAC,CAAC,oCAAoC,CAAC;IACjH,CAAC;IAEM,6DAA4B,GAAnC,UAAoC,YAA0B;QAC1D,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAC7D,CAAC;IACL,6BAAC;AAAD,CAAC,AAVD,IAUC;AAVY,wDAAsB","sourcesContent":["// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\r\n\r\nimport { IRetryPolicy, RetryContext } from \"./IRetryPolicy\";\r\n\r\n// 0, 2, 10, 30 second delays before reconnect attempts.\r\nconst DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];\r\n\r\n/** @private */\r\nexport class DefaultReconnectPolicy implements IRetryPolicy {\r\n private readonly retryDelays: Array;\r\n\r\n constructor(retryDelays?: number[]) {\r\n this.retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;\r\n }\r\n\r\n public nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null {\r\n return this.retryDelays[retryContext.previousRetryCount];\r\n }\r\n}\r\n"]}