export declare const key: (name: string, lang?: string) => string; export declare type TemplateFunction = (...args: any[]) => string; export declare type FunctionMap = { [key: string]: TemplateFunction; }; export declare type VariableMap = { [key: string]: any; }; /** * Register a new function to be available globally inside all templates * @param name Name of the function inside template * @param func Reference to function */ export declare const registerTemplateFunction: (name: string, func: TemplateFunction) => void; /** * Fetch all currently registered template functions * @returns A copy of the current function map */ export declare const getRegisteredTemplateFunctions: () => FunctionMap; /** * Find function invocations within the template, only search for known functions * @param template Template to query * @param funcs Known functions to check for * @returns List of indices where function calls begin */ export declare const findFunctionCalls: (template: string, funcs: FunctionMap) => number[]; /** * Substitute known variable placeholders or remove escape sequences * @param template Template string to substitute in * @param vars Known variables to apply * @returns Output string with changed placeholders */ export declare const replaceVariables: (template: string, vars: VariableMap) => string; /** * Strip known escape sequences away, if they're not escaped twice * @param template Template string to substitute in * @returns Output string with stripped escapes for colons or curly brackets */ export declare const stripEscapes: (template: string) => string; /** * Escape a string's critical symbols so that it can be used * within another function * @param input Input string to be escaped * @returns String safe to be used within another function */ export declare const escapeFunctionResult: (input: string, funcs: FunctionMap, vars: VariableMap) => string; /** * Process a function on the template string and return the result * @param defInd Index within template where the function starts * @param template Current state of the template * @param vars Variables to be used as function parameters * @param funcs Functions that are available for this template * @returns New template, after evaluating this function */ export declare const processFunction: (defInd: number, template: string, vars: VariableMap, funcs: FunctionMap) => string; /** * Describing all parameters possible to pass to a template call */ export interface TemplateParameters { name: string; vars?: VariableMap; funcs?: FunctionMap; } /** * Get the rendered template from a environment variable * @param name Name of the template * @param vars Variables that need to be available * @param funcs Custom added functions * @param lang Language of the template * @returns Rendered template with all functions and variables substituted */ export declare const template: (name: string, vars?: VariableMap | null, funcs?: FunctionMap | null, language?: string) => string; //# sourceMappingURL=description-template.factory.d.ts.map