UNPKG

617 BTypeScriptView Raw
1/* =================== USAGE ===================
2
3 import serve = require("koa-static");
4 var Koa = require('koa');
5
6 var app = new Koa();
7 app.use(serve("."));
8
9 =============================================== */
10
11import { Middleware } from "koa";
12
13import { SendOptions } from "koa-send";
14
15declare function serve(root: string, opts?: serve.Options): Middleware<{}>;
16
17declare namespace serve {
18 interface Options extends SendOptions {
19 /** If true, serves after return next(), allowing any downstream middleware to respond first. */
20 defer?: boolean | undefined;
21 }
22}
23
24export = serve;