@veams/plugin-templater
Version:
A simple frontend template plugin which supports handlebars.
50 lines (49 loc) • 1.23 kB
TypeScript
/**
* Interfaces
*/
export interface ITemplaterOptions {
engine: any;
templates: any;
partials?: any;
helpers?: any[];
}
export interface ITemplater extends ITemplaterOptions {
render: any;
}
export interface VeamsExtendedByTemplater {
templater: ITemplater;
}
export interface ITemplaterPlugin {
options: ITemplaterOptions;
pluginName: string;
initialize: any;
}
/**
* Represents the Templater class which will be used in VeamsTemplater plugin.
* @module Templater
*
* @author Sebastian Fitzner
*/
declare class Templater {
options: {
engine: any;
templates: any;
partials: any;
helpers: any;
};
constructor(VEAMS: any, {engine, templates, partials, helpers}: ITemplaterOptions);
initialize(): VeamsExtendedByTemplater;
registerHelpers(): void;
addTemplater(): VeamsExtendedByTemplater;
}
/**
* Represents a templater plugin which you can use to render your precompiled handlebars templates.
* You can also register custom helpers by providing them in an array!
*
* @module VeamsTemplater
*
* @author Sebastian Fitzner
*/
declare const TemplaterPlugin: ITemplaterPlugin;
export default TemplaterPlugin;
export { Templater };