import { Predicate } from 'fp-ts/lib/Predicate'; import { Refinement } from 'fp-ts/lib/Refinement'; import { Stream } from './uri'; /** * Defines an interface where the `init` and the `rest` part of * the {@link Stream} based on a condition. * * @export * @interface Spanned * @template I The init part of the {@link Stream}. * @template R The rest of the {@link Stream}. */ export interface Spanned { /** * The init part of the {@link Stream} where the condition was met. * * @type {Stream} * @memberof Spanned */ readonly init: Stream; /** * The rest of the {@link Stream}. * * @type {Stream} * @memberof Spanned */ readonly rest: Stream; } /** * Spans a {@link Stream} from the left side of it based on a refinement. * * @export * @template A The value type. * @template B The refined value type. * @param {Refinement} refinement The refinement function. * @return {(fa: Stream) => Spanned} A function that takes * a {@link Stream} and returns a {@link Spanned} instance of it. * * @__PURE__ */ export declare function spanLeft(refinement: Refinement): (fa: Stream) => Spanned; /** * Spans a {@link Stream} from the left side of it, based on a predicate. * * @export * @template A The value type. * @param {Predicate} predicate The predicate function. * @return {(fb: Stream) => Spanned} A function * that takes a {@link Stream} and returns a {@link Spanned} instance of it. * * @__PURE__ */ export declare function spanLeft(predicate: Predicate): (fb: Stream) => Spanned; /** * Spans a {@link Stream} from the left side of it, based on a predicate. * * @export * @template A The value type. * @param {Predicate} predicate The predicate function. * @return {(fa: Stream) => Spanned} A function that takes * a {@link Stream} and returns a {@link Spanned} instance of it. * * @__PURE__ */ export declare function spanLeft(predicate: Predicate): (fa: Stream) => Spanned; /** * Spans a {@link Stream} from the right side of it based on a refinement. * * **Warning: This function consumes the stream.** * * @export * @template A The value type. * @template B The refined value type. * @param {Refinement} refinement The refinement function. * @return {(fa: Stream) => Spanned} A function that takes * a {@link Stream} and returns a {@link Spanned} instance of it. * * @__PURE__ */ export declare function spanRight(refinement: Refinement): (fa: Stream) => Spanned; /** * Spans a {@link Stream} from the right side of it, based on a predicate. * * **Warning: This function consumes the stream.** * * @export * @template A The value type. * @param {Predicate} predicate The predicate function. * @return {(fb: Stream) => Spanned} A function * that takes a {@link Stream} and returns a {@link Spanned} instance of it. * * @__PURE__ */ export declare function spanRight(predicate: Predicate): (fb: Stream) => Spanned; /** * Spans a {@link Stream} from the right side of it, based on a predicate. * * **Warning: This function consumes the stream.** * * @export * @template A The value type. * @param {Predicate} predicate The predicate function. * @return {(fa: Stream) => Spanned} A function that takes * a {@link Stream} and returns a {@link Spanned} instance of it. * * @__PURE__ */ export declare function spanRight(predicate: Predicate): (fa: Stream) => Spanned;