forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexpress-minify.d.ts
109 lines (88 loc) · 2.77 KB
/
express-minify.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Type definitions for express-minify v0.1.6
// Project: https://github.com/SummerWish/express-minify
// Definitions by: Borislav Zhivkov <https://github.com/borislavjivkov/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
/// <reference path="../uglify-js/uglify-js.d.ts" />
declare namespace Express {
interface Response extends ExpressMinifyInterfaces.ExpressMinifyResponse {}
}
declare namespace ExpressMinifyInterfaces {
interface ExpressMinifyOptions {
/**
* The directory for cache storage (must be writeable). Pass false to cache in the memory (not recommended).
*/
cache?: string | boolean;
/**
* Customize UglifyJS instance (require('uglify-js')).
*/
uglifyJS?: NodeRequire;
/**
* Customize cssmin instance (require('cssmin')).
*/
cssmin?: NodeRequire;
/**
* Handle compiling errors or minifying errors. You can determine what to respond when facing such errors.
*/
onerror?: Function;
/**
* Matches JavaScript content-type.
*/
js_match?: RegExp;
/**
* Matches CSS content-type.
*/
css_match?: RegExp;
/**
* Matches SASS content-type.
*/
sass_match?: RegExp;
/**
* Matches LESS content-type.
*/
less_match?: RegExp;
/**
* Matches Stylus content-type.
*/
stylus_match?: RegExp;
/**
* Matches CoffeeScript content-type.
*/
coffee_match?: RegExp;
/**
* Matches JSON content-type.
*/
json_match?: RegExp;
}
interface ExpressMinifyResponse {
/**
* Pass true to disable all kind of processing: no compiling, no minifying.
*/
_skip: boolean;
/**
* Pass true to disable minifying, suitable for already-minified contents.
*/
_no_minify: boolean;
/**
* Pass true to disable caching the response data, suitable for dynamic contents.
*/
_no_cache: boolean;
/**
* Pass false to disable mangling names
*/
_uglifyMangle: boolean;
/**
* Pass an object if you wish to specify additional UglifyJS
*/
_uglifyOutput: Object;
/**
* Pass an object to specify custom UglifyJS compressor options (pass false to skip).
*/
_uglifyCompress: Object | boolean;
}
}
declare module "express-minify" {
import express = require('express');
function minify(options?: ExpressMinifyInterfaces.ExpressMinifyOptions): express.RequestHandler;
export = minify;
}