export type TGetUniqueByArgs = Parameters; export type TGetUniqueByReturn = ReturnType; /** * Returns the first item for every unique selector result. * @template T,TKey * @param {T[]} arr Source array * @param {(value: T, index: number, array: T[]) => TKey} getKey Unique key selector * @returns {T[]} New array containing unique items * @throws {TypeError} getUniqueBy: arr must be an array * @throws {TypeError} getUniqueBy: getKey must be a function * @example * getUniqueBy([ { id: 1 }, { id: 1 }, { id: 2 } ], (item) => item.id); * @example * // Remove duplicate products by SKU while preserving the first result * const uniqueProducts = getUniqueBy(products, (product) => product.sku); */ export declare const getUniqueBy: (arr: T[], getKey: (value: T, index: number, array: T[]) => TKey) => T[];