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