import type { RuntimeValidator } from '../validation/lightweight-validators';
import type { ValidationResult, EvaluationResult, CommandMetadata, LLMDocumentation } from './command-types';
export interface TypedFeatureContext {
    me: HTMLElement | null;
    it: unknown;
    you: HTMLElement | null;
    result: unknown;
    event?: Event;
    variables: Map<string, unknown>;
    locals: Map<string, unknown>;
    globals: Map<string, unknown>;
    feature: string;
    syntax: string;
    element: HTMLElement;
    errors: Error[];
    featureHistory: FeatureExecution[];
    validationMode: 'strict' | 'permissive';
}
export interface FeatureExecution {
    featureName: string;
    timestamp: number;
    duration?: number;
    success: boolean;
    input: unknown[];
    output?: unknown;
    error?: Error;
}
export interface FeatureMetadata extends CommandMetadata {
    syntaxElements: {
        keywords: string[];
        modifiers: string[];
        expressions: string[];
    };
    triggerTypes: string[];
    scope: 'element' | 'document' | 'global';
    lifecycle: 'immediate' | 'deferred' | 'continuous';
}
export interface TypedFeatureImplementation<TInput = unknown, TOutput = unknown, TContext extends TypedFeatureContext = TypedFeatureContext> {
    readonly name: string;
    readonly syntax: string;
    readonly description: string;
    readonly inputSchema: RuntimeValidator<TInput>;
    readonly outputType: string;
    readonly metadata: FeatureMetadata;
    readonly documentation?: LLMDocumentation;
    parse(syntaxString: string, element: HTMLElement): Promise<EvaluationResult<TInput>>;
    execute(context: TContext, input: TInput): Promise<EvaluationResult<TOutput>>;
    validate(input: unknown): ValidationResult;
    cleanup?(context: TContext, registration: TOutput): Promise<void>;
}
export interface FeatureRegistration {
    id: string;
    featureName: string;
    element: HTMLElement;
    syntax: string;
    active: boolean;
    cleanup?: () => Promise<void>;
}
export interface FeatureValidationError {
    type: 'syntax-error' | 'type-mismatch' | 'semantic-error' | 'runtime-error';
    message: string;
    position?: {
        start: number;
        end: number;
        line?: number;
        column?: number;
        suggestions: [];
    };
    suggestion: string;
    code?: string;
}
export interface FeatureValidationResult {
    isValid: boolean;
    errors: FeatureValidationError[];
    suggestions: string[];
    parsedSyntax?: {
        tokens: string[];
        structure: Record<string, any>;
    };
}
//# sourceMappingURL=feature-types.d.ts.map