mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-24 11:29:30 +08:00
Merge pull request #2075 from omidkrad/handlebars-runtime
Added definitions for Handlebars Runtime
This commit is contained in:
Vendored
+26
-3
@@ -4,22 +4,45 @@
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
// Use either HandlebarsStatic or HandlebarsRuntimeStatic
|
||||
declare var Handlebars: HandlebarsStatic;
|
||||
//declare var Handlebars: HandlebarsRuntimeStatic;
|
||||
|
||||
interface HandlebarsStatic {
|
||||
/**
|
||||
* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
|
||||
**/
|
||||
interface HandlebarsTemplatable {
|
||||
template: HandlebarsTemplateDelegate;
|
||||
}
|
||||
|
||||
interface HandlebarsTemplateDelegate {
|
||||
(context: any, options?: any): string;
|
||||
}
|
||||
|
||||
interface HandlebarsCommon {
|
||||
registerHelper(name: string, fn: Function, inverse?: boolean): void;
|
||||
registerPartial(name: string, str: any): void;
|
||||
K(): void;
|
||||
createFrame(object: any): any;
|
||||
|
||||
Exception(message: string): void;
|
||||
SafeString: typeof SafeString;
|
||||
parse(input: string): boolean;
|
||||
|
||||
logger: Logger;
|
||||
log(level: number, obj: any): void;
|
||||
compile(input: any, options?: any): (context?: any, options?: any) => string;
|
||||
Logger: typeof Logger;
|
||||
}
|
||||
|
||||
interface HandlebarsStatic extends HandlebarsCommon {
|
||||
parse(input: string): boolean;
|
||||
compile(input: any, options?: any): HandlebarsTemplateDelegate;
|
||||
}
|
||||
|
||||
interface HandlebarsRuntimeStatic extends HandlebarsCommon {
|
||||
// Handlebars.templates is the default template namespace in precompiler.
|
||||
templates: { (s: string): HandlebarsTemplateDelegate }[];
|
||||
}
|
||||
|
||||
declare class SafeString {
|
||||
constructor(str: string);
|
||||
static toString(): string;
|
||||
|
||||
Reference in New Issue
Block a user