/** * The two functions that look back to the last time something happened. * * Both are absent, not zero, before the condition has ever been true. * `stdlib.md` section 9 states it and the reason is that zero would read as "it * happened on this bar", which is the one answer a reader would act on. */ import type { Flag, Flags, Series, StateRecord, Tail, Value } from '../values/index.js'; /** `barsSince(cond)`: bars since the condition last held, 0 on the bar itself. */ export declare function barsSinceStep(state: StateRecord, key: string, cond: Flag): Value; /** `barsSince(cond)` as a tail. */ export declare function barsSinceTail(): Tail; /** `barsSince(cond)` over a whole series. */ export declare function barsSince(cond: Flags): Value[]; /** A condition and the value to remember when it holds, read on the same bar. */ export interface Occasion { readonly cond: Flag; readonly src: Value; } /** * `valueWhen(cond, src, occurrence)`: `src` as it stood the last time the * condition held, or the one before that. * * A later occurrence can name any earlier true event. Immutable history keeps * those values, including absence, while checkpoints share the sealed prefix. */ export declare function valueWhenStep(state: StateRecord, key: string, input: Occasion, occurrence: number): Value; /** `valueWhen(cond, src, occurrence)` as a tail. */ export declare function valueWhenTail(occurrence?: number): Tail; /** `valueWhen(cond, src, occurrence)` over whole series. */ export declare function valueWhen(cond: Flags, src: Series, occurrence?: number): Value[]; //# sourceMappingURL=conditions.d.ts.map