//#region src/array/intersection.d.ts /** * Get the common values between two arrays * * @param first First array * @param second Second array * @param callback Callback to get an item's value for comparison * @returns Common values from both arrays * * @example * ```typescript * intersection( * [{id: 1}, {id: 2}, {id: 3}], * [{id: 2}, {id: 3}, {id: 4}], * item => item.id, * ); // => [{id: 2}, {id: 3}] * ``` */ declare function intersection(first: First[], second: Second[], callback: (item: First | Second) => unknown): First[]; /** * Get the common values between two arrays * * @param first First array * @param second Second array * @param key Key to get an item's value for comparison * @returns Common values from both arrays * * @example * ```typescript * intersection( * [{id: 1}, {id: 2}, {id: 3}], * [{id: 2}, {id: 3}, {id: 4}], * 'id', * ); // => [{id: 2}, {id: 3}] * ``` */ declare function intersection, Second extends Record, SharedKey extends keyof First & keyof Second>(first: First[], second: Second[], key: SharedKey): First[]; /** * Get the common values between two arrays * * @param first First array * @param second Second array * @returns Common values from both arrays * * @example * ```typescript * intersection( * [1, 2, 3], * [2, 3, 4], * ); // => [2, 3] * ``` */ declare function intersection(first: First[], second: Second[]): First[]; //#endregion export { intersection };