/**
 * Returns a promise that is resolved after the given number of milliseconds
 * have elapsed.
 *
 * @param ms The number of milliseconds to wait for.
 */
export declare function delay(ms?: number): Promise<void>;
/**
 * Returns a promise that will be fulfilled with the given promise's fulfillment
 * value or rejection reason. However, if the promise is not resolved within
 * `ms` milliseconds, the returned promise is rejected with an error.
 *
 * @param ms The number of milliseconds to wait for the promise to resolve.
 * @param promise The promise to wait for.
 * @param message The message or error to throw if the promise times out.
 */
export declare function timeout<T>(ms: number, promise: Promise<T>, message?: string | Error): Promise<T>;
/**
 * Map an array, or a promise of an array, which contains promises (or a mix of
 * promises and values) with the given mapper function with the signature
 * `(item, index)` where `item` is the resolved value of a respective promise in
 * the input array. If any promise in the input array is rejected the returned
 * promise is rejected as well.
 *
 * If the mapper function returns promises or then-ables, the returned promise
 * will wait for all the mapped results to be resolved as well.
 *
 * The mapper function for a given item is called as soon as possible, that is,
 * when the promise for that item's index in the input array is fulfilled. This
 * means that multiple promises may be pending concurrently, and that the mapper
 * function may not be applied to elements in the order that they appear in the
 * original array. However, items in the resulting array will always appear in
 * the same order as the input items.
 *
 * @param values The array of values to map over.
 * @param mapper The mapper function to apply to each element.
 */
export declare function map<T, U>(values: PromiseLike<Iterable<T | PromiseLike<T>>> | Iterable<T | PromiseLike<T>>, mapper: (item: T, index: number) => U | PromiseLike<U>): Promise<U[]>;
/**
 * Iterate over an array, or a promise of an array, which contains promises (or
 * a mix of promises and values) with the given iterator function with the
 * signature `(item, index)` where `item` is the resolved value of a respective
 * promise in the input array. Iteration happens serially. If any promise in the
 * input array is rejected the returned promise is rejected as well.
 *
 * If the iterator function returns a promise or a thenable, the result for the
 * promise is awaited for before continuing with next iteration.
 *
 * @param values The array of values to iterate over.
 * @param iterator The iterator function to apply to each element.
 */
export declare function each<T>(values: Iterable<T | PromiseLike<T>> | PromiseLike<Iterable<T | PromiseLike<T>>>, iterator: (item: T, index: number) => void | PromiseLike<void>): Promise<void>;
/**
 * Same as {@link each}, except that the elements are processed in parallel
 * rather than sequentially.
 *
 * @param values The array of values to iterate over.
 * @param iterator The iterator function to apply to each element.
 */
export declare function parallelEach<T, U>(values: Iterable<T | PromiseLike<T>> | PromiseLike<Iterable<T | PromiseLike<T>>>, iterator: (item: T, index: number) => U | PromiseLike<U>): Promise<void>;
/**
 * Reduce an array, or a promise of an array, which contains a promises (or a
 * mix of promises and values) with the given reducer function with the
 * signature `(total, current, index)` where `current` is the resolved value of
 * a respective promise in the input array. If any promise in the input array is
 * rejected the returned promise is rejected as well.
 *
 * If the reducer function returns a promise or a thenable, the result for the
 * promise is awaited for before continuing with next iteration.
 *
 * The original array is not modified. If no `initialValue` is given and the
 * array doesn't contain at least 2 items, the callback will not be called and
 * `undefined` is returned. If no `initialValue` is given and the array contains
 * at least two items, the first element is used as the initial value. If
 * `initialValue` is given and the array doesn't have at least 1 item,
 * `initialValue` is returned.
 *
 * @param values The array of values to iterate over.
 * @param reducer The reducer function.
 * @param initialValue Optional. The initial seed value for the reducer
 *   function.
 */
export declare function reduce<T, U>(values: Iterable<T | PromiseLike<T>> | PromiseLike<Iterable<T | PromiseLike<T>>>, reducer: (total: U, current: T, index: number) => U | PromiseLike<U>, initialValue: U): Promise<U>;
export declare function reduce<T, U>(values: Iterable<T | PromiseLike<T>> | PromiseLike<Iterable<T | PromiseLike<T>>>, reducer: (total: U, current: T, index: number) => U | PromiseLike<U>): Promise<U | undefined>;
type Awaited<T> = T extends PromiseLike<infer PT> ? PT : T;
/**
 * Like `Promise.all` but for object properties instead of array items. Returns
 * a promise that is fulfilled when all the properties of the object are
 * fulfilled. The promise's fulfillment value is an object with fulfillment
 * values at respective keys to the original object. If any promise in the
 * object rejects, the returned promise is rejected with the rejection reason.
 *
 * If `object` is a promise, then it will be treated as a promise for object
 * rather than for its properties. All other objects are treated for their
 * properties as returned by `Object.keys` - the object's own enumerable
 * properties.
 *
 * @param object The object containing promises.
 */
export declare function props<T extends object>(object: T | Promise<T>): Promise<{
    [K in keyof T]: Awaited<T[K]>;
}>;
/**
 * A function that executes the `mapFunc` function on each item in `items` and
 * then concatenates the results.
 *
 * @param items The items to be concatenated.
 * @param mapFunc The function used to concatenate the items.
 */
export declare function asyncFlatMap<T, T2>(items: T[], mapFunc: (item: T) => Promise<T2[]>): Promise<T2[]>;
export {};
