@types/koa-compress
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -33,3 +33,3 @@ // Type definitions for koa-compress v4.x | ||
*/ | ||
filter?: (mimeType: string) => boolean; | ||
filter?: ((mimeType: string) => boolean) | undefined; | ||
@@ -39,3 +39,3 @@ /** | ||
*/ | ||
threshold?: number | string; | ||
threshold?: number | string | undefined; | ||
@@ -46,3 +46,3 @@ /** | ||
*/ | ||
defaultEncoding?: string | ||
defaultEncoding?: string | undefined | ||
@@ -52,3 +52,3 @@ /** | ||
*/ | ||
br?: zlib.BrotliOptions | false; | ||
br?: zlib.BrotliOptions | false | undefined; | ||
@@ -58,3 +58,3 @@ /** | ||
*/ | ||
gzip?: zlib.ZlibOptions | false; | ||
gzip?: zlib.ZlibOptions | false | undefined; | ||
@@ -64,3 +64,3 @@ /** | ||
*/ | ||
deflate?: zlib.ZlibOptions | false; | ||
deflate?: zlib.ZlibOptions | false | undefined; | ||
} | ||
@@ -67,0 +67,0 @@ } |
{ | ||
"name": "@types/koa-compress", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "TypeScript definitions for koa-compress", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-compress", | ||
"license": "MIT", | ||
@@ -30,4 +31,4 @@ "contributors": [ | ||
}, | ||
"typesPublisherContentHash": "8d2cb06be9ab67ffeb407c408e259c55f2d1b30c24e64418058b337a06aa0471", | ||
"typeScriptVersion": "3.2" | ||
"typesPublisherContentHash": "420a63c5d458e8d90c4af745016995e79f2fbd6f2a044cb0cacc1c5f14d920f7", | ||
"typeScriptVersion": "3.6" | ||
} |
@@ -9,5 +9,72 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-compress. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-compress/index.d.ts) | ||
````ts | ||
// Type definitions for koa-compress v4.x | ||
// Project: https://github.com/koajs/compress | ||
// Definitions by: Jerry Chin <https://github.com/hellopao> | ||
// Joel Gallant <https://github.com/joelgallant> | ||
// Definitions: https://github.com/hellopao/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
/* =================== USAGE =================== | ||
import compress = require("koa-compress"); | ||
var Koa = require('koa'); | ||
var app = new Koa(); | ||
app.use(compress()); | ||
=============================================== */ | ||
/// <reference types="node" /> | ||
/// <reference types="koa" /> | ||
import * as Koa from "koa"; | ||
import * as zlib from "zlib"; | ||
/** | ||
* Compress middleware for Koa | ||
*/ | ||
declare function koaCompress(options?: koaCompress.CompressOptions): Koa.Middleware; | ||
declare namespace koaCompress { | ||
export interface CompressOptions { | ||
/** | ||
* An optional function that checks the response content type to decide whether to compress. By default, it uses compressible. | ||
*/ | ||
filter?: ((mimeType: string) => boolean) | undefined; | ||
/** | ||
* Minimum response size in bytes to compress. Default 1024 bytes or 1kb. | ||
*/ | ||
threshold?: number | string | undefined; | ||
/** | ||
* An optional string, which specifies what encoders to use for requests | ||
* without Accept-Encoding. Default: 'idenity'. | ||
*/ | ||
defaultEncoding?: string | undefined | ||
/** | ||
* Options for brotli compression. | ||
*/ | ||
br?: zlib.BrotliOptions | false | undefined; | ||
/** | ||
* Options for gzip compression. | ||
*/ | ||
gzip?: zlib.ZlibOptions | false | undefined; | ||
/** | ||
* Options for deflate compression. | ||
*/ | ||
deflate?: zlib.ZlibOptions | false | undefined; | ||
} | ||
} | ||
export = koaCompress; | ||
```` | ||
### Additional Details | ||
* Last updated: Thu, 01 Oct 2020 22:50:49 GMT | ||
* Last updated: Tue, 06 Jul 2021 22:02:37 GMT | ||
* Dependencies: [@types/koa](https://npmjs.com/package/@types/koa), [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -14,0 +81,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
6596
0
84