/** * Remove duplicates from array */ export declare function unique(array: T[]): T[]; /** * Remove duplicates from array of objects by key */ export declare function uniqueBy(array: T[], keyFn: (item: T) => any): T[]; /** * Group array items by key function */ export declare function groupBy(array: T[], keyFn: (item: T) => K): Record; /** * Sort array by multiple criteria */ export declare function sortBy(array: T[], ...keyFns: ((item: T) => any)[]): T[]; /** * Partition array into two groups based on predicate */ export declare function partition(array: T[], predicate: (item: T) => boolean): [T[], T[]]; /** * Find item in array by predicate, or return default value */ export declare function findOrDefault(array: T[], predicate: (item: T) => boolean, defaultValue: T): T; /** * Get random sample from array */ export declare function sample(array: T[], count?: number): T[]; /** * Create chunks of specified size from array */ export declare function chunk(array: T[], size: number): T[][]; /** * Flatten nested arrays */ export declare function flatten(arrays: T[][]): T[]; /** * Deep flatten nested arrays */ export declare function flattenDeep(arrays: any[]): T[]; /** * Create sliding window of specified size */ export declare function slidingWindow(array: T[], size: number): T[][]; /** * Calculate intersection of multiple arrays */ export declare function intersection(...arrays: T[][]): T[]; /** * Calculate union of multiple arrays */ export declare function union(...arrays: T[][]): T[]; /** * Calculate difference between arrays */ export declare function difference(array1: T[], array2: T[]): T[]; /** * Move item from one index to another */ export declare function move(array: T[], fromIndex: number, toIndex: number): T[]; /** * Rotate array by specified number of positions */ export declare function rotate(array: T[], positions: number): T[]; /** * Check if array is empty */ export declare function isEmpty(array: T[]): boolean; /** * Get last element of array safely */ export declare function last(array: T[]): T | undefined; /** * Get first element of array safely */ export declare function first(array: T[]): T | undefined; /** * Remove item from array by value */ export declare function remove(array: T[], item: T): T[]; //# sourceMappingURL=array.d.ts.map