forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
koa-static.d.ts
51 lines (38 loc) · 1.4 KB
/
koa-static.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
45
46
47
48
49
50
51
// Type definitions for koa-static v2.x
// Project: https://github.com/koajs/static
// Definitions by: Jerry Chin <https://github.com/hellopao/>
// Definitions: https://github.com/hellopao/DefinitelyTyped
/* =================== USAGE ===================
import serve = require("koa-static");
var Koa = require('koa');
var app = new Koa();
app.use(serve("."));
=============================================== */
/// <reference path="../koa/koa.d.ts" />
declare module "koa-static" {
import * as Koa from "koa";
function serve(root: string, opts?: {
/**
* Default file name, defaults to 'index.html'
*/
index?: boolean | string;
/**
* If true, serves after return next(),allowing any downstream middleware to respond first.
*/
defer?: boolean;
/**
* Browser cache max-age in milliseconds. defaults to 0
*/
maxage?: number;
/**
* Allow transfer of hidden files. defaults to false
*/
hidden?: boolean;
/**
* Try to serve the gzipped version of a file automatically when gzip is supported by a client and if the requested file with .gz extension exists. defaults to true.
*/
gzip?: boolean;
}): { (ctx: Koa.Context, next?: () => any): any };
namespace serve{}
export = serve;
}