/** * Walks an {@link AstNode} tree and collects every cell/range reference it * reads — the formula's *direct precedents*. The calculation engine (Phase 4) * uses this to build dependency-graph edges; the copy/fill logic (Phase 5) uses * the same traversal to offset relative references. * * The walk is iterative (an explicit stack) rather than recursive to avoid deep * call stacks on large nested formulas, per Photon Grid's "avoid recursion where * possible" rule. * * @packageDocumentation */ import { AstNode } from './parser/ast.types'; import type { Reference } from './reference/reference.types'; /** * Collects all references from an AST. * * @param root - The formula's root AST node. * @returns Every {@link Reference} the formula reads, in traversal order * (duplicates preserved; callers dedupe if needed). */ export declare function extractReferences(root: AstNode): Reference[]; /** * Collects every bare `Name` node string from an AST — the row-relative * field-name / column-letter references (and any named ranges, which the caller * filters out). The calculation engine turns these into per-row precedent edges * so a formula like `=quantity * unitPrice` recomputes when its row's `quantity` * changes. * * @param root - The formula's root AST node. * @returns Every `Name` node's name, in traversal order (duplicates preserved). */ export declare function extractNames(root: AstNode): string[]; /** * `true` when the AST contains at least one call to a function named in * `volatileNames` (upper-cased). Used to flag volatile formula cells. * * @param root - The formula's root AST node. * @param volatileNames - Set of upper-cased volatile function names. */ export declare function containsVolatileFunction(root: AstNode, volatileNames: ReadonlySet): boolean; //# sourceMappingURL=reference-extractor.d.ts.map