import { BaseNode } from "./base.js"; import { Hole } from "./hole.js"; export type ImportStatement = BaseNode & { type: "importStatement"; importedNames: ImportNameType[]; modulePath: string; isAgencyImport: boolean; /** True when written `import test { … }`. Absent (never null/false) on * normal imports so exact-match AST comparisons and JSON output stay * clean. Honored only under the test harness (see resolveImports). */ testOnly?: boolean; }; export type ImportNameType = NamedImport | NamespaceImport | DefaultImport; export type NamedImport = { type: "namedImport"; /** An entry is a Hole only inside a template (`import { #tool } from ...`); * always strings in a compilable program. */ importedNames: (string | Hole)[]; /** Source-side names marked `destructive` / `idempotent`. Each present * only when non-empty (matching `testOnly` above) so exact-match AST * comparisons stay clean. */ destructiveNames?: string[]; idempotentNames?: string[]; aliases: Record; }; export type NamespaceImport = { type: "namespaceImport"; importedNames: string; }; export type DefaultImport = { type: "defaultImport"; importedNames: string; }; /** * Returns the local names for an import (i.e. the alias if present, otherwise the original name). */ export declare function getImportedNames(importNameType: ImportNameType): string[]; export type ImportNodeStatement = BaseNode & { type: "importNodeStatement"; importedNodes: string[]; agencyFile: string; /** * When true, the typescript builder also emits a JS-level re-export of each * node's `__NodeParams` from the source file, so consumers of THIS * file can `import node` from it transitively. Set by `resolveReExports`. * Always undefined for user-written `import node { ... }` statements. */ reExport?: boolean; }; export type ImportToolStatement = BaseNode & { type: "importToolStatement"; importedTools: NamedImport[]; agencyFile: string; }; export declare function getImportedToolNames(node: ImportToolStatement): string[];