axcora
Version:
Modern and Super Light Static Site Generator
70 lines (69 loc) • 2.27 kB
TypeScript
export declare class TemplateInheritance {
private activeBlocks;
private variables;
/**
* Process template inheritance with {% extends %} and {% block %}
*/
processExtends(childTemplate: string, parentTemplate: string): string;
/**
* ENHANCED: Process complete template with Nunjucks-like features
*/
processTemplate(template: string, data?: any): string;
/**
* ENHANCED: Set variables - {% set variable = value %}
*/
processSetVariables(template: string, data: any): string;
/**
* ENHANCED: Advanced conditionals with AND/OR
*/
processEnhancedConditionals(template: string, data: any): string;
/**
* ENHANCED: Advanced loops with filtering
*/
processEnhancedLoops(template: string, data: any): string;
/**
* ENHANCED: Variables with advanced filters
*/
processVariablesWithFilters(template: string, data: any): string;
/**
* ENHANCED: Math operations - {{ price * 1.1 }}
*/
processMathOperations(template: string, data: any): string;
/**
* Process single expression with filters
*/
processExpression(expression: string, data: any): string;
/**
* ENHANCED: Comprehensive filter system
*/
applyFilter(value: any, filterName: string, args?: string[]): any;
/**
* Evaluate complex conditions (AND, OR, comparisons)
*/
evaluateCondition(condition: string, data: any): boolean;
/**
* Evaluate single condition
*/
evaluateSingleCondition(condition: string, data: any): boolean;
/**
* Get value or literal from expression
*/
getValueOrLiteral(expr: string, data: any): any;
/**
* Get nested property value (e.g., "site.title", "user.profile.name")
*/
getNestedProperty(obj: any, path: string): any;
/**
* Process theme variables in templates
*/
processThemeVariables(template: string, themeVariables: Record<string, string>): string;
/**
* Extract all block names from a template
*/
extractBlocks(template: string): string[];
/**
* Generate theme-specific CSS imports
*/
generateThemeCSSImports(theme: string, components?: string[]): string;
}
export default TemplateInheritance;