1.5.3 • Published 2 years ago

@types/koa-static-server v1.5.3

Weekly downloads
518
License
MIT
Repository
github
Last release
2 years ago

Installation

npm install --save @types/koa-static-server

Summary

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

Details

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

index.d.ts

// Type definitions for koa-static-server 1.5
// Project: https://github.com/pkoretic/koa-static-server
// Definitions by: wulunyi <https://github.com/wulunyi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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

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

    var app = new Koa();
    app.use(serve(serve({rootDir: 'web'}));

 =============================================== */
import { Middleware } from "koa";

declare function KoaStaticServer(options: KoaStaticServer.Options): Middleware;

declare namespace KoaStaticServer {
  interface Options {
    /**
     * directory that is to be served
     */
    rootDir?: string | undefined;
    /**
     * optional rewrite path
     */
    rootPath?: string | undefined;
    /**
     * optional default file to serve if requested static is missing
     */
    notFoundFile?: string | undefined;
    /**
     * request access log to console
     */
    log?: boolean | undefined;
    /**
     * don't execute any downstream middleware. defaults to true
     */
    last?: boolean | undefined;
    /**
     * Browser cache max-age in milliseconds. defaults to 0
     */
    maxage?: number | undefined;
    /**
     * Allow transfer of hidden files. defaults to false
     */
    hidden?: boolean | undefined;
    /**
     * Try to serve the gzipped version of a file automatically when gzip is supported by a client and if the requested
     */
    gzip?: boolean | undefined;
    /**
     * Try to serve the brotli version of a file automatically when brotli is supported by a client and in the requested
     */
    brotli?: boolean | undefined;
    index?: string | undefined;
  }
}

export = KoaStaticServer;

Additional Details

  • Last updated: Thu, 21 Oct 2021 01:01:21 GMT
  • Dependencies: @types/koa
  • Global values: none

Credits

These definitions were written by wulunyi.

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

4 years ago

1.3.1

4 years ago

1.3.0

7 years ago