export declare const SUPPORTED_TARGET_LANGUAGES: readonly ["python", "csharp", "typescript", "go", "java", "rust", "swift", "markdown"]; /** * Target language for code generation. */ export type TargetLanguage = (typeof SUPPORTED_TARGET_LANGUAGES)[number]; /** * Options for a specific target language. */ export interface TargetOptions { /** Output directory for generated code */ outputDir: string; /** Output directory for generated tests (optional) */ testDir?: string; /** Override the namespace for generated code */ namespace?: string; /** Run formatters on emitted files (default: true) */ format?: boolean; /** Enum/string-union parsing policy for targets that support it */ enumParsing?: "case-sensitive" | "case-insensitive"; /** Opt-in native serialization framework for targets that support it */ nativeSerialization?: "none" | "pydantic" | "jackson" | "serde" | "zod" | "standard-schema" | "codable"; } /** * Options for the generate function. */ export interface GenerateOptions { /** * Output directory for generated code. * Each target will create a subdirectory (e.g., output/python, output/csharp) */ output: string; /** * Target languages to generate code for. * @default ["python", "csharp", "typescript", "go"] */ targets?: TargetLanguage[] | Record; /** * TypeSpec entrypoint to compile. * @default The package's bundled fixture entrypoint. */ source?: string; /** * Root object to start generation from. * @default "Typra.Fixtures.FixtureRoot" */ rootObject?: string; /** * List of model names to omit from generation. * Can be simple names (e.g., "Widget") or fully qualified (e.g., "Typra.Widget") */ omit?: string[]; /** * Root namespace for the generated code. * @default "Typra" */ namespace?: string; /** * Alias for the root object in generated code. */ rootAlias?: string; /** * Generate test files. * @default true */ generateTests?: boolean; /** * Run formatters on emitted files. * @default true */ format?: boolean; /** * Emit stable metadata for deterministic CI verification. * @default false */ deterministic?: boolean; /** * Module import path override for the emitted model package, applied to every * target. Only meaningful for a single-target run (e.g. a focused compile * gate) where the generated multi-package tree must resolve under one module. */ importPath?: string; /** * Package name override (Go/Java/Swift), applied to every target. Pairs with * `importPath` so a single-target gate produces a self-consistent module. */ packageName?: string; /** * Vector-adapter import path override (Go), applied to every target. Lets a * single-target gate give the runtime-authored `vectoradapters` package a * module-relative path so emitted runner/bridge imports resolve. */ vectorAdapterPath?: string; } /** * Result of the generate function. */ export interface GenerateResult { success: boolean; outputDir: string; targets: string[]; errors?: string[]; } /** * Generate Typra runtime surfaces. * * @example * ```typescript * import { generate } from '@typra/emitter/generate'; * * await generate({ * output: './generated', * targets: ['python', 'csharp'], * rootObject: 'Typra.Widget', * omit: ['LegacyWidget'] * }); * ``` */ export declare function generate(options: GenerateOptions): Promise;