/** * Advanced array difference function with optional custom comparator. * This is an enhanced utility beyond standard Lodash. * * @param array1 - The first array * @param array2 - The second array * @param comparator - Optional custom comparison function * @returns Returns object with added, removed, and common elements * * @example * arrayDiff([1, 2, 3], [2, 3, 4]); * // => { added: [4], removed: [1], common: [2, 3] } * * arrayDiff( * [{ id: 1 }, { id: 2 }], * [{ id: 2 }, { id: 3 }], * (a, b) => a.id === b.id * ); * // => { added: [{ id: 3 }], removed: [{ id: 1 }], common: [{ id: 2 }] } */ export declare function arrayDiff(array1: readonly T[], array2: readonly T[], comparator?: (a: T, b: T) => boolean): { added: T[]; removed: T[]; common: T[]; }; /** * Partition an array based on a predicate function returning groups. * This is an enhanced utility beyond standard Lodash. * * @param array - The array to partition * @param predicate - The predicate function that returns group keys * @returns Returns object with groups as keys and arrays as values * * @example * partitionBy([1, 2, 3, 4, 5, 6], x => x % 2 === 0 ? 'even' : 'odd'); * // => { even: [2, 4, 6], odd: [1, 3, 5] } * * partitionBy( * ['apple', 'banana', 'apricot', 'blueberry'], * str => str[0] * ); * // => { a: ['apple', 'apricot'], b: ['banana', 'blueberry'] } */ export declare function partitionBy(array: readonly T[], predicate: (value: T, index: number, array: readonly T[]) => string): Record; /** * Creates an array of unique values that are included in all given arrays, * using SameValueZero for equality comparisons. * * @param arrays - The arrays to inspect * @returns Returns the new array of intersecting values * * @example * intersection([2, 1], [2, 3]); * // => [2] */ export declare function intersection(...arrays: readonly T[][]): T[]; /** * This method is like `intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion * by which they're compared. * * @param arrays - The arrays to inspect * @param iteratee - The iteratee invoked per element * @returns Returns the new array of intersecting values */ export declare function intersectionBy(...args: [...arrays: readonly T[][], iteratee: (value: T) => U]): T[]; /** * This method is like `intersection` except that it accepts `comparator` * which is invoked to compare elements of `arrays`. * * @param arrays - The arrays to inspect * @param comparator - The comparator invoked per element * @returns Returns the new array of intersecting values */ export declare function intersectionWith(...args: [ ...arrays: readonly T[][], comparator: (arrVal: T, othVal: T) => boolean ]): T[];