PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@celo/base/lib

Просмотр файла: async.d.ts

import { Logger } from './logger';
/** Sleep for a number of milliseconds */
export declare function sleep(ms: number): Promise<void>;
declare type InFunction<T extends any[], U> = (...params: T) => Promise<U>;
export declare const retryAsync: <T extends any[], U>(inFunction: InFunction<T, U>, tries: number, params: T, delay?: number, logger?: Logger | null) => Promise<U>;
export declare const retryAsyncWithBackOff: <T extends any[], U>(inFunction: InFunction<T, U>, tries: number, params: T, delay?: number, factor?: number, logger?: Logger | null) => Promise<U>;
export declare const selectiveRetryAsyncWithBackOff: <T extends any[], U>(inFunction: InFunction<T, U>, tries: number, dontRetry: string[], params: T, delay?: number, factor?: number, logger?: Logger | null) => Promise<U>;
export declare const retryAsyncWithBackOffAndTimeout: <T extends any[], U>(inFunction: InFunction<T, U>, tries: number, params: T, delayMs?: number, factor?: number, timeoutMs?: number, logger?: Logger | null) => Promise<U>;
/**
 * 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<A, B>(concurrency: number, xs: A[], mapFn: (val: A, idx: number) => Promise<B>): Promise<B[]>;
/**
 * 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<IN extends any, OUT extends any>(concurrency: number, x: Record<string, IN>, mapFn: (val: IN, key: string) => Promise<OUT>): Promise<Record<string, OUT>>;
/**
 * 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: <T extends any[], U>(inFunction: InFunction<T, U>, params: T, timeoutMs: number, timeoutError: any, timeoutLogMsg?: string | null, logger?: Logger | null) => Promise<Awaited<U>>;
export {};

Выполнить команду


Для локальной разработки. Не используйте в интернете!