@cloudpss/template
Version:
Lightweight string and object templating utilities with interpolation and formula support.
17 lines • 572 B
TypeScript
import { type VmScript } from '@mirascript/mirascript';
/** 字符串模板 */
export type Template = string | {
type: TemplateType;
value: VmScript;
};
/** 字符串模板类型 */
export type TemplateType = 'interpolation' | 'formula';
/**
* 解析字符串模板
* - 长度大于 1
* - 如果模板以 `=` 开头,则表示是一个公式
* - 如果模板以 `$` 开头,则表示是一个插值模板
* - 否则表示是一个普通字符串
*/
export declare function parseTemplate(template: string): Template;
//# sourceMappingURL=parser.d.ts.map