@infomatebot/chatbot-widget
Version:
Build intelligent chatbots using pre-designed conversation flows with quick reply options. Upload documents for AI-powered, context-aware responses and reduce support costs by 80% with guided conversations
58 lines • 1.58 kB
TypeScript
export declare class TemplateProcessor {
/**
* Process template with data substitution
*/
static process(template: string, data?: Record<string, any>): string;
/**
* Process simple variable substitution
*/
private static processVariables;
/**
* Process conditional blocks
*/
private static processConditionals;
/**
* Process array loops
*/
private static processArrays;
/**
* Process field arrays specifically (common pattern for action responses)
*/
private static processFieldArrays;
/**
* Get nested value from object using dot notation
*/
private static getNestedValue;
/**
* Check if value is truthy for conditional rendering
*/
private static isTruthy;
/**
* Escape HTML characters for security
*/
static escapeHtml(text: string): string;
/**
* Process template with HTML escaping
*/
static processWithEscaping(template: string, data?: Record<string, any>): string;
/**
* Recursively escape HTML in data values
*/
private static escapeDataValues;
/**
* Validate template syntax
*/
static validateTemplate(template: string): {
isValid: boolean;
errors: string[];
};
/**
* Get all variables referenced in template
*/
static extractVariables(template: string): string[];
/**
* Check if template has dynamic content
*/
static hasDynamicContent(template: string): boolean;
}
//# sourceMappingURL=template-processor.d.ts.map