-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserve-content.d.ts
37 lines (35 loc) · 1.2 KB
/
serve-content.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import * as express from 'express';
declare function serveContent(root: string, options: serveContent.ServeContentOptions): express.Handler;
declare namespace serveContent {
type ServeStaticOptions = {
allowedExts?: string[];
allowAllExts?: boolean;
excludeExts?: string[];
cacheControl?: boolean;
dotfiles?: string;
etag?: boolean;
extensions?: string[] | false;
fallthrough?: boolean;
immutable?: boolean;
index?: boolean | string | string[];
lastModified?: boolean;
maxAge?: number | string;
redirect?: boolean;
setHeaders?: (res: express.Response, path: string, stat: any) => any;
}
type ServeContentOptions = ServeStaticOptions&({
allowedExts: string[]
}|{
allowAllExts: boolean
excludeExts?: string[]
})&{
jade?: object
styl?: object
serveStatic?: (root: string, options?: ServeContentOptions) => express.Handler
}
function serveContent(root: string, options: ServeContentOptions): express.Handler;
var transformer:{
[ext:string]:{optionName:string}
}
}
export = serveContent;