@types/koa-static
TypeScript icon, indicating that this package has built-in type declarations

4.0.4 • Public • Published

Installation

npm install --save @types/koa-static

Summary

This package contains type definitions for koa-static (https://github.com/koajs/static).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-static.

index.d.ts

/* =================== USAGE ===================

    import serve = require("koa-static");
    var Koa = require('koa');

    var app = new Koa();
    app.use(serve("."));

 =============================================== */

import { Middleware } from "koa";

import { SendOptions } from "koa-send";

declare function serve(root: string, opts?: serve.Options): Middleware<{}>;

declare namespace serve {
    interface Options extends SendOptions {
        /** If true, serves after return next(), allowing any downstream middleware to respond first. */
        defer?: boolean | undefined;
    }
}

export = serve;

Additional Details

Credits

These definitions were written by Jerry Chin, and Tomek Łaziuk.

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @types/koa-static

    Weekly Downloads

    124,505

    Version

    4.0.4

    License

    MIT

    Unpacked Size

    4.13 kB

    Total Files

    5

    Last publish

    Collaborators

    • types