mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-07 16:30:12 +08:00
Merge pull request #7551 from yhaskell/master
Reflect API changes in express-handlebars
This commit is contained in:
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user