Add type definition for the mime property exposed on serve-static.

JS source of serve-static exposes npm module mime, see: https://github.com/expressjs/serve-static/blob/master/index.js#L122
This commit is contained in:
Ole Rehmsen
2015-06-11 21:35:17 +02:00
parent 52dc8fc393
commit 813035a67f
2 changed files with 13 additions and 0 deletions

View File

@@ -18,3 +18,9 @@ app.use(serveStatic('/3', {
res.setHeader('Server', 'server-static middleware');
}
}));
serveStatic.mime.define({
'application/babylon': ['babylon'],
'application/babylonmeshdata': ['babylonmeshdata'],
'application/fx': ['fx']
});

View File

@@ -11,6 +11,7 @@
=============================================== */
/// <reference path="../express/express.d.ts" />
/// <reference path="../mime/mime.d.ts" />
declare module "serve-static" {
import express = require('express');
@@ -75,5 +76,11 @@ declare module "serve-static" {
setHeaders?: (res: express.Response, path: string, stat: any) => any;
}): express.Handler;
import m = require('mime');
module serveStatic {
var mime: typeof m;
}
export = serveStatic;
}