import { PlainObject } from "../models.mjs"; //#region src/array/exists.d.ts /** * Does an item with a specific value exist in the array? * * @param array Array to search in * @param callback Callback to get an item's value for matching * @param value Value to match against * @returns `true` if the item exists in the array, otherwise `false` * * @example * ```typescript * exists( * [{id: 1}, {id: 2}, {id: 3}], * item => item.id, * 2, * ); // => true * ``` */ declare function exists unknown>(array: Item[], callback: Callback, value: ReturnType): boolean; /** * Does an item with a specific value exist in the array? * * @param array Array to search in * @param key Key to get an item's value for matching * @param value Value to match against * @returns `true` if the item exists in the array, otherwise `false` * * @example * ```typescript * exists( * [{id: 1}, {id: 2}, {id: 3}], * 'id', * 2, * ); // => true * ``` */ declare function exists(array: Item[], key: ItemKey, value: Item[ItemKey]): boolean; /** * Does an item in the array match the filter? * * @param array Array to search in * @param filter Filter callback to match items * @returns `true` if a matching item exists, otherwise `false` * * @example * ```typescript * exists( * [{id: 1}, {id: 2}, {id: 3}], * item => item.id === 2, * ); // => true * ``` */ declare function exists(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): boolean; /** * Does the item exist in the array? * * @param array Array to search in * @param item Item to search for * @returns `true` if the item exists in the array, otherwise `false` * * @example * ```typescript * exists([1, 2, 3], 2); // => true * ``` */ declare function exists(array: Item[], item: Item): boolean; //#endregion export { exists };