mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Improve type of HandlebarsTemplateDelegate
Adds an optional type argument that should be useful for .hbs.d.ts files. The RuntimeOptions were specified by looking at https://github.com/wycats/handlebars.js/blob/680ec96/lib/handlebars/runtime.js#L131-L171 -- these don't seem to be documented anywhere.
This commit is contained in:
Vendored
+10
-2
@@ -96,8 +96,8 @@ interface HandlebarsTemplatable {
|
||||
template: HandlebarsTemplateDelegate;
|
||||
}
|
||||
|
||||
interface HandlebarsTemplateDelegate {
|
||||
(context: any, options?: any): string;
|
||||
interface HandlebarsTemplateDelegate<T = any> {
|
||||
(context: T, options?: RuntimeOptions): string;
|
||||
}
|
||||
|
||||
interface HandlebarsTemplates {
|
||||
@@ -108,6 +108,14 @@ interface TemplateSpecification {
|
||||
|
||||
}
|
||||
|
||||
interface RuntimeOptions {
|
||||
partial?: boolean;
|
||||
depths?: any[];
|
||||
helpers?: { [name: string]: Function }
|
||||
partials?: { [name: string]: HandlebarsTemplateDelegate }
|
||||
decorators?: { [name: string]: Function }
|
||||
}
|
||||
|
||||
interface CompileOptions {
|
||||
data?: boolean;
|
||||
compat?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user