Merge pull request #7551 from yhaskell/master

Reflect API changes in express-handlebars
This commit is contained in:
Masahiro Wakame
2016-01-11 23:36:05 +09:00
2 changed files with 8 additions and 4 deletions
@@ -6,9 +6,8 @@ import express = require('express');
import exphbs = require('express-handlebars');
var app = express();
var hbs: Exphbs = exphbs.create({defaultLayout: 'main'});
app.engine('handlebars', hbs.engine);
app.engine('handlebars', exphbs({defaultLayout: 'main'}));
app.set('view engine', 'handlebars');
app.listen(1337);
+7 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for express-handlebars
// Project: https://github.com/ericf/express-handlebars
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>, Igor Dultsev <https://github.com/yhaskell>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../es6-promise/es6-promise.d.ts" />
@@ -40,7 +40,12 @@ interface Exphbs {
renderView(viewPath: string, optionsOrCallback: any, callback?: () => string): void;
}
interface ExpressHandlebars {
(options?: ExphbsOptions): Function;
create (options?: ExphbsOptions): Exphbs;
}
declare module "express-handlebars" {
var exphbs: Exphbs;
var exphbs: ExpressHandlebars;
export = exphbs;
}