/** * TA utility helpers for small boolean/rolling operations used by indicators. * Includes functions for detecting rising/falling masks and crosses with * strict NaN-aware semantics by default. */ /** * Determine whether global dense optimization should be skipped. Useful for * tests that need to exercise NaN-aware code paths by setting * `SKIP_DENSE_OPTIMIZATION=true` in the environment. * @returns `true` when dense optimizations should be skipped */ export declare function shouldSkipDenseOptimization(): boolean; /** * Rising mask: returns a Uint8Array where `1` indicates `source[i]` is * strictly greater than the value `length` periods ago (NaN-aware). * When `skipna` is true, NaNs are tolerated and preserved; when false a * dense fast-path is used (assumes no NaNs). * @param source Input numeric series * @param length Lookback length (>0) * @param skipna Whether to ignore NaNs during computation (default: true) * @returns Uint8Array mask with 0/1 values */ export declare function rising(source: ArrayLike, length: number, skipna?: boolean): Uint8Array; /** * Falling mask: returns a Uint8Array where `1` indicates `source[i]` is * strictly less than the value `length` periods ago (NaN-aware). * When `skipna` is true, NaNs are tolerated and preserved; when false a * dense fast-path is used (assumes no NaNs). * @param source Input numeric series * @param length Lookback length (>0) * @param skipna Whether to ignore NaNs during computation (default: true) * @returns Uint8Array mask with 0/1 values */ export declare function falling(source: ArrayLike, length: number, skipna?: boolean): Uint8Array; /** * Test whether series `a` crosses `b` (or a scalar) between the previous and * current index. By default uses a symmetric cross test that detects both * upward and downward crossings. Comparisons are strict and require non-NaN * current and previous values for both operands. * @param a Left series * @param b Right series or scalar * @param test Optional custom comparator receiving (ai, aim1, bi, bim1) * @returns Uint8Array mask where 1 indicates a crossing at that index */ export declare function cross(a: ArrayLike, b: ArrayLike | number, test?: (ai: number, aim1: number, bi: number, bim1: number) => boolean): Uint8Array; /** * Detect an upward crossover (a crosses above b). */ export declare function crossover(a: ArrayLike, b: ArrayLike | number): Uint8Array; /** * Detect a downward crossunder (a crosses below b). */ export declare function crossunder(a: ArrayLike, b: ArrayLike | number): Uint8Array;