Skip to content

Commit

Permalink
fix: types (#109)
Browse files Browse the repository at this point in the history
* fix: types

Used `npm link` to verify in another library.

* fix: docs + `getNextRetryDelay`'s signature
  • Loading branch information
danielbankhead committed Oct 12, 2023
1 parent 90aaaeb commit 35c0260
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions index.d.ts
Expand Up @@ -2,12 +2,22 @@ declare module 'retry-request' {
import * as request from 'request';
import * as teenyRequest from 'teeny-request';

type teenyRequestFunction = typeof teenyRequest extends Function
? typeof teenyRequest
: never;

namespace retryRequest {
defaults = retryRequest.Options;
function getNextRetryDelay(retryNumber: number): void;
/**
* Set the defaults for `retryRequest`.
*/
const defaults: retryRequest.Options;
/**
* Determines the next retry based on the provided configuration.
*/
function getNextRetryDelay(config: Options): number;
interface Options {
objectMode?: boolean;
request: typeof request | typeof teenyRequest;
request: typeof request | teenyRequestFunction;
retries?: number;
noResponseRetries?: number;
currentRetryAttempt?: number;
Expand Down

0 comments on commit 35c0260

Please sign in to comment.