import { Ast } from './parser.js'; import { EvalContext } from './context.js'; import { Shift } from './eval.js'; export type { EvalContext } from './context.js'; export type { Shift } from './eval.js'; export type { Scalar, FValue, Rect, FErr } from './value.js'; export { num, str, bool, err, BLANK } from './value.js'; export { serialFromDate, serialToParts, timePeriodMatches } from './dates.js'; export { NO_SHIFT, evaluate } from './eval.js'; /** * A parsed formula, ready to evaluate against many cells (the AST is compiled once * per conditional-format rule, then evaluated per covered cell with a per-cell * shift). */ export interface CompiledFormula { readonly ast: Ast; } /** * Parse a formula string into a {@link CompiledFormula}. Returns undefined (rather * than throwing) when the formula cannot be parsed โ€” the caller treats that as a * rule that never applies, which is the correct graceful-loss behaviour for an * unsupported construct. */ export declare function compileFormula(src: string): CompiledFormula | undefined; /** * Evaluate a compiled formula in a cell context and reduce it to the rule's truth * test: the conditional format applies iff the result is the logical TRUE or a * non-zero number (Excel ยง18.3.1.10). Any error / blank / text / zero โ€” and a * multi-cell result โ€” yields false, so the rule simply does not paint. * * @param compiled The compiled formula from {@link compileFormula}. * @param ctx The evaluation context (cached grid values + reference date). * @param shift The per-cell relative-reference shift; defaults to {@link NO_SHIFT}. */ export declare function evaluateToBool(compiled: CompiledFormula, ctx: EvalContext, shift?: Shift): boolean;