From e911b3c06170ac7c68391f03f7ac884152f5fbc7 Mon Sep 17 00:00:00 2001 From: Steve Fenton Date: Fri, 25 Jul 2014 08:15:51 +0100 Subject: [PATCH] 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; --- handlebars/handlebars.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars.d.ts index ee3098ec4..56cce331f 100644 --- a/handlebars/handlebars.d.ts +++ b/handlebars/handlebars.d.ts @@ -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 {