langflow-chatbot
Version:
Add a Langflow-powered chatbot to your website.
55 lines (54 loc) • 1.98 kB
TypeScript
import { Logger } from '../utils/logger';
export interface TemplateManagerConfig {
mainContainerTemplate?: string;
inputAreaTemplate?: string;
messageTemplate?: string;
widgetHeaderTemplate?: string;
floatingWidgetHeaderTemplate?: string;
}
/**
* Manages the HTML templates for the chat widget.
* It uses provided templates or falls back to default templates if none are supplied.
* It also validates the templates to ensure they contain essential elements for the widget to function correctly.
*/
export declare class ChatTemplateManager {
private config;
private logger;
private _mainContainerTemplate;
private _inputAreaTemplate;
private _messageTemplate;
private _widgetHeaderTemplate;
private _floatingWidgetHeaderTemplate;
/**
* Constructs a ChatTemplateManager instance.
* @param {TemplateManagerConfig} config - The configuration object containing optional template strings.
* @param {Logger} logger - An instance of the Logger for logging messages.
*/
constructor(config: TemplateManagerConfig, logger: Logger);
private validateTemplates;
/**
* Gets the resolved main container HTML template string.
* @returns {string} The main container template.
*/
getMainContainerTemplate(): string;
/**
* Gets the resolved input area HTML template string.
* @returns {string} The input area template.
*/
getInputAreaTemplate(): string;
/**
* Gets the resolved message HTML template string.
* @returns {string} The message template.
*/
getMessageTemplate(): string;
/**
* Gets the resolved widget header HTML template string.
* @returns {string} The widget header template.
*/
getWidgetHeaderTemplate(): string;
/**
* Gets the resolved floating widget header HTML template string.
* @returns {string} The floating widget header template.
*/
getFloatingWidgetHeaderTemplate(): string;
}