import MagicString from 'magic-string'; import { ComponentRegistry } from './registry.js'; /** * COMPLETE EXHAUSTIVE ANGULAR LITE COMPILER * Translates Angular Decorators + Signals to Ivy Static Definitions. * * @param registry - Optional external registry from the global analysis plugin. * When provided, used to resolve component/directive selectors for template compilation. */ export interface CompileResult { code: string; /** Source map for the transformation */ map: ReturnType; /** Absolute paths of external resources (templateUrl, styleUrl) read during compilation */ resourceDependencies: string[]; } export interface CompileOptions { registry?: ComponentRegistry; /** Pre-resolved style contents keyed by absolute file path (e.g. SCSS already compiled to CSS). */ resolvedStyles?: Map; /** Pre-processed inline styles (index in styles array → compiled CSS). */ resolvedInlineStyles?: Map; /** * When `false` (default), instance class field initializers are lowered to * constructor assignments (matching TypeScript's `useDefineForClassFields: false` * behavior). This is required for Angular's `inject()` and constructor DI to * work correctly with the standard Angular tsconfig. */ useDefineForClassFields?: boolean; /** Enable legacy i18n message ID format (default: true). */ enableI18nLegacyMessageIdFormat?: boolean; /** Normalize line endings in ICU expressions (default: true). */ i18nNormalizeLineEndingsInICUs?: boolean; /** Use external IDs in `$localize` calls (for Closure Compiler compatibility). */ i18nUseExternalIds?: boolean; /** * Compilation output mode. * - `'full'` (default): Emit final Ivy definitions (`ɵɵdefineComponent`) for application builds. * - `'partial'`: Emit partial declarations (`ɵɵngDeclareComponent`) for library publishing. * Partial output is version-stable and linked at application build time. */ compilationMode?: 'full' | 'partial'; } export declare function compile(sourceCode: string, fileName: string, optionsOrRegistry?: CompileOptions | ComponentRegistry): CompileResult;