import { Iterable } from '@dojo/shim/iterator'; import { Thenable } from '@dojo/shim/interfaces'; /** * Test whether all elements in the array pass the provided callback * @param items a collection of synchronous/asynchronous values * @param callback a synchronous/asynchronous test * @return eventually returns true if all values pass; otherwise false */ export declare function every(items: Iterable> | (T | Promise)[], callback: Filterer): Promise; /** * Returns an array of elements which pass the provided callback * @param items a collection of synchronous/asynchronous values * @param callback a synchronous/asynchronous test * @return eventually returns a new array with only values that have passed */ export declare function filter(items: Iterable> | (T | Promise)[], callback: Filterer): Promise; /** * Find the first value matching a filter function * @param items a collection of synchronous/asynchronous values * @param callback a synchronous/asynchronous test * @return a promise eventually containing the item or undefined if a match is not found */ export declare function find(items: Iterable> | (T | Promise)[], callback: Filterer): Promise; /** * Find the first index with a value matching the filter function * @param items a collection of synchronous/asynchronous values * @param callback a synchronous/asynchronous test * @return a promise eventually containing the index of the matching item or -1 if a match is not found */ export declare function findIndex(items: Iterable> | (T | Thenable)[], callback: Filterer): Promise; /** * transform a list of items using a mapper function * @param items a collection of synchronous/asynchronous values * @param callback a synchronous/asynchronous transform function * @return a promise eventually containing a collection of each transformed value */ export declare function map(items: Iterable> | (T | Promise)[], callback: Mapper): Promise; /** * reduce a list of items down to a single value * @param items a collection of synchronous/asynchronous values * @param callback a synchronous/asynchronous reducer function * @param [initialValue] the first value to pass to the callback * @return a promise eventually containing a value that is the result of the reduction */ export declare function reduce(this: any, items: Iterable> | (T | Promise)[], callback: Reducer, initialValue?: U): Promise; export declare function reduceRight(this: any, items: Iterable> | (T | Promise)[], callback: Reducer, initialValue?: U): Promise; export declare function series(items: Iterable> | (T | Promise)[], operation: Mapper): Promise; export declare function some(items: Iterable> | Array>, callback: Filterer): Promise; export interface Filterer extends Mapper { } export interface Mapper { (value: T, index: number, array: T[]): U | Thenable; } export interface Reducer { (previousValue: U, currentValue: T, index: number, array: T[]): U | Thenable; }