/** * Compile-time validation driver for `static` declarations and * `static ` top-level statements (Phase A surface). * * Two responsibilities, both keyed off the module's top-level node * list (single pass): * * 1. Collect every static binding name so the mutation-detection * rule has something to match against (`staticName = ...` and * `staticName.push(...)`). * 2. For each static decl or `static `, run * {@link checkBannedBuiltinCalls} over the inner expression / * statement; for everything else at module top level, run * {@link checkStaticMutation} against the collected names. * * Cross-module reads of non-static globals from a static initializer * are NOT checked here — that's still the job of * `rejectStaticReferencesGlobal` in `lib/compiler/initDepGraph.ts`, * which already runs at the closure level (it can see *all* modules' * statics + globals at once, and reuses PR 2.5's depth-1 expansion). * Splitting per-module direct rules from cross-module dep-graph * rules keeps each pass focused on the data it actually has. */ import type { AgencyProgram } from "../types.js"; import type { TypeCheckError } from "./types.js"; export declare function validateStaticInit(program: AgencyProgram, errors: TypeCheckError[]): void;