import type { RuntimeValidator } from '../validation/lightweight-validators';
import type { ValidationResult, ValidationError, HyperScriptValueType, EvaluationResult, TypedExecutionContext } from './base-types';
export type { ExecutionContext, TypedExecutionContext, TypedExecutionContext as TypedExpressionContext, ValidationResult, TypedResult, LLMDocumentation, } from './base-types';
export type HyperScriptValue = unknown;
export type { EvaluationResult, EvaluationType, HyperScriptValueType } from './base-types';
export declare const HyperScriptValueSchema: RuntimeValidator<unknown>;
export interface ExecutionMeta {
    readonly startTime: number;
    readonly commandStack: string[];
    readonly sourceLocation?: SourceLocation;
    readonly debugMode: boolean;
}
export interface SourceLocation {
    readonly line: number;
    readonly column: number;
    readonly source: string;
}
export interface TypedCommandImplementation<TInput extends readonly HyperScriptValue[] = readonly HyperScriptValue[], TOutput extends HyperScriptValue = HyperScriptValue, TContext extends TypedExecutionContext = TypedExecutionContext> {
    readonly name: string;
    readonly syntax: string;
    readonly description: string;
    readonly inputSchema: RuntimeValidator<TInput>;
    readonly outputType: HyperScriptValueType;
    execute(context: TContext, ...args: TInput): Promise<EvaluationResult<TOutput>>;
    validate(args: unknown[]): ValidationResult;
    readonly metadata: CommandMetadata;
}
export interface CommandMetadata {
    readonly category: CommandCategory;
    readonly complexity: 'simple' | 'medium' | 'complex';
    readonly sideEffects: SideEffect[];
    readonly examples: CommandExample[];
    readonly relatedCommands: string[];
}
export type CommandCategory = 'DOM' | 'Event' | 'Control' | 'Data' | 'Communication' | 'Style';
export type SideEffect = string;
export interface CommandExample {
    readonly code: string;
    readonly description: string;
    readonly expectedOutput: HyperScriptValue;
}
export interface TypedExpressionImplementation<TOutput extends HyperScriptValue = HyperScriptValue, TContext extends TypedExecutionContext = TypedExecutionContext> {
    readonly name: string;
    readonly category: ExpressionCategory;
    readonly precedence: number;
    readonly associativity: 'left' | 'right' | 'none';
    readonly outputType: string;
    evaluate(context: TContext, ...args: HyperScriptValue[]): Promise<EvaluationResult<TOutput>>;
    readonly analysisInfo: ExpressionAnalysisInfo;
}
export interface ExpressionAnalysisInfo {
    readonly isPure: boolean;
    readonly canThrow: boolean;
    readonly complexity: 'O(1)' | 'O(n)' | 'O(n²)' | 'O(log n)';
    readonly dependencies: string[];
}
export type ExpressionCategory = 'reference' | 'logical' | 'comparison' | 'arithmetic' | 'string' | 'array' | 'object' | 'conversion' | 'special';
export interface EnhancedValidationError extends ValidationError {
    readonly position?: SourceLocation;
    readonly suggestion?: string;
}
export interface HyperScriptError {
    readonly name: string;
    readonly message: string;
    readonly code: string;
    readonly source?: SourceLocation;
    readonly cause?: Error;
    readonly suggestions: string[];
}
export declare class TypeChecker {
    static getType(value: unknown): string;
    static validateType(value: unknown, expectedType: string): ValidationResult;
    private static getTypeSuggestion;
}
export interface ParameterDoc {
    readonly name: string;
    readonly type: string;
    readonly description: string;
    readonly optional: boolean;
    readonly defaultValue?: HyperScriptValue;
    readonly examples: string[];
}
export interface ReturnDoc {
    readonly type: string;
    readonly description: string;
    readonly examples: HyperScriptValue[];
}
export interface DocumentationExample {
    readonly title: string;
    readonly code: string;
    readonly explanation: string;
    readonly output: HyperScriptValue;
}
export interface HyperScriptProgram {
    readonly source: string;
    readonly features: HyperScriptFeature[];
    readonly metadata: ProgramMetadata;
    readonly sourceInfo?: ProgramSourceInfo;
    readonly state: ProgramState;
}
export interface HyperScriptFeature {
    readonly type: HyperScriptFeatureType;
    readonly id: string;
    readonly trigger?: EventTrigger;
    readonly commands: ParsedCommand[];
    readonly config: FeatureConfig;
    readonly sourceRange: SourceRange;
    readonly metadata: FeatureMetadata;
}
export interface ParsedCommand {
    readonly type: ParsedCommandType;
    readonly name: string;
    readonly implementation?: unknown | TypedExpressionImplementation<unknown, TypedExecutionContext>;
    readonly args: ParsedArgument[];
    readonly options: CommandOptions;
    readonly sourceRange: SourceRange;
    readonly analysis?: CommandAnalysis;
}
export interface ParsedArgument {
    readonly value: HyperScriptValue;
    readonly type: string;
    readonly kind: 'literal' | 'expression' | 'reference';
    readonly sourceRange?: SourceRange;
    readonly analysis?: ArgumentAnalysis;
}
export type HyperScriptFeatureType = 'event' | 'behavior' | 'definition' | 'init' | 'worker' | 'socket' | 'eventsource' | 'set' | 'js' | 'custom';
export type ParsedCommandType = 'dom-manipulation' | 'content' | 'navigation' | 'event' | 'async' | 'control-flow' | 'data' | 'expression' | 'custom';
export interface EventTrigger {
    readonly event: string;
    readonly target?: string | HTMLElement;
    readonly options: EventListenerOptions & {
        readonly once?: boolean;
        readonly debounce?: number;
        readonly throttle?: number;
    };
    readonly filter?: EventFilter;
}
export interface EventFilter {
    readonly selector?: string;
    readonly keys?: string[];
    readonly condition?: string;
}
export interface FeatureConfig {
    readonly enabled: boolean;
    readonly priority: number;
    readonly options: Record<string, HyperScriptValue>;
    readonly dependencies: string[];
    readonly capabilities: FeatureCapabilities;
}
export interface FeatureCapabilities {
    readonly requiresDOM: boolean;
    readonly isAsync: boolean;
    readonly modifiesGlobalState: boolean;
    readonly requiredAPIs: string[];
    readonly performance: PerformanceCharacteristics;
}
export interface PerformanceCharacteristics {
    readonly complexity: 'low' | 'medium' | 'high';
    readonly memoryUsage: 'minimal' | 'moderate' | 'heavy';
    readonly cpuIntensive: boolean;
    readonly executionTime: {
        readonly min: number;
        readonly max: number;
        readonly typical: number;
    };
}
export interface ProgramMetadata {
    readonly compilation: {
        readonly compiled: boolean;
        readonly compiledAt?: Date;
        readonly compiler: string;
        readonly version: string;
    };
    readonly analysis: {
        readonly complexity: number;
        readonly estimatedExecutionTime: number;
        readonly memoryRequirements: number;
        readonly warnings: AnalysisWarning[];
        readonly optimizations: string[];
    };
    readonly performance?: {
        readonly lastExecutionTime: number;
        readonly averageExecutionTime: number;
        readonly executionCount: number;
        readonly errorCount: number;
    };
}
export interface FeatureMetadata {
    readonly compiledAt: Date;
    readonly stats: {
        readonly executionCount: number;
        readonly totalExecutionTime: number;
        readonly averageExecutionTime: number;
        readonly errorCount: number;
        readonly lastExecuted?: Date;
    };
    readonly resolvedDependencies: string[];
    readonly warnings: AnalysisWarning[];
}
export interface CommandOptions {
    readonly validateInputs: boolean;
    readonly trackPerformance: boolean;
    readonly errorHandling: 'throw' | 'return' | 'ignore';
    readonly timeout?: number;
    readonly retry?: {
        readonly attempts: number;
        readonly delay: number;
        readonly backoff: 'linear' | 'exponential';
    };
}
export interface CommandAnalysis {
    readonly complexity: number;
    readonly requirements: string[];
    readonly sideEffects: string[];
    readonly typeInference: {
        readonly inputTypes: string[];
        readonly outputType: string;
        readonly confidence: number;
    };
    readonly optimizations: string[];
}
export interface ArgumentAnalysis {
    readonly isUsed: boolean;
    readonly typeCompatibility: number;
    readonly suggestions: string[];
}
export interface ProgramSourceInfo {
    readonly element?: HTMLElement;
    readonly attribute?: string;
    readonly file?: string;
    readonly position?: {
        readonly line: number;
        readonly column: number;
    };
}
export interface SourceRange {
    readonly start: number;
    readonly end: number;
    readonly lines?: {
        readonly start: {
            line: number;
            column: number;
        };
        readonly end: {
            line: number;
            column: number;
        };
    };
}
export interface ProgramState {
    readonly status: 'ready' | 'running' | 'completed' | 'error' | 'suspended';
    readonly currentFeature?: string;
    readonly context: {
        readonly element: HTMLElement | null;
        readonly variables: Map<string, HyperScriptValue>;
        readonly callStack: string[];
    };
    readonly error?: HyperScriptError;
    readonly startedAt?: Date;
    readonly completedAt?: Date;
}
export interface AnalysisWarning {
    readonly level: 'info' | 'warning' | 'error';
    readonly message: string;
    readonly location: SourceRange;
    readonly suggestion?: string;
    readonly category: 'performance' | 'compatibility' | 'security' | 'style' | 'type-safety';
}
export declare const HyperScriptProgramSchema: RuntimeValidator<{
    [x: string]: unknown;
}>;
//# sourceMappingURL=command-types.d.ts.map