/**
 * Core Domain Types and Abstractions for Somoni Script Compiler
 *
 * This module defines the fundamental building blocks following Domain-Driven Design
 * and Clean Architecture principles.
 */
export declare abstract class ValueObject {
    protected abstract getValueObjectProperties(): unknown[];
    equals(other: ValueObject): boolean;
    hashCode(): string;
}
export declare class SourceLocation extends ValueObject {
    readonly line: number;
    readonly column: number;
    readonly file?: string | undefined;
    readonly length?: number | undefined;
    constructor(line: number, column: number, file?: string | undefined, length?: number | undefined);
    protected getValueObjectProperties(): unknown[];
    toString(): string;
    static unknown(): SourceLocation;
}
export declare class SourceRange extends ValueObject {
    readonly start: SourceLocation;
    readonly end: SourceLocation;
    constructor(start: SourceLocation, end: SourceLocation);
    protected getValueObjectProperties(): unknown[];
    contains(location: SourceLocation): boolean;
}
export declare abstract class Result<TValue, TError> {
    static success<T, E>(value: T): Result<T, E>;
    static failure<T, E>(error: E): Result<T, E>;
    static failures<T, E>(errors: E[]): Result<T, E[]>;
    abstract isSuccess(): boolean;
    abstract isFailure(): boolean;
    abstract getValue(): TValue;
    abstract getError(): TError;
    map<U>(fn: (value: TValue) => U): Result<U, TError>;
    mapError<E>(fn: (error: TError) => E): Result<TValue, E>;
    flatMap<U>(fn: (value: TValue) => Result<U, TError>): Result<U, TError>;
}
export declare abstract class CompilationError extends Error {
    readonly location: SourceLocation;
    readonly code: string;
    readonly severity: 'error' | 'warning' | 'info';
    constructor(message: string, location: SourceLocation, code: string, severity?: 'error' | 'warning' | 'info');
    abstract getErrorCategory(): string;
    toString(): string;
}
export declare class LexicalError extends CompilationError {
    readonly character?: string | undefined;
    constructor(message: string, location: SourceLocation, character?: string | undefined);
    getErrorCategory(): string;
}
export declare class SyntaxError extends CompilationError {
    readonly expected?: string | undefined;
    readonly actual?: string | undefined;
    constructor(message: string, location: SourceLocation, expected?: string | undefined, actual?: string | undefined);
    getErrorCategory(): string;
}
export declare class SemanticError extends CompilationError {
    readonly relatedLocation?: SourceLocation | undefined;
    constructor(message: string, location: SourceLocation, relatedLocation?: SourceLocation | undefined);
    getErrorCategory(): string;
}
export declare class GenerationError extends CompilationError {
    constructor(message: string, location: SourceLocation);
    getErrorCategory(): string;
}
export interface ICharacterScanner {
    readonly position: number;
    readonly line: number;
    readonly column: number;
    readonly isAtEnd: boolean;
    peek(offset?: number): string;
    advance(): string;
    match(char: string): boolean;
    matchSequence(sequence: string): boolean;
    skipWhitespace(): void;
    getCurrentLocation(): SourceLocation;
}
export interface ITokenRecognizer {
    readonly priority: number;
    canRecognize(scanner: ICharacterScanner): boolean;
    recognize(scanner: ICharacterScanner): Token | null;
}
export interface ILexicalAnalyzer {
    tokenize(source: string, file?: string): Result<Token[], LexicalError[]>;
}
export interface ISyntaxAnalyzer {
    parse(tokens: Token[]): Result<Program, SyntaxError[]>;
}
export interface ISemanticAnalyzer {
    analyze(ast: Program): Result<AnalyzedProgram, SemanticError[]>;
}
export interface ICodeGenerator {
    generate(ast: AnalyzedProgram, options?: GenerationOptions): Result<string, GenerationError[]>;
}
export declare abstract class CompilationStep<TInput, TOutput, TError extends CompilationError> {
    abstract readonly name: string;
    abstract execute(input: TInput): Promise<Result<TOutput, TError[]>>;
    protected logStep(message: string): void;
}
export declare class CompilationPipeline {
    private readonly steps;
    private readonly reporter;
    constructor(steps: CompilationStep<unknown, unknown, CompilationError>[], reporter: IDiagnosticsReporter);
    execute<TInput, TOutput>(input: TInput): Promise<Result<TOutput, CompilationError[]>>;
}
export declare enum DiagnosticLevel {
    Info = "info",
    Warning = "warning",
    Error = "error"
}
export declare class Diagnostic {
    readonly level: DiagnosticLevel;
    readonly message: string;
    readonly location: SourceLocation;
    readonly code: string;
    readonly relatedInformation?: RelatedInformation[] | undefined;
    constructor(level: DiagnosticLevel, message: string, location: SourceLocation, code: string, relatedInformation?: RelatedInformation[] | undefined);
}
export declare class RelatedInformation {
    readonly location: SourceLocation;
    readonly message: string;
    constructor(location: SourceLocation, message: string);
}
export interface IDiagnosticsReporter {
    reportInfo(message: string, location?: SourceLocation): void;
    reportWarning(message: string, location: SourceLocation, code?: string): void;
    reportError(error: CompilationError): void;
    getSummary(): DiagnosticsSummary;
    clear(): void;
}
export declare class DiagnosticsSummary {
    readonly errorCount: number;
    readonly warningCount: number;
    readonly infoCount: number;
    readonly diagnostics: Diagnostic[];
    constructor(errorCount: number, warningCount: number, infoCount: number, diagnostics: Diagnostic[]);
    get hasErrors(): boolean;
    get hasWarnings(): boolean;
    get totalCount(): number;
}
export declare class CompilationOptions {
    readonly strict: boolean;
    readonly minify: boolean;
    readonly sourceMap: boolean;
    readonly target: string;
    readonly outputFile?: string | undefined;
    readonly includePaths: string[];
    readonly defines: Record<string, string>;
    constructor(strict?: boolean, minify?: boolean, sourceMap?: boolean, target?: string, outputFile?: string | undefined, includePaths?: string[], defines?: Record<string, string>);
    static default(): CompilationOptions;
}
export declare class CompilationContext {
    readonly options: CompilationOptions;
    readonly diagnostics: IDiagnosticsReporter;
    readonly sourceFile: string;
    readonly workingDirectory: string;
    constructor(options: CompilationOptions, diagnostics: IDiagnosticsReporter, sourceFile: string, workingDirectory?: string);
}
export interface Token {
    readonly type: TokenType;
    readonly value: string;
    readonly location: SourceLocation;
    readonly trivia?: Trivia[];
}
export interface Trivia {
    readonly type: 'whitespace' | 'comment' | 'newline';
    readonly value: string;
    readonly location: SourceLocation;
}
export declare abstract class ASTNode {
    readonly location: SourceLocation;
    constructor(location: SourceLocation);
    abstract readonly type: string;
    abstract accept<T>(visitor: ASTVisitor<T>): T;
}
export interface ASTVisitor<T> {
    visitProgram(node: Program): T;
    visitVariableDeclaration(node: VariableDeclaration): T;
    visitFunctionDeclaration(node: FunctionDeclaration): T;
    visitIdentifier(node: Identifier): T;
    visitLiteral(node: Literal): T;
}
export * from '../types';
import { TokenType, Program, VariableDeclaration, FunctionDeclaration, Identifier, Literal } from '../types';
export interface AnalyzedProgram {
    readonly ast: Program;
    readonly typeInformation: unknown;
}
export interface GenerationOptions {
    readonly minify?: boolean;
    readonly sourceMap?: boolean;
    readonly target?: string;
}
export interface ICompilerFactory {
    createLexer(): ILexicalAnalyzer;
    createParser(): ISyntaxAnalyzer;
    createAnalyzer(): ISemanticAnalyzer;
    createGenerator(): ICodeGenerator;
    createReporter(): IDiagnosticsReporter;
}
export interface ICompilerBuilder {
    withLexer(lexer: ILexicalAnalyzer): ICompilerBuilder;
    withParser(parser: ISyntaxAnalyzer): ICompilerBuilder;
    withAnalyzer(analyzer: ISemanticAnalyzer): ICompilerBuilder;
    withGenerator(generator: ICodeGenerator): ICompilerBuilder;
    withOptions(options: CompilationOptions): ICompilerBuilder;
    build(): ICompiler;
}
export interface ICompiler {
    compile(source: string, options?: CompilationOptions): Promise<CompileResult>;
    compileFile(filePath: string, options?: CompilationOptions): Promise<CompileResult>;
}
export declare class CompileResult {
    readonly success: boolean;
    readonly code?: string | undefined;
    readonly sourceMap?: string | undefined;
    readonly diagnostics: DiagnosticsSummary;
    constructor(success: boolean, code?: string | undefined, sourceMap?: string | undefined, diagnostics?: DiagnosticsSummary);
    static success(code: string, sourceMap?: string, diagnostics?: DiagnosticsSummary): CompileResult;
    static failure(diagnostics: DiagnosticsSummary): CompileResult;
}
//# sourceMappingURL=domain.d.ts.map