import { n as NestedArray } from "./types-BCtWYsuv.cjs";

//#region src/common/data/array.d.ts
/**
 * Return a new array with duplicate values removed. Maintains first occurrence order.
 * @typeParam T - element type
 * @param arr - input array
 * @returns new array containing unique elements from `arr`
 */
declare function arrayUnique<T>(arr: T[]): T[];
/**
 * Return elements present in `x` but not in `y`.
 * @typeParam T - element type
 * @param left - left-hand array
 * @param right - array of elements to exclude
 * @returns new array with elements from `left` that are not included in `right`
 */
declare function arrayMinus<T>(left: T[], right: T[]): T[];
/**
 * Return the union of multiple arrays (unique elements across all inputs).
 * @typeParam T - element type
 * @param arrays - arrays to union
 * @returns new array with unique elements from all provided arrays
 */
declare function arrayUnion<T>(...arrays: T[][]): T[];
/** `[1,[2,3]]` becomes `[1,2,3]` */
/**
 * Flatten nested arrays to a single-level array.
 * Example: `[1, [2, 3]]` becomes `[1, 2, 3]`.
 * @typeParam T - element type
 * @param arrays - one or more nested arrays to flatten
 * @returns flattened array containing all elements
 */
declare function arrayFlatten<T>(...arrays: NestedArray<T>[]): T[];
/**
 * Return the intersection of two arrays (elements present in both).
 * @typeParam T - element type
 * @param left - first array
 * @param right - second array
 * @returns new array with elements present in both `left` and `right`
 */
declare function arrayIntersection<T>(left: T[], right: T[]): T[];
/**
 * Return the symmetric difference between two arrays (elements in either array but not both).
 * @typeParam T - element type
 */
declare function arraySymmetricDifference<T>(left: T[], right: T[]): T[];
/**
 * Remove all occurrences of `el` from `arr` in-place and return the mutated array.
 * If `arr` is not an array, returns an empty array.
 * @typeParam T - element type
 * @param arr - array to modify
 * @param el - element to remove
 * @returns the same array instance with `el` removed
 */
declare function arrayRemoveElement<T>(arr: T[], el: T): T[];
/** Only have it once in the set */
/**
 * Ensure `el` exists in `arr`. If not present, push it and return the array.
 * @typeParam T - element type
 * @param arr - target array
 * @param el - element to ensure
 * @returns the same array instance (modified if `el` was added)
 */
declare function arraySetElement<T>(arr: T[], el: T): T[];
/**
 * Filter an array in-place using `fn` and return the same array instance.
 * This replaces the array contents with the filtered result.
 * @typeParam T - element type
 * @param arr - array to filter in-place
 * @param fn - predicate to determine which elements to keep
 * @returns the same array instance after filtering
 */
declare function arrayFilterInPlace<T>(arr: T[], fn: (el: T) => boolean): T[];
/**
 * Toggle presence of `el` in `array` in-place: remove if present, add if missing.
 * @typeParam T - element type
 * @param arr - array to modify
 * @param el - element to toggle
 * @returns the same array instance after the toggle
 */
declare function arrayToggleInPlace<T>(arr: T[], el: T): T[];
/**
 * Empty an array in-place (remove all elements) and return it.
 * @typeParam T - element type
 */
declare function arrayEmptyInPlace<T>(arr: T[]): T[];
/**
 * Replace the contents of `array` in-place with `newContent` and return it.
 * @typeParam T - element type
 * @param arr - target array to overwrite
 * @param newContent - new contents to set
 * @returns the same array instance after replacement
 */
declare function arraySetArrayInPlace<T>(arr: T[], newContent: T[]): T[];
/**
 * Return a sorted copy of the provided iterable or array-like object.
 * @typeParam T - element type
 * @param arr - iterable or array-like input
 * @param compareFn - optional compare function (defaults to `cmp`)
 * @returns a new array sorted according to `compareFn`
 */
declare function arraySorted<T>(arr: Iterable<T> | ArrayLike<T>, compareFn?: ((a: T, b: T) => number) | undefined): T[];
/**
 * Return a new array with numbers sorted in ascending order.
 * @param arr - array of numbers
 * @returns sorted array of numbers
 */
