/** * Configuration resolution for the formula engine. * * Turns the sparse, all-optional public {@link FormulaConfig} into a dense * {@link ResolvedFormulaConfig} with every field populated, so the rest of the * engine never has to reason about `undefined`. Centralizing defaults here (one * place, one source of truth) keeps behavior consistent and configurable at * runtime via {@link ConfigurationManager.update}. * * @packageDocumentation */ import type { FormulaConfig } from '../../types/formula.types'; import type { FormulaFunction } from '../functions/formula-function'; /** * Fully-populated configuration — the internal, `undefined`-free counterpart of * {@link FormulaConfig}. Read-only; produce a new one via * {@link ConfigurationManager.update}. */ export interface ResolvedFormulaConfig { readonly enabled: boolean; readonly allowCircularReference: boolean; readonly autoRecalculate: boolean; readonly enableCaching: boolean; /** `0` means unbounded. */ readonly maxDependencyDepth: number; /** Upper-cased set of volatile function names (built-ins + user additions). */ readonly volatileFunctions: ReadonlySet; readonly locale: string; readonly decimalSeparator: string; readonly argumentSeparator: string; readonly caseSensitiveFunctions: boolean; readonly customFunctions: readonly FormulaFunction[]; readonly namedRanges: Readonly>; } /** Function names that are always volatile regardless of configuration. */ export declare const BUILTIN_VOLATILE_FUNCTIONS: readonly string[]; /** * The immutable default configuration, used as the base for every merge. Kept * as a factory-free frozen object; {@link ConfigurationManager} clones fields it * needs to widen (e.g. the volatile set). */ export declare const DEFAULT_FORMULA_CONFIG: ResolvedFormulaConfig; /** * Owns the engine's resolved configuration and applies partial updates against * the defaults. A single instance is held by the {@link FormulaEngine}. */ export declare class ConfigurationManager { private config; /** * @param initial - Optional initial public config; merged over defaults. */ constructor(initial?: FormulaConfig); /** @returns The current fully-resolved configuration. */ get(): ResolvedFormulaConfig; /** * Merges `patch` over the current configuration and returns the new resolved * config. Volatile-function names are unioned with the built-in set and * upper-cased; all other fields overwrite when present. * * @param patch - Partial public config to apply. * @returns The updated resolved configuration. */ update(patch: FormulaConfig): ResolvedFormulaConfig; } //# sourceMappingURL=formula-config.d.ts.map