type FlatArray = { done: T; recur: T extends ReadonlyArray ? FlatArray : T; }[Depth extends -1 ? "done" : "recur"]; declare const ArrayUtils: { /** * Checks if the given value is an array. * @param array - The value to check if it is an array. * @returns Whether the value is an array. */ isArray: (array: unknown) => array is unknown[]; /** * Concatenates the given arrays, or elements in a new array. * @param first - The first array to concatenate. * @param items - The arrays to concatenate. * @returns The concatenated array. */ concat: { (first: T, ...items: Array>): T[]; (first: Array, ...items: Array | T>): T[]; (...items: Array | T>): T[]; }; /** * Flattens the given array to a new array with all sub-array elements concatenated into it recursively up to the specified depth. * @param array - The array to flatten. * @param depth - The depth to flatten the array to. * @returns The flattened array. */ flat: (array: Array, depth?: Depth) => Array>; /** * map the given array with the given function and flatten the result. * @param array - The array to map and flatten. * @param func - The function to apply to each element of the array. * @returns The flattened array. */ flatMap: (array: Array, func: (item: T, index: number, array: ReadonlyArray) => ReadonlyArray | U) => Array; /** * Reverses the given array. does change the original array. * @param array - The array to reverse. * @returns The reversed array. */ reverse: (array: Array) => Array; /** * Returns a new array that is the reverse of the given array to a new array. */ toReversed: (array: Array) => Array; /** * Returns a new array that is a slice of the given array. * @param array - The array to slice. * @param start - The start index of the slice. * @param end - The end index of the slice. * @returns The sliced array. */ slice: (array: Array, start?: number, end?: number) => Array; /** * Removes or replaces existing elements and/or adds new elements in place. does change the original array. and returns the removed elements. * @param array - The array to splice. * @param start - The start index of the splice. * @param count - The number of elements to remove. * @param items - The items to add to the array. * @returns The spliced array. */ splice: (array: Array, start: number, count: number, ...items: T[]) => Array; }; export default ArrayUtils;