import { Template, PlayerContext, Event } from '../types'; import { ITemplateSystem, ITemplateDatabase } from '../interfaces'; export interface TemplateGenerationContext extends PlayerContext { environment?: { weather?: string; season?: string; location?: string; }; gameState?: { difficulty?: string; timePressure?: boolean; }; inventory?: string[]; quests?: string[]; relationships?: { [key: string]: number; }; customConditions?: { [key: string]: (value: any, context: TemplateGenerationContext) => boolean; }; perception?: number; charisma?: number; } export interface TemplateMetadata { title: string; type?: string; difficulty?: string; tags?: string[]; } export interface TemplateLibrary { [genre: string]: { [id: string]: TemplateMetadata; }; } export declare class TemplateSystem implements ITemplateSystem { private customTemplates; private loadedTemplates; private templateLibrary; private processedTemplateCache; private generationCache; private database; constructor(templateLibrary?: string | null); setDatabase(database: ITemplateDatabase): void; loadTemplatesFromDatabase(): Promise; saveTemplateToDatabase(templateId: string): Promise; searchDatabase(criteria: any): Promise; /** * Load templates from a specific genre directory */ loadTemplateLibrary(genre: string): void; /** * Generate an event from a specific template */ generateFromTemplate(templateId: string, context?: TemplateGenerationContext): Event | null; /** * Generate a random event from a specific genre */ generateFromGenre(genre: string, context?: TemplateGenerationContext): Event | null; /** * Evaluate a template condition against player context */ private evaluateCondition; /** * Evaluate complex conditions with AND/OR logic */ private evaluateConditions; /** * Apply conditional logic to template choices */ private applyConditionalChoices; /** * Resolve template inheritance and mixins */ private getTemplateCacheKey; private getGenerationCacheKey; private resolveTemplateInheritance; /** * Apply dynamic composition to template */ private applyTemplateComposition; /** * Merge parent template with child template (inheritance) */ private mergeTemplates; /** * Build inheritance chain to resolve multiple inheritance conflicts */ private buildInheritanceChain; /** * Apply mixin to template */ private applyMixin; /** * Apply advanced mixin with conflict resolution */ private applyAdvancedMixin; /** * Resolve choice conflicts in multiple inheritance/mixins */ private resolveChoiceConflicts; /** * Apply composition to template */ private applyComposition; /** * Apply dynamic fields to template */ private applyDynamicFields; /** * Process a template into an event */ private processTemplate; /** * Apply context-based modifications to template */ private applyContextModifications; /** * Apply weather effects to narrative */ private applyWeatherEffects; /** * Apply seasonal effects to narrative */ private applySeasonEffects; /** * Scale choices based on difficulty */ private scaleChoicesForDifficulty; /** * Scale effect values based on difficulty */ private scaleEffect; /** * Register a custom template */ registerTemplate(templateId: string, template: Template): boolean; /** * Unregister a custom template */ unregisterTemplate(templateId: string): boolean; /** * Get list of custom templates */ getCustomTemplates(): string[]; /** * Get available templates organized by genre */ getAvailableTemplates(): TemplateLibrary; /** * Get all loaded templates as a flat map */ getLoadedTemplates(): Map; /** * Check if a template exists */ hasTemplate(templateId: string): boolean; /** * Get template statistics */ getStats(): { customTemplates: number; loadedTemplates: number; genres: string[]; templateLibrary: string | null; }; /** * Clear caches related to a specific template */ private clearTemplateCaches; /** * Clear all caches */ clearAllCaches(): void; /** * Get cache statistics */ getCacheStats(): { processedTemplates: number; generatedEvents: number; }; } //# sourceMappingURL=TemplateSystem.d.ts.map