import type { BaseTypedExpression, TypedExpressionContext, EvaluationResult, ValidationResult, LLMDocumentation } from './base-types';
import type { HyperScriptValue } from './command-types';
import type { ExecutionContext } from './core.ts';
export interface TemplateExecutionContext extends TypedExpressionContext {
    readonly templateBuffer: string[];
    readonly templateDepth: number;
    readonly iterationContext?: {
        collection: HyperScriptValue;
        currentIndex: number;
        currentItem: HyperScriptValue;
        totalItems: number;
    };
    readonly conditionalContext?: {
        conditionMet: boolean;
        elseAllowed: boolean;
        branchExecuted: boolean;
    } | undefined;
    readonly templateMeta: {
        templateName?: string;
        compiledAt: number;
        executionStartTime: number;
        directiveStack: string[];
    };
}
export type TemplateDirectiveType = '@if' | '@else' | '@repeat' | '@include' | '@end';
export type TemplateRenderStrategy = 'replace' | 'append' | 'conditional' | 'iterate';
export interface EnhancedTemplateDirective<TInput = unknown, TOutput = string> extends BaseTypedExpression<TOutput> {
    readonly directiveType: TemplateDirectiveType;
    readonly renderStrategy: TemplateRenderStrategy;
    readonly createsScope: boolean;
    readonly allowsNesting: boolean;
    readonly allowedNext: TemplateDirectiveType[];
    executeTemplate(context: TemplateExecutionContext, input: TInput, templateContent: string): Promise<EvaluationResult<string>>;
    validateTemplateContext(context: TemplateExecutionContext, input: TInput): ValidationResult;
}
export declare const IfDirectiveInputSchema: import("../validation/lightweight-validators").RuntimeValidator<{
    [x: string]: unknown;
}>;
export interface IfDirectiveInput {
    condition: unknown;
    templateContent: string;
}
export declare const ElseDirectiveInputSchema: import("../validation/lightweight-validators").RuntimeValidator<{
    [x: string]: unknown;
}>;
export interface ElseDirectiveInput {
    templateContent: string;
}
export declare const RepeatDirectiveInputSchema: import("../validation/lightweight-validators").RuntimeValidator<{
    [x: string]: unknown;
}>;
export interface RepeatDirectiveInput {
    collection: unknown;
    iteratorVariable?: string;
    templateContent: string;
}
export interface EnhancedCompiledTemplate {
    directives: EnhancedTemplateDirective[];
    content: string[];
    interpolations: Array<{
        expression: string;
        startIndex: number;
        endIndex: number;
        evaluatedType?: string;
    }>;
    metadata: {
        originalTemplate: string;
        compiledAt: number;
        directiveCount: number;
        interpolationCount: number;
        estimatedComplexity: 'simple' | 'medium' | 'complex';
    };
    dependencies: {
        requiredVariables: string[];
        usedFeatures: string[];
        nestedTemplates: string[];
    };
}
export interface TemplateError {
    readonly name: 'TemplateCompilationError' | 'TemplateExecutionError' | 'TemplateValidationError';
    readonly message: string;
    readonly code: string;
    readonly templateName?: string;
    readonly lineNumber?: number;
    readonly columnNumber?: number;
    readonly directiveType?: TemplateDirectiveType;
    readonly suggestions: string[];
    readonly context?: {
        originalTemplate: string;
        compiledDirectives: string[];
        executionStack: string[];
    };
}
export interface TemplatePerformanceMetrics {
    readonly compilationTime: number;
    readonly executionTime: number;
    readonly renderTime: number;
    readonly memoryUsage: number;
    readonly cacheHits: number;
    readonly cacheMisses: number;
    readonly directiveExecutions: Record<TemplateDirectiveType, number>;
}
export interface EnhancedTemplateConfig {
    enableCaching: boolean;
    maxCacheSize: number;
    enableMetrics: boolean;
    enableValidation: boolean;
    executionTimeout: number;
    maxNestingDepth: number;
    customDirectives: Record<string, EnhancedTemplateDirective>;
    preprocessors: Array<(template: string) => string>;
    postprocessors: Array<(result: string) => string>;
}
export interface TemplateContextBridge {
    toTemplateContext(context: ExecutionContext, options?: {
        templateName?: string;
        initialBuffer?: string[];
        iterationContext?: TemplateExecutionContext['iterationContext'];
    }): TemplateExecutionContext;
    fromTemplateContext(templateContext: TemplateExecutionContext, originalContext: ExecutionContext): ExecutionContext;
}
export interface TemplateDirectiveRegistry {
    register<T extends EnhancedTemplateDirective>(directive: T): void;
    get(directiveType: TemplateDirectiveType): EnhancedTemplateDirective | undefined;
    has(directiveType: TemplateDirectiveType): boolean;
    list(): TemplateDirectiveType[];
    validate(directiveType: TemplateDirectiveType, input: unknown): ValidationResult;
}
export interface TemplateLLMDocumentation extends LLMDocumentation {
    patterns: Array<{
        name: string;
        template: string;
        context: Record<string, unknown>;
        expectedOutput: string;
        explanation: string;
    }>;
    combinations: Array<{
        directives: TemplateDirectiveType[];
        description: string;
        example: string;
        useCase: string;
    }>;
    troubleshooting: Array<{
        error: string;
        cause: string;
        solution: string;
        prevention: string;
    }>;
}
export type TemplateStringLiteral<T extends string> = T;
export type InterpolationPattern = `\${${string}}`;
export type DirectivePattern = `@${string}`;
export type TemplateDataTypes = string | number | boolean | null | undefined | Array<string | number | boolean | null | undefined | Record<string, unknown>> | Record<string, string | number | boolean | null | undefined | Array<unknown>>;
export interface StandardTemplateContext {
    readonly data: Record<string, TemplateDataTypes>;
    readonly parent?: StandardTemplateContext;
    readonly helpers: Record<string, (...args: unknown[]) => unknown>;
    readonly partials: Record<string, string>;
    readonly options: Record<string, unknown>;
}
export type { BaseTypedExpression, TypedExpressionContext, ExpressionMetadata, ValidationResult, LLMDocumentation, } from './expression-types';
//# sourceMappingURL=template-types.d.ts.map