import type { ConstructorOf } from "../core.js"; /** * Places the items in the array in random order. * The array is shuffled in-place, no copy is created. The returned array is exactly the passed array. * @param array - The array to shuffle. * @typeParam TElements - The type of the elements in the array. * @returns The passed array in random order. */ export declare const shuffleArray: (array: Array) => TElements[]; /** * Returns an array that holds all items that appear in both * passed arrays. * @param a - The first array. * @param b - The second array. * @typeParam TElements - The type of the elements in the array. * @returns A new array which holds the items that appear in * both passed arrays. */ export declare const intersect: (a: Array, b: Array) => TElements[]; /** * Returns an array that holds all items that only appear in `a`. * @param a - The first array. * @param b - The second array. * @typeParam TElements - The type of the elements in the array. * @returns A new array which holds the items that ony appear in `a`. */ export declare const difference: (a: Array, b: Array) => TElements[]; /** * From an array with unknown contents, retrieve all the elements * that are of a certain type and return them as a new array. * @param array - The array to filter. * @param InstanceType - The type to search for. * @typeParam TElements - The type of the elements in the array. * @returns A new array with the filtered items. */ export declare const filterType: (array: Array, InstanceType: ConstructorOf) => Array; /** * From an iterable with unknown contents, yield arrays that contain items from * the iterable up to a given limit. * @param iterable - The iterable to retrieve items from. * @param limit - The amount of items in each chunk. * @typeParam TElements - The type of the elements in the iterable. * @yields Chunks from the provided iterable. */ export declare const chunkify: (iterable: Iterable, limit: number) => Generator; /** * Group all elements of the input array, that produce the same identity, * into a new array. * @param array - The array with the items to group. * @param ident - Callback that identifies the group of the element. * @typeParam TElements - The type of the elements in the array. * @typeParam TGroupKey - The type of the group identifier. * @returns A map that correlates the group key to an array of all elements with that group key. */ export declare const groupBy: (array: Array, ident: (element: TElements) => TGroupKey) => Map>; /** * Generate an array with all numbers from start to end inclusive. * @param start - The first number in the array. * @param end - The last number in the array. * @returns An array with all numbers in the requested range. */ export declare const range: (start: number, end: number) => Array;