/** * This module is the single place in the code base that deals with FEEL * values. * * A {@link FeelRange} is pure data (its bounds and their inclusion) plus a * non-enumerable {@link FeelRange#valueType} that records the FEEL type of * its elements (e.g. `number`, `date`). All behavior — membership * ({@link FeelRange#includes}), iteration ({@link FeelRange#map}) and the * range relation functions ({@link before}, {@link meets}, * {@link includes}) — is derived from that data through a single * comparator ({@link cmp}). Because the comparator routes temporal values * through {@link toComparable}, ranges of dates, times and durations * compare correctly, just like ranges of numbers and strings. */ /** * A value that may appear as a range bound: a number, a string or a FEEL * temporal value (date, time, date time or duration). */ export type RangeValue = any; export type FeelRangeProps = { 'start included': boolean; 'end included': boolean; start: RangeValue | null; end: RangeValue | null; valueType: string | null; }; /** * A FEEL (e.g. `[1..10]`, `(date("2020-01-01")..date("2020-12-31")]`). * * The FEEL-visible properties are `start`, `end`, `start included` and * `end included`. The element type is tracked separately (and * non-enumerably) as {@link valueType} so it does not leak into context * spreads or path access. */ export declare class FeelRange { 'start included': boolean; 'end included': boolean; start: RangeValue | null; end: RangeValue | null; /** * @internal FEEL type of the range elements, `null` for the empty range */ valueType: string | null; constructor(props: FeelRangeProps); /** * Whether the range includes the given point or range. Returns `null` * for the empty range or a `null` probe. */ includes(value: RangeValue | null): boolean | null; /** * Enumerate the range, applying `fn` to each element. Only defined for * closed number ranges and single-character string ranges. */ map(fn: (val: RangeValue) => T): T[]; toString(): string; } /** * Whether the value is a FEEL . */ export declare function isRange(obj: any): obj is FeelRange; /** * Whether `a` is (entirely) before `b`. Both operands may be a point or * a {@link FeelRange}. */ export declare function before(a: RangeValue, b: RangeValue): boolean; /** * Whether range `a` meets range `b`, i.e. `a` ends exactly where `b` * starts, both inclusive. */ export declare function meets(a: FeelRange, b: FeelRange): boolean; /** * Whether `range` includes the given point or range. */ export declare function includes(range: FeelRange, value: RangeValue): boolean | null; /** * Create a {@link FeelRange} from its bounds, inferring the element type. */ export declare function createRange(start: RangeValue | null, end: RangeValue | null, startIncluded?: boolean, endIncluded?: boolean): FeelRange;