import type { AgencyNode } from "../types.js"; import type { ScopeInfo, TypeCheckerContext } from "./types.js"; import { type FlowNode, type FlowEnvironment } from "./flow.js"; /** * Attach `flow` to every variable-referencing node inside an expression. The * leaf rule (set `flowOf` on `variableName`/`valueAccess`) plus a recurse over * `expressionChildren` is the whole walk. Short-circuit operators get per-side * flow in Task 4 as a special case ahead of this general path. */ export declare function attachExpressionsToFlow(node: AgencyNode | null | undefined, flow: FlowNode, env: FlowEnvironment): void; /** * Names of variables a body rebinds (for loop widening). Bare `x = …` only — * access-chain mutations and destructuring patterns are excluded, matching the * `assignment` rule below. */ export declare function assignedNames(body: AgencyNode[]): string[]; /** * Build the flow graph for one body. A fold: each statement's rule maps the * incoming flow to the next. Once `flow` is `exit`, the remaining statements * are unreachable and the fold's result stays `exit`. Those statements are * still walked, on a side flow rooted at the flow before the exit, so that * narrowing inside dead code works the same as anywhere else and what was * known before the exit stays known (issue #538). No node is ever rooted at * `exit`, where typeAt throws. */ export declare function buildFlowGraph(nodes: AgencyNode[], entry: FlowNode, env: FlowEnvironment): FlowNode; /** * Pass entry: build a flow graph per scope, sharing one `flowOf`/`memo` across * the whole check so PR 2 can look up any node. Each scope's build env carries * that scope (typeAt reads scope from `start` nodes, not `env.scope`, so the * shared graph state is safe). Stores a representative env on `ctx`; nothing * consults it yet (PR 1b is behavior-preserving). */ export declare function buildFlowGraphs(scopes: ScopeInfo[], ctx: TypeCheckerContext): void;