mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
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:
Vendored
+6
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user