jsonblade
Version:
A powerful and modular JSON template engine with extensible filters
20 lines • 816 B
TypeScript
import { FilterFunction } from "./filter-registry";
import { TemplateFunction } from "./json-template.utils";
import { TemplateConfig } from "./template-config";
type FilterMap = Record<string, FilterFunction>;
export type JSONBladeOptions = {
filters?: FilterMap;
useBuiltins?: boolean;
config?: Partial<TemplateConfig>;
};
export declare class JSONBlade {
private readonly filters;
constructor(options?: JSONBladeOptions);
registerFilter(name: string, fn: FilterFunction): void;
compile(template: string, data: any, functions?: TemplateFunction[]): any;
compileAsync(template: string, data: any, functions?: TemplateFunction[]): Promise<any>;
setConfig(config: Partial<TemplateConfig>): void;
getConfig(): TemplateConfig;
}
export {};
//# sourceMappingURL=jsonblade.d.ts.map