import { Logger } from './logger'; /** Sleep for a number of milliseconds */ export declare function sleep(ms: number): Promise; declare type InFunction = (...params: T) => Promise; export declare const retryAsync: (inFunction: InFunction, tries: number, params: T, delay?: number, logger?: Logger | null) => Promise; export declare const retryAsyncWithBackOff: (inFunction: InFunction, tries: number, params: T, delay?: number, factor?: number, logger?: Logger | null) => Promise; export declare const selectiveRetryAsyncWithBackOff: (inFunction: InFunction, tries: number, dontRetry: string[], params: T, delay?: number, factor?: number, logger?: Logger | null) => Promise; export declare const retryAsyncWithBackOffAndTimeout: (inFunction: InFunction, tries: number, params: T, delayMs?: number, factor?: number, timeoutMs?: number, logger?: Logger | null) => Promise; /** * Map an async function over a list xs with a given concurrency level * * @param concurrency number of `mapFn` concurrent executions * @param xs list of value * @param mapFn mapping function */ export declare function concurrentMap(concurrency: number, xs: A[], mapFn: (val: A, idx: number) => Promise): Promise; /** * Map an async function over the values in Object x with a given concurrency level * * @param concurrency number of `mapFn` concurrent executions * @param x associative array of values * @param mapFn mapping function */ export declare function concurrentValuesMap(concurrency: number, x: Record, mapFn: (val: IN, key: string) => Promise): Promise>; /** * Wraps an async function in a timeout before calling it. * * @param inFunction The async function to call * @param params The parameters of the async function * @param timeoutMs The timeout in milliseconds * @param timeoutError The value to which the returned Promise should reject to */ export declare const timeout: (inFunction: InFunction, params: T, timeoutMs: number, timeoutError: any, timeoutLogMsg?: string | null, logger?: Logger | null) => Promise>; export {};