forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serve-index.d.ts
44 lines (36 loc) · 1.15 KB
/
serve-index.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
38
39
40
41
42
43
44
// Type definitions for serve-index v1.7.2
// Project: https://github.com/expressjs/serve-index
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module 'serve-index' {
import * as express from 'express';
import * as fs from 'fs';
namespace serveIndex {
interface File {
name: string;
stat: fs.Stats;
}
interface Locals {
directory: string;
displayIcons: boolean;
fileList: Array<File>;
name: string;
stat: fs.Stats;
path: string;
style: string;
viewName: string;
}
type templateCallback = (error: Error, htmlString?: string) => void;
interface Options {
filter?: (filename: string, index: number, files: Array<File>, dir: string) => boolean;
hidden?: boolean;
icons?: boolean;
stylesheet?: string;
template?: string | ((locals: Locals, callback: templateCallback) => void);
view?: string;
}
}
function serveIndex(path: string, options?: serveIndex.Options): express.Handler;
export = serveIndex;
}