/**
 * Application Layer - Use Cases and Workflow Orchestration
 *
 * This layer implements the application's use cases using clean architecture principles.
 * It orchestrates domain services and coordinates between different layers.
 */
import { Token } from '../types';
import { ModularLexer, LexicalError } from './modular-lexer-compatible';
export interface ICompilationUseCase {
    compileSource(source: string, options?: CompilationOptions): Promise<CompilationResult>;
}
export interface ILexicalAnalysisUseCase {
    analyze(source: string, options?: LexicalOptions): LexicalAnalysisResult;
}
export interface IValidationUseCase {
    validateSyntax(source: string): ValidationResult;
    validateTypes(ast: unknown): ValidationResult;
}
export interface CompilationOptions {
    target?: 'javascript' | 'typescript';
    outputPath?: string;
    sourceMaps?: boolean;
    strict?: boolean;
    optimize?: boolean;
}
export interface LexicalOptions {
    includeWhitespace?: boolean;
    includeComments?: boolean;
    preserveNewlines?: boolean;
}
export interface CompilationResult {
    success: boolean;
    output?: string;
    errors: CompilationError[];
    warnings: CompilationWarning[];
    metrics: CompilationMetrics;
}
export interface LexicalAnalysisResult {
    tokens: Token[];
    errors: LexicalError[];
    metrics: LexicalMetrics;
    success: boolean;
}
export interface ValidationResult {
    isValid: boolean;
    errors: ValidationError[];
    warnings: ValidationWarning[];
}
export interface CompilationError {
    message: string;
    line: number;
    column: number;
    severity: 'error' | 'warning';
    code: string;
    category: 'lexical' | 'syntactic' | 'semantic' | 'type' | 'runtime';
}
export interface CompilationWarning {
    message: string;
    line: number;
    column: number;
    code: string;
    category: 'performance' | 'style' | 'compatibility' | 'deprecated';
}
export interface ValidationError {
    message: string;
    location: {
        line: number;
        column: number;
    };
    category: 'syntax' | 'type' | 'logic';
}
export interface ValidationWarning {
    message: string;
    location: {
        line: number;
        column: number;
    };
    category: 'style' | 'performance' | 'best-practice';
}
export interface CompilationMetrics {
    lexicalTime: number;
    parseTime: number;
    typeCheckTime: number;
    codeGenTime: number;
    totalTime: number;
    tokenCount: number;
    nodeCount: number;
    outputSize: number;
}
export interface LexicalMetrics {
    tokenCount: number;
    identifierCount: number;
    keywordCount: number;
    operatorCount: number;
    literalCount: number;
    processingTime: number;
    sourceSize: number;
}
export declare class ErrorAggregationService {
    static aggregateErrors(lexicalErrors: LexicalError[], syntaxErrors?: unknown[], typeErrors?: unknown[]): CompilationError[];
}
export declare class MetricsCollectionService {
    static createLexicalMetrics(tokens: Token[], errors: LexicalError[], processingTime: number, sourceSize: number): LexicalMetrics;
    private static categorizeTokens;
    private static isKeyword;
    private static isOperator;
    private static isLiteral;
}
export declare class LexicalAnalysisUseCase implements ILexicalAnalysisUseCase {
    private readonly lexer;
    constructor(lexer?: ModularLexer);
    analyze(source: string, options?: LexicalOptions): LexicalAnalysisResult;
}
export declare class ValidationUseCase implements IValidationUseCase {
    validateSyntax(source: string): ValidationResult;
    validateTypes(ast: unknown): ValidationResult;
}
export declare class CompilationUseCase implements ICompilationUseCase {
    private readonly lexicalAnalysis;
    private readonly validation;
    constructor(lexicalAnalysis?: ILexicalAnalysisUseCase, validation?: IValidationUseCase);
    compileSource(source: string, options?: CompilationOptions): Promise<CompilationResult>;
    private createFailureResult;
    private generateJavaScript;
}
export declare class SomoniCompiler {
    private readonly compilationUseCase;
    private readonly lexicalAnalysisUseCase;
    private readonly validationUseCase;
    constructor();
    compile(source: string, options?: CompilationOptions): Promise<CompilationResult>;
    analyzeLexically(source: string, options?: LexicalOptions): LexicalAnalysisResult;
    validate(source: string): ValidationResult;
}
export declare function demonstrateApplicationLayer(): Promise<void>;
//# sourceMappingURL=application-layer.d.ts.map