1 | // Type definitions for koa-static 4.0
|
2 | // Project: https://github.com/koajs/static
|
3 | // Definitions by: Jerry Chin <https://github.com/hellopao>
|
4 | // Tomek Łaziuk <https://github.com/tlaziuk>
|
5 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
6 | // TypeScript Version: 2.3
|
7 |
|
8 | /* =================== USAGE ===================
|
9 |
|
10 | import serve = require("koa-static");
|
11 | var Koa = require('koa');
|
12 |
|
13 | var app = new Koa();
|
14 | app.use(serve("."));
|
15 |
|
16 | =============================================== */
|
17 |
|
18 | import { Middleware } from "koa";
|
19 |
|
20 | import { SendOptions } from "koa-send";
|
21 |
|
22 | declare function serve(root: string, opts?: serve.Options): Middleware<{}>;
|
23 |
|
24 | declare namespace serve {
|
25 | interface Options extends SendOptions {
|
26 | /** If true, serves after return next(), allowing any downstream middleware to respond first. */
|
27 | defer?: boolean | undefined;
|
28 | }
|
29 | }
|
30 |
|
31 | export = serve;
|