import Handlebars, { HelperDelegate, TemplateDelegate } from 'handlebars'; import { TRenderCallback, TPartialTemplates, TFilePaths } from './types'; export type TPageKitHandlebarsOptions = { /** * An instance of Handlebars to use. * @default require('handlebars') */ handlebars?: typeof Handlebars; /** * Current working directory. * @default process.cwd() */ rootDirectory?: string; /** * Additional helper functions to register with Handlebars. * @default {} */ helpers?: { [key: string]: HelperDelegate; }; /** * Partial templates to register with Handlebars. * @default {} */ partials?: TPartialTemplates; /** * A list of directories and patterns used to dynamically find and load partial template files. * @default { './views/partials': '**\/*.{hbs,html}' } */ partialPaths?: TFilePaths; /** * Enable caching of template files to reduce filesystem I/O * @default process.env.NODE_ENV !== 'development */ cache?: boolean; }; export declare class PageKitHandlebars { options: TPageKitHandlebarsOptions; engine: this['renderView']; private cache; constructor(userOptions?: TPageKitHandlebarsOptions); loadPartials(): TPartialTemplates; loadTemplate(filePath: string): TemplateDelegate; render(template: string | TemplateDelegate, templateContext: any): string; renderView(templatePath: string, templateContext: any, callback: TRenderCallback): void; }