import type { RuntimeValidator } from '../validation/lightweight-validators';
import type { ValidationResult, EvaluationResult, LLMDocumentation, ExecutionContext, TypedExpressionContext, EvaluationType } from './base-types';
export type { ValidationResult, EvaluationResult, LLMDocumentation, ExecutionContext, TypedExecutionContext, TypedExpressionContext, EvaluationType, HyperScriptValueType, } from './base-types';
export type ExpressionCategory = 'Reference' | 'Logical' | 'Conversion' | 'Positional' | 'Property' | 'Special' | 'Template';
export interface TypedError {
    name: string;
    message: string;
    code: string;
    suggestions: string[];
}
export interface BaseTypedExpression<T> {
    readonly name: string;
    readonly category: string;
    readonly syntax: string;
    readonly outputType: string;
    readonly inputSchema: RuntimeValidator<unknown>;
    readonly metadata: ExpressionMetadata;
    readonly documentation?: LLMDocumentation;
    evaluate(context: TypedExpressionContext, input: unknown): Promise<EvaluationResult<T>>;
    validate(input: unknown): ValidationResult;
}
export interface ExpressionEvaluation {
    expressionName: string;
    category: ExpressionCategory;
    input: unknown;
    output: unknown;
    timestamp: number;
    duration: number;
    success: boolean;
    error?: Error;
}
export interface ExpressionMetadata {
    category: ExpressionCategory;
    complexity: 'simple' | 'medium' | 'complex';
    sideEffects?: string[];
    dependencies?: string[];
    returnTypes?: EvaluationType[];
    examples?: {
        input: string;
        description: string;
        expectedOutput: unknown;
        context?: Partial<ExecutionContext>;
    }[];
    relatedExpressions?: string[];
    performance?: {
        averageTime: number;
        complexity: 'O(1)' | 'O(n)' | 'O(log n)' | 'O(n²)';
    };
}
export interface TypedExpressionImplementation<TInput = unknown, TOutput = unknown, TContext extends TypedExpressionContext = TypedExpressionContext> {
    readonly name: string;
    readonly category: ExpressionCategory;
    readonly syntax: string;
    readonly description: string;
    readonly inputSchema: RuntimeValidator<TInput>;
    readonly outputType: EvaluationType;
    readonly metadata: ExpressionMetadata;
    readonly documentation?: LLMDocumentation;
    evaluate(context: TContext, input: TInput): Promise<EvaluationResult<TOutput>>;
    validate(input: unknown): ValidationResult;
    parse?(expressionString: string): Promise<EvaluationResult<TInput>>;
    canHandle?(input: unknown): boolean;
}
export interface ExpressionValidationError {
    type: 'type-mismatch' | 'missing-argument' | 'invalid-syntax' | 'runtime-error' | 'syntax-error' | 'security-warning';
    message: string;
    position?: {
        line: number;
        column: number;
        source: string;
        start?: number;
        end?: number;
        suggestions: [];
    };
    suggestions: string[];
    code?: string;
    severity: 'error' | 'warning' | 'info';
}
export interface ExpressionValidationResult extends ValidationResult<unknown> {
    errors: ExpressionValidationError[];
    warnings?: ExpressionValidationError[];
    suggestions: string[];
}
export interface EnhancedExpressionRegistry {
    register<TInput, TOutput, TContext extends TypedExpressionContext>(expression: TypedExpressionImplementation<TInput, TOutput, TContext>): void;
    get(name: string): TypedExpressionImplementation | undefined;
    has(name: string): boolean;
    getExpressionNames(): string[];
    getByCategory(category: ExpressionCategory): TypedExpressionImplementation[];
    validateExpression(name: string, input: unknown): ExpressionValidationResult;
    getMetadata(name: string): ExpressionMetadata | undefined;
    findByReturnType(returnType: EvaluationType): TypedExpressionImplementation[];
}
export interface ExpressionEvaluationOptions {
    validationMode?: 'strict' | 'permissive';
    maxDepth?: number;
    timeout?: number;
    caching?: boolean;
    debugging?: boolean;
}
export interface ExpressionContextBridge {
    toTyped(context: ExecutionContext, options?: ExpressionEvaluationOptions): TypedExpressionContext;
    fromTyped(typedContext: TypedExpressionContext, originalContext: ExecutionContext): ExecutionContext;
}
export interface ExpressionFactory {
    createReferenceExpression<T = HTMLElement>(name: string, evaluator: (context: TypedExpressionContext, input: unknown) => Promise<T>): TypedExpressionImplementation;
    createLogicalExpression(name: string, evaluator: (context: TypedExpressionContext, left: unknown, right: unknown) => Promise<boolean>): TypedExpressionImplementation;
    createConversionExpression<TFrom, TTo>(name: string, fromType: EvaluationType, toType: EvaluationType, converter: (context: TypedExpressionContext, input: TFrom) => Promise<TTo>): TypedExpressionImplementation;
}
export interface ExpressionProfiler {
    startProfiling(expressionName: string, input: unknown): string;
    endProfiling(profilingId: string, result: EvaluationResult<unknown>): void;
    getStats(expressionName?: string): {
        totalEvaluations: number;
        averageTime: number;
        slowestEvaluation: number;
        fastestEvaluation: number;
        errorRate: number;
    };
    clearStats(): void;
}
export type ExpressionImplementationMap<T = TypedExpressionImplementation> = {
    [key: string]: T;
};
export type ExpressionCategoryMap = {
    [K in ExpressionCategory]: TypedExpressionImplementation[];
};
export interface ExpressionCache {
    get(key: string): EvaluationResult<unknown> | undefined;
    set(key: string, result: EvaluationResult<unknown>, ttl?: number): void;
    clear(): void;
    size(): number;
}
export interface ExpressionDebugger {
    enable(expressionNames: string[]): void;
    disable(): void;
    getLastEvaluation(): ExpressionEvaluation | undefined;
    getHistory(limit?: number): ExpressionEvaluation[];
    setBreakpoint(expressionName: string, condition?: (context: TypedExpressionContext) => boolean): void;
}
export declare const CommonInputSchemas: {
    readonly NoInput: RuntimeValidator<unknown>;
    readonly StringInput: RuntimeValidator<string>;
    readonly NumberInput: RuntimeValidator<number>;
    readonly BooleanInput: RuntimeValidator<boolean>;
    readonly ElementInput: RuntimeValidator<unknown>;
    readonly SelectorInput: RuntimeValidator<string>;
    readonly ComparisonInput: RuntimeValidator<{
        [x: string]: unknown;
    }>;
    readonly LogicalInput: RuntimeValidator<{
        [x: string]: unknown;
    }>;
};
//# sourceMappingURL=expression-types.d.ts.map