5.1.4 • Published 6 months ago

@types/koa-static-cache v5.1.4

Weekly downloads
2,068
License
MIT
Repository
github
Last release
6 months ago

Installation

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

Summary

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

Details

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

index.d.ts

// Type definitions for koa-static-cache 5.1
// Project: https://github.com/koajs/static-cache#readme
// Definitions by: JounQin <https://github.com/JounQin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

/**
 * Static server for koa.
 */

import { Middleware } from 'koa';

declare namespace staticCache {
    interface Files {
        [path: string]: Options;
    }

    interface Options {
        dir?: string | undefined;
        maxAge?: number | undefined;
        cacheControl?: string | undefined;
        buffer?: boolean | undefined;
        gzip?: boolean | undefined;
        usePrecompiledGzip?: boolean | undefined;
        alias?: {} | undefined;
        prefix?: string | undefined;
        dynamic?: boolean | undefined;
        filter?: ((path: string) => boolean) | string[] | undefined;
        preload?: boolean | undefined;
        files?: Files | undefined;
    }
}

declare function staticCache(
    dir: string | staticCache.Options,
    options?: staticCache.Options | staticCache.Files,
    files?: staticCache.Files
): Middleware;

export = staticCache;

Additional Details

  • Last updated: Thu, 08 Jul 2021 16:23:25 GMT
  • Dependencies: @types/koa
  • Global values: none

Credits

These definitions were written by JounQin.