0.1.5 • Published 6 months ago
@types/shrink-ray v0.1.5
Installation
npm install --save @types/shrink-ray
Summary
This package contains type definitions for shrink-ray (https://github.com/aickin/shrink-ray).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/shrink-ray.
index.d.ts
// Type definitions for shrink-ray 0.1
// Project: https://github.com/aickin/shrink-ray, https://github.com/aickin/compression
// Definitions by: forabi <https://github.com/forabi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { RequestHandler, Request, Response } from 'express';
import * as zlib from 'zlib';
type FilterFunction = (req: Request, res: Response) => boolean;
type Options = Partial<{
cacheSize: number;
threshold: number;
zlib: Partial<{
/** default: zlib.constants.Z_NO_FLUSH */
flush?: number | undefined;
/** default: zlib.constants.Z_FINISH */
finishFlush?: number | undefined;
/** default: 16*1024 */
chunkSize?: number | undefined;
windowBits?: number | undefined;
/** compression only */
strategy?: number | undefined;
/** deflate/inflate only, empty dictionary by default */
dictionary?: any;
/** compression only */
level: -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
/** compression only */
memLevel: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
}>;
brotli: {
lgblock: number;
lgwin: number;
mode: 0 | 1 | 2;
quality: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
};
filter: FilterFunction;
cache(req: Request, res: Response): boolean;
}>;
interface CreateMiddleware {
(options?: Options): RequestHandler;
filter: FilterFunction;
}
declare const createMiddleware: CreateMiddleware;
export = createMiddleware;
Additional Details
- Last updated: Tue, 06 Jul 2021 16:34:45 GMT
- Dependencies: @types/express
- Global values: none
Credits
These definitions were written by forabi.