/** * Generalized AOT Orchestrator * * Coordinates scan → parse → compile → collect for any domain. * Each domain provides a DomainCompilationBackend (DSL + CodeGenerator + scan config), * and the orchestrator handles the rest. * * @example * ```typescript * import { AOTOrchestrator } from '@lokascript/framework'; * * const orchestrator = new AOTOrchestrator(); * * orchestrator.registerBackend({ * domain: 'sql', * dsl: createSQLDSL(), * codeGenerator: sqlCodeGenerator, * scanConfig: { * domain: 'sql', * attributes: ['data-sql'], * scriptTypes: ['text/sql-dsl'], * }, * }); * * const result = await orchestrator.compileFiles( * ['index.html', 'about.html'], * (path) => fs.promises.readFile(path, 'utf-8') * ); * ``` */ import type { MultilingualDSL, CodeGenerator } from '../api/create-dsl'; import type { DomainScanConfig, ExtractedSnippet, CompiledSnippet, AOTBatchResult, GeneralizedAOTOptions, OutputOptions } from './types'; /** * Per-domain compilation backend. * Provides everything needed to scan, parse, and compile a domain's syntax. */ export interface DomainCompilationBackend { /** Domain name (must match scanConfig.domain) */ readonly domain: string; /** The DSL instance for parsing and compilation */ readonly dsl: MultilingualDSL; /** Code generator for producing target code from semantic nodes */ readonly codeGenerator: CodeGenerator; /** Scan configuration declaring HTML attribute patterns */ readonly scanConfig: DomainScanConfig; } /** * Generalized AOT orchestrator for any domain. */ export declare class AOTOrchestrator { private backends; private options; constructor(options?: GeneralizedAOTOptions); /** * Register a domain compilation backend. * @throws if a backend with the same domain name is already registered */ registerBackend(backend: DomainCompilationBackend): void; /** * Scan source files and compile all domain snippets. */ compileFiles(files: string[], readFile: (path: string) => Promise): Promise; /** * Compile a single extracted snippet. * Returns the compiled result or an error object. */ compileSnippet(snippet: ExtractedSnippet): CompiledSnippet | { error: string; }; /** * Generate combined output from compilation results. */ generateOutput(result: AOTBatchResult, options?: OutputOptions): string; } //# sourceMappingURL=aot-orchestrator.d.ts.map