import { PlainObject } from "../models.mjs"; //#region src/array/filter.d.ts /** * Get a filtered array of items that do not match the value * * _Available as `exclude` and `filter.remove`_ * * @param array Array to search in * @param callback Callback to get an item's value for matching * @param value Value to match against * @returns Filtered array of items that do not match the filter * * @example * ```typescript * exclude( * [{id: 1}, {id: 2}, {id: 3}], * item => item.id, * 2, * ); // => [{id: 1}, {id: 3}] * ``` */ declare function exclude unknown>(array: Item[], callback: Callback, value: ReturnType): unknown[]; /** * Get a filtered array of items that do not match the value * * _Available as `exclude` and `filter.remove`_ * * @param array Array to search in * @param key Key to get an item's value for matching * @param value Value to match against * @returns Filtered array of items that do not match the filter * * @example * ```typescript * exclude( * [{id: 1}, {id: 2}, {id: 3}], * 'id', * 2, * ); // => [{id: 1}, {id: 3}] * ``` */ declare function exclude(array: Item[], key: ItemKey, value: Item[ItemKey]): unknown[]; /** * Get a filtered array of items that do not match the filter * * _Available as `exclude` and `filter.remove`_ * * @param array Array to search in * @param filter Filter callback to match items * @returns Filtered array of items that do not match the filter * * @example * ```typescript * exclude( * [{id: 1}, {id: 2}, {id: 3}], * item => item.id === 2, * ); // => [{id: 1}, {id: 3}] * ``` */ declare function exclude(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): unknown[]; /** * Get a filtered array of items that do not match the given item * * _Available as `exclude` and `filter.remove`_ * * @param array Array to search in * @param item Item to match against * @returns Filtered array of items that do not match the given item * * @example * ```typescript * exclude([1, 2, 3], 2); // => [1, 3] * ``` */ declare function exclude(array: Item[], item: Item): unknown[]; /** * Get a filtered array of items * * @param array Array to search in * @param callback Callback to get an item's value for matching * @param value Value to match against * @returns Filtered array of items * * @example * ```typescript * filter( * [{id: 1}, {id: 2}, {id: 3}], * item => item.id, * 2, * ); // => [{id: 2}] * ``` */ declare function filter unknown>(array: Item[], callback: Callback, value: ReturnType): Item[]; /** * Get a filtered array of items * * @param array Array to search in * @param key Key to get an item's value for matching * @param value Value to match against * @returns Filtered array of items * * @example * ```typescript * filter( * [{id: 1}, {id: 2}, {id: 3}], * 'id', * 2, * ); // => [{id: 2}] * ``` */ declare function filter(array: Item[], key: ItemKey, value: Item[ItemKey]): Item[]; /** * Get a filtered array of items matching the filter * * @param array Array to search in * @param filter Filter callback to match items * @returns Filtered array of items * * @example * ```typescript * filter( * [{id: 1}, {id: 2}, {id: 3}], * item => item.id === 2, * ); // => [{id: 2}] * ``` */ declare function filter(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item[]; /** * Get a filtered array of items matching the given item * * @param array Array to search in * @param item Item to match against * @returns Filtered array of items * * @example * ```typescript * filter([1, 2, 3], 2); // => [2] * ``` */ declare function filter(array: Item[], item: Item): Item[]; declare namespace filter { var remove: typeof exclude; } //#endregion export { exclude, filter };