DefinitelyTyped/handlebars/handlebars.d.ts
Steven b8e5189925 Changing the context param to be OPTIONAL
The compile function returns a template function. The template function takes two parameters, `context` and `options`. These are both optional parameters. This commit fixes `context` to be optional.
2014-01-23 16:08:20 -08:00

43 lines
1.1 KiB
TypeScript

// Type definitions for Handlebars 1.0
// Project: http://handlebarsjs.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var Handlebars: HandlebarsStatic;
interface HandlebarsStatic {
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;
}
declare class SafeString {
constructor(str: string);
static toString(): string;
}
interface Logger {
DEBUG: number;
INFO: number;
WARN: number;
ERROR: number;
level: number;
methodMap: { [level: number]: string };
log(level: number, obj: string): void;
}
declare module "handlebars" {
export = Handlebars;
}