1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | import * as express from 'express';
|
11 | import * as fs from 'fs';
|
12 |
|
13 | declare namespace serveIndex {
|
14 | interface File {
|
15 | name: string;
|
16 | stat: fs.Stats;
|
17 | }
|
18 |
|
19 | interface Locals {
|
20 | directory: string;
|
21 | displayIcons: boolean;
|
22 | fileList: Array<File>;
|
23 | name: string;
|
24 | stat: fs.Stats;
|
25 | path: string;
|
26 | style: string;
|
27 | viewName: string;
|
28 | }
|
29 |
|
30 | type templateCallback = (error: Error, htmlString?: string) => void;
|
31 |
|
32 | interface Options {
|
33 | filter?: (filename: string, index: number, files: Array<File>, dir: string) => boolean;
|
34 | hidden?: boolean;
|
35 | icons?: boolean;
|
36 | stylesheet?: string;
|
37 | template?: string | ((locals: Locals, callback: templateCallback) => void);
|
38 | view?: string;
|
39 | }
|
40 | }
|
41 |
|
42 | declare function serveIndex(path: string, options?: serveIndex.Options): express.Handler;
|
43 |
|
44 | export = serveIndex;
|
45 |
|
\ | No newline at end of file |