Skip to content

Commit 85ea8ee

Browse files
fix types
1 parent 332c0f8 commit 85ea8ee

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

serve-static/serve-static.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ declare module "serve-static" {
3838
etag?: boolean;
3939

4040
/**
41-
* Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for.
41+
* Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for.
4242
* The first that exists will be served. Example: ['html', 'htm'].
4343
* The default value is false.
4444
*/
45-
extensions?: boolean;
45+
extensions?: string[];
4646

4747
/**
48-
* By default this module will send "index.html" files in response to a request on a directory.
48+
* By default this module will send "index.html" files in response to a request on a directory.
4949
* To disable this set false or to supply a new index pass a string or an array in preferred order.
5050
*/
5151
index?: boolean;
@@ -63,17 +63,17 @@ declare module "serve-static" {
6363
/**
6464
* Redirect to trailing "/" when the pathname is a dir. Defaults to true.
6565
*/
66-
redirect?: number;
66+
redirect?: boolean;
6767

6868
/**
69-
* Function to set custom headers on response. Alterations to the headers need to occur synchronously.
69+
* Function to set custom headers on response. Alterations to the headers need to occur synchronously.
7070
* The function is called as fn(res, path, stat), where the arguments are:
7171
* res the response object
7272
* path the file path that is being sent
7373
* stat the stat object of the file that is being sent
7474
*/
75-
setHeaders?: (res, path, stat) => any;
75+
setHeaders?: (res: express.Response, path: string, stat: any) => any;
7676
}): express.Handler;
77-
77+
7878
export = serveStatic;
79-
}
79+
}

0 commit comments

Comments
 (0)