import { Option } from 'fp-ts/lib/Option'; import { Refinement } from 'fp-ts/lib/Refinement'; import { Task } from 'fp-ts/lib/Task'; import { AsyncStream } from '../uri'; import { AsyncPredicate } from './async-predicate'; /** * Find the first element which satisfies a predicate (or a refinement) * function. * * It returns a {@link Task} of an {@link Option} containing the element or * `None` if not found. * * @export * @template A The value type. * @template B The refined value type. * @param {Refinement} refinement The refinement function. * @return {(fa: AsyncStream) => Task>} A function that takes an async * stream to search. * * @__PURE__ */ export declare function findFirst(refinement: Refinement): (fa: AsyncStream) => Task>; /** * Find the first element which satisfies a predicate (or a refinement) * function. * * It returns a {@link Task} of an {@link Option} containing the element or * `None` if not found. * * @export * @template A The value type. * @param {AsyncPredicate} predicate The predicate function. * @return {(fa: AsyncStream) => Task>} A function * that takes an async stream to search. * * @__PURE__ */ export declare function findFirst(predicate: AsyncPredicate): (fb: AsyncStream) => Task>; /** * Find the first element which satisfies a predicate (or a refinement) * function. * * It returns a {@link Task} of an {@link Option} containing the element or * `None` if not found. * * @export * @template A The value type. * @param {AsyncPredicate} predicate The predicate function. * @return {(fa: AsyncStream) => Task>} A function that takes * a stream to search. * * @__PURE__ */ export declare function findFirst(predicate: AsyncPredicate): (fa: AsyncStream) => Task>;