mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-24 11:50:59 +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:
1 parent
6e614f3415
commit
e911b3c061
1 file changed
+6
-2
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