import type { Either } from "../../Either"; import * as T from "../Task/_core"; import type { Decision } from "./Decision"; import type { Schedule } from "./model"; /** * Returns a new schedule that loops this one continuously, resetting the state * when this schedule is done. */ export declare const repeat: (sc: Schedule) => Schedule; export declare const modifyDelayM_: ( sc: Schedule, f: (o: O, d: number) => T.Task ) => Schedule; export declare const modifyDelayM: ( f: (o: O, d: number) => T.Task ) => (sc: Schedule) => Schedule; export declare const modifyDelay_: ( sc: Schedule, f: (o: O, d: number) => number ) => Schedule; export declare const modifyDelay: ( f: (o: O, d: number) => number ) => (sc: Schedule) => Schedule; /** * Returns a new schedule with the effectfully calculated delay added to every update. */ export declare const addDelayM_: ( sc: Schedule, f: (o: O) => T.Task ) => Schedule; /** * Returns a new schedule with the effectfully calculated delay added to every update. */ export declare const addDelayM: ( f: (o: O) => T.Task ) => (sc: Schedule) => Schedule; /** * Returns a new schedule with the given delay added to every update. */ export declare const addDelay_: (sc: Schedule, f: (o: O) => number) => Schedule; /** * Returns a new schedule with the given delay added to every update. */ export declare const addDelay: (f: (o: O) => number) => (sc: Schedule) => Schedule; /** * Returns a new `Schedule` with the specified effectfully computed delay added before the start * of each interval produced by the this `Schedule`. */ export declare const delayedM_: ( sc: Schedule, f: (d: number) => T.Task ) => Schedule; /** * Returns a new `Schedule` with the specified effectfully computed delay added before the start * of each interval produced by the this `Schedule`. */ export declare const delayedM: ( f: (d: number) => T.Task ) => (sc: Schedule) => Schedule; /** * Returns a new schedule with the specified computed delay added before the start * of each interval produced by this schedule. */ export declare const delayed_: (sc: Schedule, f: (d: number) => number) => Schedule; /** * Returns a new schedule with the specified computed delay added before the start * of each interval produced by this schedule. */ export declare const delayed: (f: (d: number) => number) => (sc: Schedule) => Schedule; export declare const duration: (n: number) => Schedule; /** * Returns a new schedule with the specified computed delay added before the start * of each interval produced by this schedule. */ export declare const delayedFrom: (sc: Schedule) => Schedule; /** * Returns a new schedule that first executes this schedule to completion, and then executes the * specified schedule to completion. */ export declare const andThenEither_: ( sc: Schedule, that: Schedule ) => Schedule>; /** * Returns a new schedule that first executes this schedule to completion, and then executes the * specified schedule to completion. */ export declare const andThenEither: ( that: Schedule ) => (sc: Schedule) => Schedule>; export declare const mapM_: ( sc: Schedule, f: (o: O) => T.Task ) => Schedule; export declare const mapM: ( f: (o: O) => T.Task ) => (sc: Schedule) => Schedule; export declare const map_: (fa: Schedule, f: (a: A) => B) => Schedule; export declare const map: (f: (a: A) => B) => (fa: Schedule) => Schedule; export declare const as_: (sc: Schedule, o: O1) => Schedule; export declare const as: (o: O1) => (sc: Schedule) => Schedule; /** * Returns a new schedule that maps the output of this schedule to unit. */ export declare const unit: (sc: Schedule) => Schedule; export declare const combineWith_: ( sc: Schedule, that: Schedule, f: (d1: number, d2: number) => number ) => Schedule; export declare const combineWith: ( that: Schedule ) => (f: (d1: number, d2: number) => number) => (sc: Schedule) => Schedule; export declare const either_: ( sc: Schedule, that: Schedule ) => Schedule; export declare const either: ( that: Schedule ) => (sc: Schedule) => Schedule; export declare const eitherWith_: ( sc: Schedule, that: Schedule, f: (o: O, o1: O1) => O2 ) => Schedule; export declare const eitherWith: ( that: Schedule ) => (f: (o: O, o1: O1) => O2) => (sc: Schedule) => Schedule; /** * Returns a new schedule that has both the inputs and outputs of this and the specified * schedule. */ export declare const bothInOut_: ( sc: Schedule, that: Schedule ) => Schedule; /** * Returns a new schedule that has both the inputs and outputs of this and the specified * schedule. */ export declare const bothInOut: ( that: Schedule ) => (sc: Schedule) => Schedule; /** * Returns a new schedule that performs a geometric intersection on the intervals defined * by both schedules. */ export declare const both_: ( sc: Schedule, that: Schedule ) => Schedule; /** * Returns a new schedule that performs a geometric intersection on the intervals defined * by both schedules. */ export declare const both: ( that: Schedule ) => (self: Schedule) => Schedule; /** * Returns a new schedule that passes each input and output of this schedule to the specified * function, and then determines whether or not to continue based on the return value of the * function. */ export declare const checkM_: ( sc: Schedule, test: (i: I, o: O) => T.Task ) => Schedule; /** * Returns a new schedule that passes each input and output of this schedule to the specified * function, and then determines whether or not to continue based on the return value of the * function. */ export declare const checkM: ( test: (i: I, o: O) => T.Task ) => (sc: Schedule) => Schedule; /** * Returns a new schedule that passes each input and output of this schedule to the spefcified * function, and then determines whether or not to continue based on the return value of the * function. */ export declare const check_: (sc: Schedule, test: (i: I, o: O) => boolean) => Schedule; /** * Returns a new schedule that passes each input and output of this schedule to the spefcified * function, and then determines whether or not to continue based on the return value of the * function. */ export declare const check: (test: (i: I, o: O) => boolean) => (sc: Schedule) => Schedule; /** * Returns a new schedule that continues until the specified predicate on the input evaluates * to true. */ export declare const untilInput_: (sc: Schedule, f: (i: I) => boolean) => Schedule; /** * Returns a new schedule that continues until the specified predicate on the input evaluates * to true. */ export declare const untilInput: (f: (i: I) => boolean) => (sc: Schedule) => Schedule; /** * Returns a new schedule that continues until the specified predicate on the input evaluates * to true. */ export declare const untilInputM_: ( sc: Schedule, f: (i: I) => T.Task ) => Schedule; /** * Returns a new schedule that continues until the specified predicate on the input evaluates * to true. */ export declare const untilInputM: ( f: (i: I) => T.Task ) => (sc: Schedule) => Schedule; /** * Returns a new schedule that continues until the specified predicate on the input evaluates * to true. */ export declare const untilOutput_: (sc: Schedule, f: (o: O) => boolean) => Schedule; /** * Returns a new schedule that continues until the specified predicate on the input evaluates * to true. */ export declare const untilOutput: (f: (o: O) => boolean) => (sc: Schedule) => Schedule; /** * Returns a new schedule that continues until the specified predicate on the input evaluates * to true. */ export declare const untilOutputM_: ( sc: Schedule, f: (o: O) => T.Task ) => Schedule; /** * Returns a new schedule that continues until the specified predicate on the input evaluates * to true. */ export declare const untilOutputM: ( f: (o: O) => T.Task ) => (sc: Schedule) => Schedule; /** * Returns a new schedule that continues for as long the specified effectful predicate on the * input evaluates to true. */ export declare const whileInput_: (sc: Schedule, f: (i: I) => boolean) => Schedule; /** * Returns a new schedule that continues for as long the specified effectful predicate on the * input evaluates to true. */ export declare const whileInput: (f: (i: I) => boolean) => (sc: Schedule) => Schedule; /** * Returns a new schedule that continues for as long the specified effectful predicate on the * input evaluates to true. */ export declare const whileInputM_: ( sc: Schedule, f: (i: I) => T.Task ) => Schedule; /** * Returns a new schedule that continues for as long the specified effectful predicate on the * input evaluates to true. */ export declare const whileInputM: ( f: (i: I) => T.Task ) => (sc: Schedule) => Schedule; /** * Returns a new schedule that continues for as long the specified effectful predicate on the * input evaluates to true. */ export declare const whileOutput_: (sc: Schedule, f: (o: O) => boolean) => Schedule; /** * Returns a new schedule that continues for as long the specified effectful predicate on the * input evaluates to true. */ export declare const whileOutput: (f: (o: O) => boolean) => (sc: Schedule) => Schedule; /** * Returns a new schedule that continues for as long the specified effectful predicate on the * input evaluates to true. */ export declare const whileOutputM_: ( sc: Schedule, f: (o: O) => T.Task ) => Schedule; /** * Returns a new schedule that continues for as long the specified effectful predicate on the * input evaluates to true. */ export declare const whileOutputM: ( f: (o: O) => T.Task ) => (sc: Schedule) => Schedule; /** * Returns a new schedule that allows choosing between feeding inputs to this schedule, or * feeding inputs to the specified schedule. */ export declare const choose_: ( sc: Schedule, that: Schedule ) => Schedule, Either>; /** * Returns a new schedule that allows choosing between feeding inputs to this schedule, or * feeding inputs to the specified schedule. */ export declare const choose: ( that: Schedule ) => (sc: Schedule) => Schedule, Either>; /** * Returns a new schedule that allows choosing between feeding inputs to this schedule, or * feeding inputs to the specified schedule. */ export declare const chooseMerge_: ( sc: Schedule, that: Schedule ) => Schedule, O | O1>; /** * Returns a new schedule that allows choosing between feeding inputs to this schedule, or * feeding inputs to the specified schedule. */ export declare const chooseMerge: ( that: Schedule ) => (sc: Schedule) => Schedule, O1 | O>; /** * Returns a new schedule that will run the specified finalizer as soon as the schedule is * complete. Note that unlike `Task#ensuring`, this method does not guarantee the finalizer * will be run. The `Schedule` may not initialize or the driver of the schedule may not run * to completion. However, if the `Schedule` ever decides not to continue, then the * finalizer will be run. */ export declare const ensuring_: ( sc: Schedule, finalizer: T.Task ) => Schedule; /** * Returns a new schedule that will run the specified finalizer as soon as the schedule is * complete. Note that unlike `Task#ensuring`, this method does not guarantee the finalizer * will be run. The `Schedule` may not initialize or the driver of the schedule may not run * to completion. However, if the `Schedule` ever decides not to continue, then the * finalizer will be run. */ export declare const ensuring: ( finalizer: T.Task ) => (sc: Schedule) => Schedule; /** * A schedule that recurs on a fixed interval. Returns the number of * repetitions of the schedule so far. * * If the action run between updates takes longer than the interval, then the * action will be run immediately, but re-runs will not "pile up". * *
 * |-----interval-----|-----interval-----|-----interval-----|
 * |---------action--------||action|-----|action|-----------|
 * 
*/ export declare const fixed: (interval: number) => Schedule; /** * Returns a new `Schedule` that effectfully folds over the outputs of a `Schedule`. */ export declare const foldM_: ( sc: Schedule, b: B, f: (b: B, o: O) => T.Task ) => Schedule; /** * Returns a new `Schedule` that effectfully folds over the outputs of a `Schedule`. */ export declare const foldM: ( b: B, f: (b: B, o: O) => T.Task ) => (sc: Schedule) => Schedule; /** * Returns a new `Schedule` that folds over the outputs of a `Schedule`. */ export declare const fold_: (sc: Schedule, b: B, f: (b: B, o: O) => B) => Schedule; /** * Returns a new `Schedule` that folds over the outputs of a `Schedule`. */ export declare const fold: (b: B, f: (b: B, o: O) => B) => (sc: Schedule) => Schedule; /** * Unfolds a schedule that repeats one time from the specified state and iterator. */ export declare const unfold_: (a: () => A, f: (a: A) => A) => Schedule; /** * Unfolds a schedule that repeats one time from the specified state and iterator. */ export declare const unfold: (f: (a: A) => A) => (a: () => A) => Schedule; /** * Taskfully unfolds a schedule that repeats one time from the specified state and iterator. */ export declare const unfoldM_: (a: A, f: (a: A) => T.Task) => Schedule; /** * Taskfully unfolds a schedule that repeats one time from the specified state and iterator. */ export declare const unfoldM: (f: (a: A) => T.Task) => (a: A) => Schedule; /** * A schedule that recurs forever and produces a count of repeats. */ export declare const forever: Schedule; /** * A schedule spanning all time, which can be stepped only the specified number of times before * it terminates. */ export declare const recur: (n: number) => Schedule; /** * A `Schedule` that recurs one time. */ export declare const once: Schedule; /** * A `Schedule` that stops */ export declare const stop: Schedule; /** * Returns a new schedule that randomly modifies the size of the intervals of this schedule. */ export declare const jittered_: ( sc: Schedule, { max, min }?: { min?: number | undefined; max?: number | undefined; } ) => Schedule, I, O>; /** * Returns a new schedule that randomly modifies the size of the intervals of this schedule. */ export declare const jittered: ({ max, min }?: { min?: number | undefined; max?: number | undefined; }) => (sc: Schedule) => Schedule, I, O>; /** * A schedule that always recurs, but will repeat on a linear time * interval, given by `base * n` where `n` is the number of * repetitions so far. Returns the current duration between recurrences. */ export declare const linear: (base: number) => Schedule; /** * Returns a new schedule that collects the outputs of a `Schedule` into an array. */ export declare const collectAll: (sc: Schedule) => Schedule; /** * A schedule that always recurs and returns inputs as outputs. */ export declare const identity: () => Schedule; /** * Returns a new schedule that makes this schedule available on the `Left` side of an `Either` * input, allowing propagating some type `X` through this channel on demand. */ export declare const left: () => (sc: Schedule) => Schedule, Either>; /** * Returns a new schedule that makes this schedule available on the `Right` side of an `Either` * input, allowing propagating some type `X` through this channel on demand. */ export declare const right: () => (sc: Schedule) => Schedule, Either>; /** * Returns a new schedule that packs the input and output of this schedule into the first * element of a tuple. This allows carrying information through this schedule. */ export declare const first: () => (sc: Schedule) => Schedule; /** * Returns a new schedule that packs the input and output of this schedule into the second * element of a tuple. This allows carrying information through this schedule. */ export declare const second: () => (sc: Schedule) => Schedule; /** * A schedule that always recurs, mapping input values through the * specified function. */ export declare const fromFunction: (f: (a: A) => B) => Schedule; /** * Returns a schedule that recurs continuously, each repetition spaced the specified duration * from the last run. */ export declare const spaced: (duration: number) => Schedule; /** * Returns a new schedule with its environment provided to it, so the resulting * schedule does not require any environment. */ export declare const provideAll_: (sc: Schedule, r: R) => Schedule; /** * Returns a new schedule with its environment provided to it, so the resulting * schedule does not require any environment. */ export declare const provideAll: (r: R) => (sc: Schedule) => Schedule; /** * Returns a new schedule with part of its environment provided to it, so the * resulting schedule does not require any environment. */ export declare const provideSome_: (sc: Schedule, r: (_: R1) => R) => Schedule; /** * Returns a new schedule with part of its environment provided to it, so the * resulting schedule does not require any environment. */ export declare const provideSome: (r: (_: R1) => R) => (sc: Schedule) => Schedule; /** * Returns a new schedule that effectfully reconsiders every decision made by this schedule, * possibly modifying the next interval and the output type in the process. */ export declare const reconsiderM_: ( sc: Schedule, f: (d: Decision) => T.Task> ) => Schedule; /** * Returns a new schedule that effectfully reconsiders every decision made by this schedule, * possibly modifying the next interval and the output type in the process. */ export declare const reconsiderM: ( f: (d: Decision) => T.Task> ) => (sc: Schedule) => Schedule; /** * Returns a new schedule that reconsiders every decision made by this schedule, * possibly modifying the next interval and the output type in the process. */ export declare const reconsider_: ( sc: Schedule, f: (d: Decision) => Either ) => Schedule; /** * Returns a new schedule that reconsiders every decision made by this schedule, * possibly modifying the next interval and the output type in the process. */ export declare const reconsider: ( f: (d: Decision) => Either ) => (sc: Schedule) => Schedule; /** * A schedule that recurs for as long as the effectful predicate evaluates to true. */ export declare const recurWhileM: (f: (a: A) => T.Task) => Schedule; /** * A schedule that recurs for as long as the predicate evaluates to true. */ export declare const recurWhile: (f: (a: A) => boolean) => Schedule; /** * A schedule that recurs for as long as the predicate evaluates to true. */ export declare const recurWhileEqual: (a: A) => Schedule; /** * A schedule that recurs until the effectful predicate evaluates to true. */ export declare const recurUntilM: (f: (a: A) => T.Task) => Schedule; /** * A schedule that recurs until the predicate evaluates to true. */ export declare const recurUntil: (f: (a: A) => boolean) => Schedule; /** * A schedule that recurs until the predicate evaluates to true. */ export declare const recurUntilEqual: (a: A) => Schedule; /** * Returns a new schedule that outputs the number of repetitions of this one. */ export declare const repetitions: (sc: Schedule) => Schedule; /** * Resets the schedule when the specified predicate on the schedule output evaluates to true. */ export declare const resetWhen_: (sc: Schedule, f: (o: O) => boolean) => Schedule; /** * Resets the schedule when the specified predicate on the schedule output evaluates to true. */ export declare const resetWhen: (f: (o: O) => boolean) => (sc: Schedule) => Schedule; export declare const run_: ( sc: Schedule, now: number, i: Iterable ) => T.Task; export declare const run: ( now: number, i: Iterable ) => (sc: Schedule) => T.Task; /** * Returns a new schedule that applies the current one but runs the specified effect * for every decision of this schedule. This can be used to create schedules * that log failures, decisions, or computed values. */ export declare const onDecision_: ( sc: Schedule, f: (d: Decision) => T.Task ) => Schedule; /** * Returns a new schedule that applies the current one but runs the specified effect * for every decision of this schedule. This can be used to create schedules * that log failures, decisions, or computed values. */ export declare const onDecision: ( f: (d: Decision) => T.Task ) => (sc: Schedule) => Schedule; export declare const tapInput_: ( sc: Schedule, f: (i: I) => T.Task ) => Schedule; export declare const tapInput: ( f: (i: I) => T.Task ) => (sc: Schedule) => Schedule; export declare const tapOutput_: ( sc: Schedule, f: (o: O) => T.Task ) => Schedule; export declare const tapOutput: ( f: (o: O) => T.Task ) => (sc: Schedule) => Schedule; export declare const windowed: (interval: number) => Schedule; /** * Returns a new schedule that performs a geometric intersection on the intervals defined * by both schedules. */ export declare const zip_: ( sc: Schedule, that: Schedule ) => Schedule; /** * Returns a new schedule that performs a geometric intersection on the intervals defined * by both schedules. */ export declare const zip: ( that: Schedule ) => (sc: Schedule) => Schedule; /** * Same as zip but ignores the right output. */ export declare const zipl_: ( sc: Schedule, that: Schedule ) => Schedule; /** * Same as zip but ignores the right output. */ export declare const zipl: ( that: Schedule ) => (sc: Schedule) => Schedule; /** * Same as zip but ignores the left output. */ export declare const zipr_: ( sc: Schedule, that: Schedule ) => Schedule; /** * Same as zip but ignores the left output. */ export declare const zipr: ( that: Schedule ) => (sc: Schedule) => Schedule; /** * Equivalent to `zip` followed by `map`. */ export declare const zipWith_: ( sc: Schedule, that: Schedule, f: (o: O, o1: O1) => O2 ) => Schedule; /** * Equivalent to `zip` followed by `map`. */ export declare const zipWith: ( that: Schedule, f: (o: O, o1: O1) => O2 ) => (sc: Schedule) => Schedule; //# sourceMappingURL=combinators.d.ts.map