/** * Randomly shuffles the elements of an array in place using the Fisher–Yates algorithm. * * This implementation ensures a uniform distribution of permutations. * Original algorithm source: StackOverflow (link above). * * @reference https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array * * @template {any[]} T * @param {T} items - The array to shuffle. * @returns {T} The same array instance, now shuffled in place. */ export declare function shuffleArray(items: T): T; /** * Generates an array with repeated phases according to counts. * * @template {any} BlockValue * @param {BlockValue[]} phases - Array of phase names, e.g., ['Full', 'Half1', 'Half2', 'New']. * @param {number[]} counts - Array of integers specifying how many times to repeat each phase, e.g., [4,5,5,4]. * @returns {BlockValue[]} - Flattened array containing phases repeated according to counts, concatenated in order. */ export declare function multiplyArrayBlocks(phases: BlockValue[], counts: number[]): BlockValue[]; export type DiffArrayListData = { /** * - Items that only exist in the new array. */ added: T[]; /** * - Items that only existed in the old array. */ removed: T[]; }; /** * @template T * @typedef {Object} DiffArrayListData * @property {T[]} added - Items that only exist in the new array. * @property {T[]} removed - Items that only existed in the old array. */ /** * Diff two class lists. * @template T * @param {T[]} oldItems - The original/old array for comparison. * @param {T[]} newItems - The new array for comparison. * @returns {DiffArrayListData} An object containing arrays of added and removed items. */ export declare function diffArrayList(oldItems: T[], newItems: T[]): DiffArrayListData; /** * Generates a comparator function to sort an array of objects by a given key. * * @param {string|null} [item] - The object key to sort by. * @param {boolean} [isReverse=false] - If `true`, the sorting will be in descending order. * @returns {(a: Object, b: Object) => number} Comparator function compatible with Array.prototype.sort(). * * @example * const arr = [{ pos: 2 }, { pos: 1 }, { pos: 3 }]; * arr.sort(arraySortPositions('pos')); // Ascending: [{pos: 1}, {pos: 2}, {pos: 3}] * * @example * const arr = [{ pos: 2 }, { pos: 1 }, { pos: 3 }]; * arr.sort(arraySortPositions('pos', true)); // Descending: [{pos: 3}, {pos: 2}, {pos: 1}] */ export declare function arraySortPositions(item?: string | null, isReverse?: boolean): (a: any, b: any) => number; //# sourceMappingURL=array.d.mts.map