type Token = TextToken | VariableToken | FunctionToken; type TokenType = 'text' | 'variable' | 'function'; interface BaseToken { type: TokenType; value: string; } interface TextToken extends BaseToken { type: 'text'; } interface VariableToken extends BaseToken { type: 'variable'; path: string[]; pipes: string[]; } interface FunctionToken extends BaseToken { type: 'function'; name: string; params: string[]; pipes: string[]; } export type CompiledTemplate = (context: Record, pipeFunctions?: PipeFunctions) => string; type PipeFunctions = Record any>; export declare class MustacheParser { private static readonly TAG_REGEX; private static readonly FUNCTION_REGEX; private static readonly PIPE_DELIMITER; private static readonly PATH_DELIMITER; private cache; /** * Parse a template string into tokens */ parse(template: string): Token[]; /** * Parse a single tag into a token */ private parseTag; /** * Compile a template string into a function */ compile(template: string): CompiledTemplate; /** * Render a single token with the given context */ private renderToken; /** * Execute a function from the context */ private executeFunction; /** * Apply pipe transformations to a value */ private applyPipes; /** * Clear the parser cache */ clearCache(): void; } export declare class TemplateError extends Error { token?: Token; constructor(message: string, token?: Token); } export declare const createTemplate: (template: string) => CompiledTemplate; export {};