Skip to content

Commit 16c28fc

Browse files
committed
Merge pull request DefinitelyTyped#4622 from rehmsen/feature/serve-static_exposing_mime
Add type definition for the mime property exposed on serve-static.
2 parents 8b04086 + 813035a commit 16c28fc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

serve-static/serve-static-tests.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ app.use(serveStatic('/3', {
1818
res.setHeader('Server', 'server-static middleware');
1919
}
2020
}));
21+
22+
serveStatic.mime.define({
23+
'application/babylon': ['babylon'],
24+
'application/babylonmeshdata': ['babylonmeshdata'],
25+
'application/fx': ['fx']
26+
});

serve-static/serve-static.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
=============================================== */
1212

1313
/// <reference path="../express/express.d.ts" />
14+
/// <reference path="../mime/mime.d.ts" />
1415

1516
declare module "serve-static" {
1617
import express = require('express');
@@ -75,5 +76,11 @@ declare module "serve-static" {
7576
setHeaders?: (res: express.Response, path: string, stat: any) => any;
7677
}): express.Handler;
7778

79+
import m = require('mime');
80+
81+
module serveStatic {
82+
var mime: typeof m;
83+
}
84+
7885
export = serveStatic;
7986
}

0 commit comments

Comments
 (0)