UNPKG

websocket-ts

Version:

<div> <div align="center"> <img src="https://raw.githubusercontent.com/jjxxs/websocket-ts/gh-pages/websocket-ts-logo.svg" alt="websocket-ts" width="300" height="65" /> </div> <p align="center"> <img src="https://github.com/jjxxs/websocket-ts

27 lines (23 loc) 632 B
/** * A Backoff produces a series of numbers that are used to determine * the delay between connection-retries. Values are expected to be in milliseconds. */ export interface Backoff { /** * The number of retries. Starts at 0, increases by 1 for each call to next(). Resets to 0 when reset() is called. */ readonly retries: number; /** * Current number in the series. */ readonly current: number; /** * Advances the series to the next number and returns it. * @return the next number in the series */ next(): number; /** * Resets the series to its initial state. */ reset(): void; }