/** * Creates a shallow copy of a portion of a given array, filtered down to just * the elements from the given array that pass the test implemented by the * provided function. Equivalent to `Array.prototype.filter`. * * @param data - The array to filter. * @param predicate - A function to execute for each element in the array. It * should return `true` to keep the element in the resulting array, and `false` * otherwise. A type-predicate can also be used to narrow the result. * @returns A shallow copy of the given array containing just the elements that * pass the test. If no elements pass the test, an empty array is returned. * @signature * R.filter(data, predicate) * @example * R.filter([1, 2, 3], x => x % 2 === 1) // => [1, 3] * @dataFirst * @lazy * @category Array */ declare function filter(data: ReadonlyArray, predicate: (value: T, index: number, data: ReadonlyArray) => value is S): Array; declare function filter(data: ReadonlyArray, predicate: (value: T, index: number, data: ReadonlyArray) => boolean): Array; /** * Creates a shallow copy of a portion of a given array, filtered down to just * the elements from the given array that pass the test implemented by the * provided function. Equivalent to `Array.prototype.filter`. * * @param predicate - A function to execute for each element in the array. It * should return `true` to keep the element in the resulting array, and `false` * otherwise. * @returns A shallow copy of the given array containing just the elements that * pass the test. If no elements pass the test, an empty array is returned. * @signature * R.filter(predicate)(data) * @example * R.pipe([1, 2, 3], R.filter(x => x % 2 === 1)) // => [1, 3] * @dataLast * @lazy * @category Array */ declare function filter(predicate: (value: T, index: number, data: ReadonlyArray) => value is S): (data: ReadonlyArray) => Array; declare function filter(predicate: (value: T, index: number, data: ReadonlyArray) => boolean): (data: ReadonlyArray) => Array; export { filter };