import { CLDR } from '@phensley/cldr-core'; import { Context, Partials } from './context'; import { EngineProps } from './engine'; import { TemplateError } from './errors'; import { Code } from './instructions'; import { ExprOptions } from './math'; export interface CompilerProps extends EngineProps { } export type InjectsMap = { [path: string]: any; }; export interface ExecuteProps { code: string | Code; json?: any; partials?: Partials; injects?: InjectsMap; cldr?: CLDR; now?: number; enableExpr?: boolean; exprOpts?: ExprOptions; enableInclude?: boolean; } export interface ParseResult { code: Code; errors: TemplateError[]; } export interface ExecuteResult { ctx: Context; errors: TemplateError[]; } export interface ParseResult { code: Code; errors: TemplateError[]; } export interface ExecuteResult { ctx: Context; errors: TemplateError[]; } /** * High level interface for parsing and executing templates. */ export declare class Compiler { private props; private engine; private matcher; constructor(props?: CompilerProps); /** * Parse the template and return the instruction tree. */ parse(source: string): ParseResult; /** * Execute a template against the given node. */ execute(props?: ExecuteProps): ExecuteResult; }