import { EmitContext } from "@typespec/compiler"; import { EmitTarget, TypraEmitterOptions } from "./lib.js"; import { TypeNode } from "./ir/ast.js"; import { CallableDispatch } from "./ir/callable.js"; import { ToolchainMetadata } from "./compatibility.js"; export interface ExportSurfaceMethod { name: string; returns: string; params: Record; optional: boolean; sync: boolean; runtimeCancellable: boolean; atomic: boolean; nonFatal: boolean; } export interface ExportSurfaceProtocol { name: string; group: string; symbol: string; source: string; methods: ExportSurfaceMethod[]; /** Present when the seam interface is decorated with `@dispatch`. */ dispatch?: CallableDispatch; } export interface ExportSurfaceEntry { name: string; kind: "type" | "value"; group: string; source: string; protocol: boolean; } export interface ExportSurfaceGroup { name: string; exports: string[]; modules: string[]; } export interface TargetExportSurface { target: string; outputRoot: string; packageName?: string; namespace?: string; rootExports: string[]; exports: ExportSurfaceEntry[]; groups: ExportSurfaceGroup[]; protocols: ExportSurfaceProtocol[]; modules: string[]; } export interface ExportSurfaceSnapshot { emitter: "typra-emitter"; version: 1; toolchain: ToolchainMetadata; root: { object: string; namespace: string; alias: string; }; targets: TargetExportSurface[]; } export declare function buildExportSurfaceSnapshot(rootObject: string, rootNamespace: string, rootAlias: string, targets: EmitTarget[], nodes: TypeNode[], toolchain?: ToolchainMetadata): ExportSurfaceSnapshot; export declare function emitExportSurfaceSnapshot(context: EmitContext, snapshot: ExportSurfaceSnapshot): Promise;