mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Update express-handlebars.d.ts
This commit is contained in:
+28
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user