Update express-handlebars.d.ts

This commit is contained in:
Sam Saint-Pettersen
2015-10-22 17:23:27 +01:00
parent 1f025c1af4
commit dc088ccb75
+28 -1
View File
@@ -3,6 +3,20 @@
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Promise {} // This should be replaced with a Promise type definition import.
interface PartialTemplateOptions {
cache?: boolean;
precompiled?: boolean;
}
interface RenderOptions {
cache?: boolean;
data?: Object;
helpers?: any;
partials?: any;
}
interface ExphbsOptions {
handlebars?: any;
extname?: string;
@@ -13,7 +27,20 @@ interface ExphbsOptions {
compilerOptions?: any;
}
interface Exphbs {
engine: Function;
extname: string;
compiled: Object;
precompiled: Object;
create(options?: ExphbsOptions): Exphbs;
getPartials(options?: PartialTemplateOptions): Promise;
getTemplate(filePath: string, options?: PartialTemplateOptions): Promise;
getTemplates(dirPath: string, options?: PartialTemplateOptions): Promise;
render(filePath: string, context: Object, options?: RenderOptions): Promise;
renderView(viewPath: string, optionsOrCallback?: any, callback?: Function): void;
}
declare module "express-handlebars" {
function exphbs(options: ExphbsOptions): Function;
var exphbs: Exphbs;
export = exphbs;
}