import type { RuntimeValidator } from '../validation/lightweight-validators';
import type { CoreExecutionContext } from './core-context';
export type { CoreExecutionContext } from './core-context';
export { createCoreContext, isCoreExecutionContext, assertHTMLElement, asHTMLElement, } from './core-context';
export interface ValidationError {
    readonly type: 'type-mismatch' | 'missing-argument' | 'runtime-error' | 'validation-error' | 'syntax-error' | 'invalid-argument' | 'invalid-input' | 'empty-config' | 'schema-validation' | 'context-error' | 'invalid-syntax' | 'security-warning';
    readonly message: string;
    readonly suggestions: readonly string[] | string[];
    readonly path?: string;
    readonly code?: string;
    readonly name?: string;
    readonly severity?: 'error' | 'warning' | 'info';
}
export interface PerformanceCharacteristics {
    readonly evaluationCount: number;
    readonly totalTime: number;
    readonly averageTime: number;
    readonly successRate: number;
    readonly lastEvaluationTime: number;
}
export interface ValidationResult<T = unknown> {
    readonly isValid: boolean;
    readonly errors: ValidationError[];
    readonly suggestions: readonly string[] | string[];
    readonly warnings?: ValidationError[];
    readonly performance?: PerformanceCharacteristics;
    readonly success?: boolean;
    readonly data?: T;
    readonly error?: ValidationError;
}
export interface EvaluationResult<T = unknown> {
    readonly value?: T;
    readonly type?: HyperScriptValueType;
    readonly success: boolean;
    readonly error?: ValidationError;
    readonly performance?: PerformanceCharacteristics;
}
export type EvaluationType = 'String' | 'Number' | 'Boolean' | 'Element' | 'ElementList' | 'Array' | 'Object' | 'Promise' | 'Context' | 'Null' | 'Undefined' | 'Any';
export type HyperScriptValueType = 'string' | 'number' | 'boolean' | 'element' | 'element-list' | 'array' | 'object' | 'promise' | 'fragment' | 'null' | 'undefined' | 'function' | 'event' | 'error' | 'unknown';
export declare const evaluationToHyperScriptType: Record<EvaluationType, HyperScriptValueType>;
export type ExpressionCategory = 'Reference' | 'Logical' | 'Conversion' | 'Positional' | 'Property' | 'Special' | 'Template' | 'Mathematical';
export interface ExecutionContext extends CoreExecutionContext {
    result: unknown;
    readonly halted?: boolean;
    readonly returned?: boolean;
    readonly broke?: boolean;
    readonly continued?: boolean;
    readonly async?: boolean;
    readonly variables?: Map<string, unknown>;
    readonly events?: Map<string, {
        target: HTMLElement;
        event: string;
        handler: Function;
    }>;
    readonly parent?: ExecutionContext;
    readonly meta?: Record<string, unknown>;
    readonly flags?: {
        halted: boolean;
        breaking: boolean;
        continuing: boolean;
        returning: boolean;
        async: boolean;
    };
}
export interface TypedExecutionContext extends ExecutionContext {
    readonly expressionStack?: string[];
    readonly evaluationDepth?: number;
    readonly validationMode?: 'strict' | 'permissive';
    readonly evaluationHistory?: Array<{
        expressionName: string;
        category: string;
        input: unknown;
        output: unknown;
        timestamp: number;
        duration: number;
        success: boolean;
    }>;
    readonly typeRegistry?: Map<string, unknown>;
    readonly validationCache?: Map<string, unknown>;
}
export interface ParseError {
    readonly name?: string;
    readonly message: string;
    readonly line: number;
    readonly column: number;
    readonly position?: number;
    readonly source?: string;
}
export interface ASTNode {
    readonly type: string;
    readonly line?: number;
    readonly column?: number;
    readonly start?: number;
    readonly end?: number;
    readonly raw?: string;
    [key: string]: unknown;
}
export interface EnhancedError {
    readonly name: string;
    readonly message: string;
    readonly code: string;
    readonly suggestions: string[];
    readonly type?: string;
}
export type TypedResult<T = unknown> = {
    readonly success: true;
    readonly value: T;
    readonly type: HyperScriptValueType;
} | {
    readonly success: false;
    readonly error: EnhancedError;
    readonly errors?: ValidationError[];
    readonly suggestions?: string[];
    readonly type?: string;
};
export interface ExpressionMetadata {
    readonly category: string;
    readonly complexity: 'simple' | 'medium' | 'complex';
    readonly sideEffects?: string[];
    readonly dependencies?: string[];
    readonly returnTypes?: EvaluationType[];
    readonly examples?: Array<{
        input: string;
        description: string;
        expectedOutput: unknown;
        context?: Record<string, unknown>;
    }>;
    readonly relatedExpressions?: string[];
    readonly performance?: {
        averageTime: number;
        complexity: string;
    };
    readonly environmentRequirements?: {
        browser?: boolean;
        server?: boolean;
        dom?: boolean;
    };
}
export interface LLMDocumentation {
    readonly summary: string;
    readonly parameters: Array<{
        name: string;
        type: string;
        description: string;
        optional: boolean;
        examples: string[];
        defaultValue?: unknown;
    }>;
    readonly returns: {
        type: string;
        description: string;
        examples: unknown[];
    };
    readonly examples: Array<{
        title: string;
        code: string;
        explanation: string;
        output: unknown;
    }>;
    readonly seeAlso: string[];
    readonly tags: string[];
    readonly returnValue?: unknown;
}
export interface BaseTypedExpression<T = unknown> {
    readonly name: string;
    readonly category: string;
    readonly syntax: string;
    readonly outputType: EvaluationType;
    readonly inputSchema: RuntimeValidator;
    readonly metadata: ExpressionMetadata;
    readonly documentation?: LLMDocumentation;
    readonly description?: string;
    evaluate(context: TypedExecutionContext, input: unknown): Promise<EvaluationResult<T>>;
    validate(input: unknown): ValidationResult;
}
export interface ExpressionEvaluationOptions {
    readonly validationMode?: 'strict' | 'permissive';
    readonly timeout?: number;
    readonly trackPerformance?: boolean;
}
export interface TypedExpressionContext extends TypedExecutionContext {
}
export type FeatureCategory = 'Frontend' | 'Backend' | 'Data' | 'Communication' | 'Advanced';
export interface BaseTypedFeature<TInput = unknown, TOutput = unknown> {
    readonly name: string;
    readonly category: FeatureCategory;
    readonly description: string;
    readonly inputSchema: RuntimeValidator<TInput>;
    readonly outputType: EvaluationType;
    readonly metadata: FeatureMetadata;
    readonly documentation?: LLMDocumentation;
    initialize(context: TypedExecutionContext): Promise<TypedResult<void>>;
    execute(context: TypedExecutionContext, input: TInput): Promise<TypedResult<TOutput>>;
    validate(input: unknown): ValidationResult;
    cleanup?(context: TypedExecutionContext): Promise<void>;
}
export interface FeatureMetadata {
    readonly version: string;
    readonly stability: 'stable' | 'experimental' | 'deprecated';
    readonly performance: {
        complexity: string;
        memoryUsage: 'low' | 'medium' | 'high';
        async: boolean;
    };
    readonly compatibility: {
        browsers: string[];
        nodeVersion?: string;
    };
    readonly examples: Array<{
        title: string;
        description: string;
        code: string;
        expectedOutput: unknown;
    }>;
    readonly relatedFeatures: string[];
}
export interface CommandResult {
    readonly success: boolean;
    readonly value?: unknown;
    readonly error?: string;
    readonly context?: ExecutionContext;
}
export interface BaseCommand {
    readonly name: string;
    readonly syntax: string;
    readonly description?: string;
    readonly metadata?: {
        category?: string;
        complexity?: 'simple' | 'medium' | 'complex';
        sideEffects?: string[];
        dependencies?: string[];
        examples?: Array<{
            code: string;
            description: string;
        }>;
    };
    execute(context: ExecutionContext, ...args: unknown[]): Promise<CommandResult>;
    validate?(args: unknown[]): ValidationResult;
}
export interface BinaryExpressionNode extends ASTNode {
    readonly type: 'binaryExpression';
    readonly operator: string;
    readonly left: ASTNode;
    readonly right: ASTNode;
}
export interface UnaryExpressionNode extends ASTNode {
    readonly type: 'unaryExpression';
    readonly operator: string;
    readonly operand: ASTNode;
}
export interface PropertyAccessNode extends ASTNode {
    readonly type: 'propertyAccess';
    readonly object: ASTNode;
    readonly property: string;
}
export interface MemberExpressionNode extends ASTNode {
    readonly type: 'memberExpression';
    readonly expression: ASTNode;
    readonly member: string;
}
export interface ContextReferenceNode extends ASTNode {
    readonly type: 'contextReference';
    readonly contextType: 'me' | 'you' | 'it' | 'target' | 'event';
}
export interface CommandNode extends ASTNode {
    readonly type: 'command';
    readonly name: string;
    readonly args?: ASTNode[];
    readonly source?: string;
}
export interface ExpressionNode extends ASTNode {
    readonly type: 'expression';
    readonly value?: unknown;
    readonly operator?: string;
    readonly operands?: ExpressionNode[];
}
export interface LiteralNode extends ASTNode {
    readonly type: 'literal';
    readonly value: string | number | boolean;
}
export interface EventHandlerNode extends ASTNode {
    readonly type: 'eventHandler';
    readonly event: string;
    readonly events?: string[];
    readonly target?: string;
    readonly selector?: string;
    readonly condition?: ASTNode;
    readonly attributeName?: string;
    readonly watchTarget?: ASTNode;
    readonly args?: string[];
    readonly commands: ASTNode[];
    readonly customEventSource?: string;
    readonly modifiers?: {
        once?: boolean;
        prevent?: boolean;
        stop?: boolean;
        debounce?: number;
        throttle?: number;
    };
}
export interface BehaviorNode extends ASTNode {
    readonly type: 'behavior';
    readonly name: string;
    readonly parameters: string[];
    readonly eventHandlers: EventHandlerNode[];
    readonly initBlock?: ASTNode;
    readonly namespace?: string;
}
export interface DefNode extends ASTNode {
    readonly type: 'def';
    readonly name: string;
    readonly params: string[];
    readonly body: CommandNode[];
    readonly errorSymbol?: string;
    readonly errorHandler?: CommandNode[];
    readonly finallyHandler?: CommandNode[];
}
export interface TypedASTNode extends ASTNode {
    readonly evaluationType: EvaluationType;
    readonly validationResult: ValidationResult;
    readonly metadata?: Record<string, unknown>;
}
export declare class TypeSystemBridge {
    static toEnhanced(context: ExecutionContext): TypedExecutionContext;
    static toLegacy(context: TypedExecutionContext): ExecutionContext;
    static normalizeValidationResult(result: unknown): ValidationResult;
    static toHyperScriptType(evaluationType: EvaluationType): HyperScriptValueType;
    static createTypedResult<T>(success: boolean, value?: T, error?: string | EnhancedError, type?: HyperScriptValueType): TypedResult<T>;
}
export declare function createExecutionContext(me?: Element | null, overrides?: Partial<ExecutionContext>): ExecutionContext;
export declare function createTypedExecutionContext(base?: Partial<ExecutionContext>, overrides?: Partial<TypedExecutionContext>): TypedExecutionContext;
export declare function isTypedExecutionContext(context: ExecutionContext | TypedExecutionContext): context is TypedExecutionContext;
export declare function createSuccessValidation(): ValidationResult;
export declare function createFailureValidation(errors: ValidationError[], suggestions?: string[]): ValidationResult;
export declare function createValidationError(type: ValidationError['type'], message: string, suggestions?: string[]): ValidationError;
//# sourceMappingURL=base-types.d.ts.map