/** AST Extractor Utility */ /** * Placeholder date used when encountering `new Date()` expressions. * Since dates are runtime values, we substitute a fixed ISO string for validation. */ export declare const DATE_PLACEHOLDER = "2024-01-01T00:00:00.000Z"; /** * Maximum length for source text before truncation in warnings. * Keeps warning messages readable while preserving context. */ export declare const MAX_SOURCE_TEXT_LENGTH = 50; import { SourceFile, Node, ObjectLiteralExpression } from 'ts-morph'; /** A candidate FormConfig object found in the source file. */ export interface FormConfigCandidate { /** Variable or property name */ name: string; /** Line number where the declaration starts */ startLine: number; /** The AST node for the object literal */ objectLiteral: ObjectLiteralExpression; /** How this candidate was detected */ matchReason: 'type-annotation' | 'satisfies' | 'as-cast' | 'structural'; } /** Warning about a non-serializable value that was replaced with a placeholder. */ export interface ExtractionWarning { /** Path to the property, e.g., "fields[0].props.maxDate" */ path: string; /** Description of the issue */ issue: string; /** Original source text */ originalText: string; /** What was substituted */ placeholder: string | number | boolean | null; } /** Error that occurred during extraction. */ export interface ExtractionError { /** Path to the property */ path: string; /** Error message */ message: string; } /** Result of extracting an AST node to JSON. */ export interface ExtractionResult { /** The extracted JSON-safe object */ value: unknown; /** Non-fatal issues (runtime values replaced with placeholders) */ warnings: ExtractionWarning[]; /** Fatal issues (couldn't extract) */ errors: ExtractionError[]; } /** Create a ts-morph Project and parse source code. */ export declare function createSourceFile(source: string, fileName?: string): SourceFile; /** Find all potential FormConfig objects in a source file. */ export declare function findFormConfigCandidates(sourceFile: SourceFile): FormConfigCandidate[]; /** * Extract an AST node to a JSON-safe object. * Handles non-serializable values gracefully with placeholders and warnings. */ export declare function extractToJson(node: Node, path?: string): ExtractionResult; //# sourceMappingURL=ast-extractor.d.ts.map