mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
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.
43 lines
1.1 KiB
TypeScript
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;
|
|
}
|