Added extensibility point for templates.

This allows named templates to be added, for example:

    interface HandlebarsTemplates {
        specialListOfThings: HandlebarsTemplateDelegate;
    }

So the strongly typed version can be used.

    var template = Handlebars.templates.specialListOfThings;
This commit is contained in:
Steve Fenton
2014-07-25 08:15:51 +01:00
parent 6e614f3415
commit e911b3c061
+6 -2
View File
@@ -37,9 +37,13 @@ interface HandlebarsStatic extends HandlebarsCommon {
compile(input: any, options?: any): HandlebarsTemplateDelegate;
}
interface HandlebarsRuntimeStatic extends HandlebarsCommon {
interface HandlebarsTemplates {
[index: string]: HandlebarsTemplateDelegate;
}
interface HandlebarsRuntimeStatic extends HandlebarsCommon {
// Handlebars.templates is the default template namespace in precompiler.
templates: { (s: string): HandlebarsTemplateDelegate }[];
templates: HandlebarsTemplates;
}
declare class SafeString {