/**
 * Unified SpecVerse Parser
 *
 * Combines functionality of SpecVerseParser and EnhancedSpecVerseParser
 * into a single configurable parser with optional import resolution
 */
import { SpecVerseAST } from './types/ast.js';
import { ImportResolver } from './import-resolver/index.js';
import type { ImportSpec, ResolvedImport } from './import-resolver/types.js';
export interface ParseOptions {
    enableImports?: boolean;
    importResolver?: ImportResolver;
    basePath?: string;
    cacheDir?: string;
    offline?: boolean;
    debug?: boolean;
}
export interface ParseResult {
    ast?: SpecVerseAST;
    errors: string[];
    warnings?: string[];
    resolvedImports?: Map<string, ResolvedImportInfo[]>;
}
export interface ResolvedImportInfo {
    importSpec: ImportSpec;
    resolved: ResolvedImport;
    selectedTypes?: Map<string, any>;
    foundOriginalTypes?: Set<string>;
}
export interface ValidationError {
    path: string;
    message: string;
    value?: any;
}
export interface ComponentTypeInfo {
    name: string;
    version: string;
    models: Set<string>;
    controllers: Set<string>;
    services: Set<string>;
    views: Set<string>;
    events: Set<string>;
    exports: {
        [category: string]: string[];
    };
}
export declare class UnifiedSpecVerseParser {
    private conventionProcessor;
    private schemaValidator;
    private schema;
    private options;
    private importResolver?;
    private warnings;
    constructor(schema: any, options?: ParseOptions);
    /**
     * Parse content from a string with optional filename for context
     */
    parseContent(content: string, filename?: string): ParseResult;
    /**
     * Parse a file from the filesystem
     */
    parseFromFile(filePath: string): ParseResult;
    /**
     * Parse YAML content directly (for compatibility)
     */
    parse(yamlContent: string, format?: 'specly' | 'yaml'): ParseResult;
    /**
     * Parse .specly file specifically (for compatibility)
     */
    parseSpeclyFile(content: string): ParseResult;
    /**
     * Parse .yaml file specifically (for compatibility)
     */
    parseYamlFile(content: string): ParseResult;
    /**
     * Process .specly content to expanded YAML format (for compatibility)
     */
    processToYaml(speclyContent: string): {
        yaml: string;
        errors: string[];
    };
    /**
     * Parse a file with import resolution (async version)
     */
    parseFileWithImports(filePath: string, options?: Partial<ParseOptions>): Promise<ParseResult>;
    /**
     * Resolve imports for a component
     */
    private resolveComponentImports;
    /**
     * Parse imported content
     */
    private parseImportedContent;
    /**
     * Create AST from type definitions
     */
    private createAstFromTypes;
    /**
     * Create AST from partial component specification
     */
    private createAstFromPartial;
    /**
     * Create AST from library catalog format
     */
    private createAstFromLibraryCatalog;
    /**
     * Detect content type from path or content
     */
    private detectContentType;
    /**
     * Extract selected types from imported AST
     */
    private extractSelectedTypes;
    /**
     * Merge imported types into component
     */
    private mergeImportedTypes;
    /**
     * Validate with resolved imports
     */
    private validateWithResolvedImports;
    /**
     * Validate import conflicts (prevent duplicate type definitions)
     * Checks if types imported from external files are redefined locally
     */
    private validateImportConflicts;
    /**
     * Read file content
     */
    private readFile;
    /**
     * Resolve and merge imports (private method) - for sync parsing
     */
    private resolveAndMergeImports;
    /**
     * Validate with JSON Schema
     */
    private validateWithSchema;
    /**
     * Convert AST to expanded YAML format for tools (copied from original parser)
     */
    astToExpandedYaml(ast: SpecVerseAST): string;
    /**
     * Get component type information (for compatibility)
     */
    getComponentTypes(ast: SpecVerseAST): ComponentTypeInfo[];
    /**
     * Enable imports dynamically
     */
    enableImports(options?: Partial<ParseOptions>): void;
    /**
     * Disable imports dynamically
     */
    disableImports(): void;
    /**
     * Get import resolver instance (for compatibility)
     */
    getImportResolver(): ImportResolver | undefined;
    /**
     * Get current options
     */
    getOptions(): ParseOptions;
    /**
     * Format validation errors for display
     */
    formatErrors(errors: string[]): string;
    /**
     * Get available model names (for IDE support)
     */
    getModelNames(ast: SpecVerseAST): string[];
    /**
     * Get available event names (for IDE support)
     */
    getEventNames(ast: SpecVerseAST): string[];
    /**
     * Get lifecycle actions for a model (for IDE support)
     */
    getLifecycleActions(ast: SpecVerseAST, modelName: string): {
        [lifecycle: string]: string[];
    };
    /**
     * Semantic validation rules — data-driven cross-entity constraints.
     * Each rule defines what to check without hardcoding entity type names.
     */
    private static readonly SEMANTIC_RULES;
    /**
     * Perform semantic validation on the parsed AST
     */
    private validateSemantics;
    /**
     * Build set of imported types available to a component
     */
    private buildImportedTypesSet;
}
//# sourceMappingURL=unified-parser.d.ts.map