mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 09:01:45 +08:00
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:
@@ -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']
|
||||
});
|
||||
7
serve-static/serve-static.d.ts
vendored
7
serve-static/serve-static.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user