/** * Removes duplicate values from an array, preserving the order of the first occurrence * of each unique value. * * @param values - An array or readonly array of values to deduplicate. * @returns A new array containing only unique values. * * @example * ```typescript * unique([1, 2, 2, 3, 4, 4, 5]); // [1, 2, 3, 4, 5] * ``` */ export declare const unique: (values: V[] | readonly V[]) => V[]; /** * Removes duplicate values from an array based on a key function, preserving either * the first or last occurrence of each unique key. If * * @param values - An array or readonly array of values to deduplicate. * @param key - A function that creates a unique key for each value. * @param keepFirst - An optional boolean indicating whether to keep the first instance * (`true`, default) or the last instance (`false`) of each unique key. * @returns A new array containing only unique values based on the created keys. * * @example * // Default behavior (keep first instance): * by( * [{ id: 1, name: "A" }, { id: 2, name: "B" }, { id: 1, name: "C" }], * (value) => value.id * ); * // Result: [{ id: 1, name: "A" }, { id: 2, name: "B" }] * * @example * // Keep last instance: * by( * [{ id: 1, name: "A" }, { id: 2, name: "B" }, { id: 1, name: "C" }], * (value) => value.id, * false * ); * // Result: [{ id: 2, name: "B" }, { id: 1, name: "C" }] */ export declare const by: (values: V[] | readonly V[], key: (value: V) => unknown, keepFirst?: boolean) => V[]; //# sourceMappingURL=unique.d.ts.map