import type { AgencyProgram, FunctionDefinition, FunctionParameter, GraphNodeDefinition, Scope, Tag, TypeAliasEntry, TypeParam, ValueParam, VariableType } from "./types.js";
import type { ImportNodeStatement, ImportStatement } from "./types/importStatement.js";
import type { SymbolTable, InterruptKind } from "./symbolTable.js";
export declare const GLOBAL_SCOPE_KEY = "global";
/**
 * Type aliases keyed by the scope they were declared in. Lookups via
 * `visibleIn(scopeKey)` see the requested scope plus the global scope
 * (scope-local overrides global).
 */
export declare class ScopedTypeAliases {
    private readonly byScope;
    constructor(initial?: Record<string, Record<string, TypeAliasEntry>>);
    add(scopeKey: string, name: string, body: VariableType, typeParams?: TypeParam[], tags?: Tag[], valueParams?: ValueParam[]): void;
    get(scopeKey: string): Record<string, TypeAliasEntry> | undefined;
    /** Flat map of every alias visible in `scopeKey`; scope-local wins. */
    visibleIn(scopeKey: string): Record<string, TypeAliasEntry>;
    /** Iterate over every (scopeKey, aliases-in-that-scope) pair. */
    scopes(): [string, Record<string, TypeAliasEntry>][];
    clone(): ScopedTypeAliases;
}
/**
 * Signature info collected from a SymbolTable for a name brought in via
 * `import { ... }`. Both fields may be populated lazily — `parameters` is
 * filled by the stitch loop in `buildCompilationUnit`, and `returnType`
 * comes from the imported function/node's declaration.
 */
export type ImportedFunctionSignature = {
    parameters: FunctionParameter[];
    returnType: VariableType | null;
    /** Absolute path of the file the symbol was imported from. Used to
     * resolve type aliases referenced by the signature in the right module
     * (so a type-name collision across files picks the right one). */
    originFile?: string;
};
/**
 * Per-compilation aggregate. Holds the rich AST nodes for the entry file's
 * local declarations plus a typechecker-shaped scoped type-alias map. For
 * any cross-file question — what does this name resolve to in another
 * file? — call methods on the SymbolTable directly.
 */
export type CompilationUnit = {
    functionDefinitions: Record<string, FunctionDefinition>;
    typeAliases: ScopedTypeAliases;
    graphNodes: GraphNodeDefinition[];
    importedNodes: ImportNodeStatement[];
    importStatements: ImportStatement[];
    safeFunctions: Record<string, boolean>;
    importedFunctions: Record<string, ImportedFunctionSignature>;
    /**
     * Local names brought in by non-Agency `import { … } from "some.js"`
     * statements. We don't have signatures for these (they're JS), so they
     * live in their own bag and the typechecker treats them as untyped
     * known-callable bindings — enough to keep undefined-function /
     * variable diagnostics quiet without pretending we know their types.
     */
    jsImportedNames: Record<string, true>;
    /** Original source text. Used by the typechecker to locate
     * `// @tc-nocheck` / `// @tc-ignore` directives. Optional because
     * many callers (including most tests) construct the AST directly. */
    sourceText?: string;
    /** Transitive interrupt kinds per function/node, populated from the symbol table. */
    interruptKindsByFunction?: Record<string, InterruptKind[]>;
};
export declare function scopeKey(scope: Scope): string;
export declare function buildCompilationUnit(program: AgencyProgram, symbolTable?: SymbolTable, fromFile?: string, sourceText?: string): CompilationUnit;
