Installation
npm install --save @types/koa-compress
Summary
This package contains type definitions for koa-compress (https://github.com/koajs/compress).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-compress.
import * as Koa from "koa";
import * as zlib from "zlib";
declare function koaCompress(options?: koaCompress.CompressOptions): Koa.Middleware;
declare namespace koaCompress {
export interface CompressOptions {
filter?: ((mimeType: string) => boolean) | undefined;
threshold?: number | string | undefined;
defaultEncoding?: string | undefined
br?: zlib.BrotliOptions | false | undefined;
gzip?: zlib.ZlibOptions | false | undefined;
deflate?: zlib.ZlibOptions | false | undefined;
}
}
export = koaCompress;
Additional Details
Credits
These definitions were written by Jerry Chin, and Joel Gallant.