declare function arraySortedNumbers(arr: number[]): number[];
/**
 * Check strict equality of two arrays by length and element-wise === comparison.
 * @typeParam T - element type
 * @param array1 - first array
 * @param array2 - second array
 * @returns `true` if arrays are same length and all elements strictly equal
 */
declare function arrayIsEqual<T>(array1: T[], array2: T[]): boolean;
/**
 * Shuffle an array in-place using a secure random source if available.
 * Note: uses Array.sort with random comparator which is sufficient for many cases but
 * not perfectly uniform. Returns the same mutated array.
 * @typeParam T - element type
 * @param array - array to shuffle in-place
 * @returns the shuffled array (same instance)
 */
declare function arrayShuffleInPlace<T>(arr: T[]): T[];
/**
 * Return a shuffled copy of `array` (original array is not modified).
 * @typeParam T - element type
 * @param array - input array
 * @returns a new shuffled array
 */
declare function arrayShuffle<T>(arr: T[]): T[];
/** Randomly shuffle the order of the array's elements. Force to have a different order if array has more than one element. */
/**
 * Shuffle `array` and ensure the returned order differs from the original when possible.
 * If array length is 0 or 1 it is returned unchanged.
 * @typeParam T - element type
 * @param array - input array
 * @returns a shuffled array that's different from the input when feasible
 */
declare function arrayShuffleForce<T>(arr: T[]): T[];
/**
 * Return a random element from `array` using a secure random source if available.
 * @typeParam T - element type
 * @param array - input array (must be non-empty)
 * @returns a randomly selected element
 */
declare function arrayRandomElement<T>(arr: T[]): T;
/**
 * Return the maximum value from one or more nested arrays.
 * Uses the `>` operator for comparison.
 * @typeParam T - element type (should support `>` comparison)
 * @param arrays - nested arrays to search
 * @returns the maximum value or `undefined` if no elements present
 */
declare function arrayMax<T>(...arrays: NestedArray<T>[]): T;
/**
 * Return the minimum value from one or more nested arrays.
 * Uses the `<` operator for comparison.
 * @typeParam T - element type (should support `<` comparison)
 * @param arrays - nested arrays to search
 * @returns the minimum value or `undefined` if no elements present
 */
declare function arrayMin<T>(...arrays: NestedArray<T>[]): T;
/**
 * Sum all numbers in one or more nested arrays.
 * @param arrays - nested arrays of numbers
 * @returns the numeric sum (0 for empty input)
 */
declare function arraySum(...arrays: NestedArray<number>[]): number;
/**
 * Compute the average of numbers across one or more nested arrays.
 * @param arrays - nested arrays of numbers
 * @returns arithmetic mean (NaN if there are no elements)
 */
declare function arrayAvg(...arrays: NestedArray<number>[]): number;
/**
 * Split an array into chunks of `chunkLength` (last chunk may be smaller).
 * @typeParam T - element type
 * @param arr - input array
 * @param chunkLength - chunk size (positive integer)
 * @returns array of chunk arrays
 */
declare function arrayBatches<T>(arr: T[], chunkLength: number): T[][];
/**
 * Create an array of given `length` filled with `item` or the result of `item(index)`.
 * If `length` is <= 0 an empty array is returned.
 * @typeParam T - element type
 * @param length - desired length of the array
 * @param item - value to fill or a function producing a value per index
 * @returns newly created array of length `length`
 */
declare function createArray<T>(length?: number, item?: T | ((index: number) => T)): T[];
//#endregion
export { arrayUnion as C, arrayToggleInPlace as S, createArray as T, arrayShuffleInPlace as _, arrayFlatten as a, arraySum as b, arrayMax as c, arrayRandomElement as d, arrayRemoveElement as f, arrayShuffleForce as g, arrayShuffle as h, arrayFilterInPlace as i, arrayMin as l, arraySetElement as m, arrayBatches as n, arrayIntersection as o, arraySetArrayInPlace as p, arrayEmptyInPlace as r, arrayIsEqual as s, arrayAvg as t, arrayMinus as u, arraySorted as v, arrayUnique as w, arraySymmetricDifference as x, arraySortedNumbers as y };
//# sourceMappingURL=array-Dwd6BYuK.d.cts.map