/**
 * Flattens an array of arrays into a single array.
 *
 * @param arrays An array of arrays.
 */
export declare function flatten<T>(arrays: T[][]): T[];
/**
 * Returns an array of numbers between `start` and `end` (inclusive).
 *
 * @param start The first number in the range.
 * @param end The last number in the range.
 */
export declare function range(start: number, end: number): number[];
/**
 * Counts how many items match the criteria in the callback function.
 *
 * @param array The array.
 * @param callbackfn The filtering function.
 * @returns The number of items that match the filter.
 */
export declare function count<T>(array: T[], callbackfn: (value: T, index: number, array: T[]) => boolean): number;
/**
 * Removes the first occurrence of an item from an array.
 *
 * @param array The array to search for the item.
 * @param item The item to remove.
 * @returns True if the item was removed, false otherwise.
 */
export declare function remove<T>(array: T[], item: T): boolean;
/**
 * Splits up a string into chunks of the given size.
 *
 * @param str The string to split.
 * @param size The chunk size.
 */
export declare function chunk(str: string, size: number): string[];
/**
 * Splits up an array into chunks of the given size.
 *
 * @param array The array to split.
 * @param size The chunk size.
 */
export declare function chunk<T>(array: T[], size: number): T[][];
/**
 * Groups items by grouping function.
 *
 * @param array The items to group.
 * @param getKey A function that returns a key indicating which group the item
 *   belongs to.
 * @returns An object containing groups, keyed by group key. The order of items
 *   is preserved within each group.
 */
export declare function groupBy<T, K>(array: T[], getKey: (item: T, index: number) => K): Map<K, T[]>;
/**
 * Options that can be passed to {@link compare}.
 */
export interface CompareOptions<T, U> {
    /**
     * Invoked for each item in the second array that isn't in the first.
     *
     * @param item The new item.
     * @param index The index of the new item in the second array.
     */
    onNew?: (item: U, index: number) => void | Promise<void>;
    /**
     * Invoked for each pair of items in the first and second arrays that are
     * considered equivalent. Note that if there are multiple items in the
     * second array that could match a given item in the first, the callback
     * will only be invoked for the first match.
     *
     * @param item1 The item in the first array.
     * @param item2 The item in the second array that is equal to the first.
     * @param index1 The index of the item in the first array.
     * @param index2 The index of the item in the second array.
     */
    onMatch?: (item1: T, item2: U, index1: number, index2: number) => void | Promise<void>;
    /**
     * Invoked for each item in the first array that isn't in the second.
     *
     * @param item The missing item.
     * @param index The index of the missing item in the first array.
     */
    onMissing?: (item: T, index: number) => void | Promise<void>;
    /**
     * A custom function for determining equality. If not specified, strict
     * equality (===) is used.
     */
    equals?: (item1: T, item2: U) => boolean;
}
/**
 * Compares two arrays and invokes callbacks for items that are new, missing, or
 * matching in the second collection relative to the first.
 *
 * @param items1 The first array or iterable object.
 * @param items2 The second array or iterable object to compare to the first.
 * @param options Options specifying the callbacks to invoke.
 */
export declare function compareAsync<T, U>(items1: Iterable<T>, items2: Iterable<U>, options: CompareOptions<T, U>): Promise<void>;
/**
 * Compares two arrays and invokes callbacks for items that are new, missing, or
 * matching in the second collection relative to the first.
 *
 * @param items1 The first array or iterable object.
 * @param items2 The second array or iterable object to compare to the first.
 * @param options Options specifying the callbacks to invoke.
 */
export declare function compare<T, U>(items1: Iterable<T>, items2: Iterable<U>, options: CompareOptions<T, U>): void;
