@types/clean-css
Advanced tools
Comparing version 4.2.0 to 4.2.1
@@ -11,79 +11,74 @@ // Type definitions for clean-css 4.2 | ||
declare namespace CleanCSS { | ||
/** | ||
* Shared options passed when initializing a new instance of CleanCSS that returns either a promise or output | ||
*/ | ||
interface OptionsBase { | ||
/** | ||
* Options passed when initializing a new instance of CleanCSS | ||
* Controls compatibility mode used; defaults to ie10+ using `'*'`. | ||
* Compatibility hash exposes the following properties: `colors`, `properties`, `selectors`, and `units` | ||
*/ | ||
interface Options { | ||
/** | ||
* Controls compatibility mode used; defaults to ie10+ using `'*'`. | ||
* Compatibility hash exposes the following properties: `colors`, `properties`, `selectors`, and `units` | ||
*/ | ||
compatibility?: "*" | "ie9" | "ie8" | "ie7" | CompatibilityOptions; | ||
compatibility?: "*" | "ie9" | "ie8" | "ie7" | CleanCSS.CompatibilityOptions; | ||
/** | ||
* Controls a function for handling remote requests; Defaults to the build in `loadRemoteResource` function | ||
*/ | ||
fetch?: (uri: string, inlineRequest: HttpRequestOptions | HttpsRequestOptions, inlineTimeout: number, done: (message: string | number, body: string) => void) => void; | ||
/** | ||
* Controls a function for handling remote requests; Defaults to the build in `loadRemoteResource` function | ||
*/ | ||
fetch?: (uri: string, inlineRequest: HttpRequestOptions | HttpsRequestOptions, inlineTimeout: number, done: (message: string | number, body: string) => void) => void; | ||
/** | ||
* Controls output CSS formatting; defaults to `false`. | ||
* Format hash exposes the following properties: `breaks`, `breakWith`, `indentBy`, `indentWith`, `spaces`, and `wrapAt`. | ||
*/ | ||
format?: "beautify" | "keep-breaks" | FormatOptions | false; | ||
/** | ||
* Controls output CSS formatting; defaults to `false`. | ||
* Format hash exposes the following properties: `breaks`, `breakWith`, `indentBy`, `indentWith`, `spaces`, and `wrapAt`. | ||
*/ | ||
format?: "beautify" | "keep-breaks" | CleanCSS.FormatOptions | false; | ||
/** | ||
* inline option whitelists which @import rules will be processed. Defaults to `'local'` | ||
* Accepts the following values: | ||
* 'local': enables local inlining; | ||
* 'remote': enables remote inlining; | ||
* 'none': disables all inlining; | ||
* 'all': enables all inlining, same as ['local', 'remote']; | ||
* '[uri]': enables remote inlining from the specified uri; | ||
* '![url]': disables remote inlining from the specified uri; | ||
*/ | ||
inline?: ReadonlyArray<string> | false; | ||
/** | ||
* inline option whitelists which @import rules will be processed. Defaults to `'local'` | ||
* Accepts the following values: | ||
* 'local': enables local inlining; | ||
* 'remote': enables remote inlining; | ||
* 'none': disables all inlining; | ||
* 'all': enables all inlining, same as ['local', 'remote']; | ||
* '[uri]': enables remote inlining from the specified uri; | ||
* '![url]': disables remote inlining from the specified uri; | ||
*/ | ||
inline?: ReadonlyArray<string> | false; | ||
/** | ||
* Controls extra options for inlining remote @import rules | ||
*/ | ||
inlineRequest?: HttpRequestOptions | HttpsRequestOptions; | ||
/** | ||
* Controls extra options for inlining remote @import rules | ||
*/ | ||
inlineRequest?: HttpRequestOptions | HttpsRequestOptions; | ||
/** | ||
* Controls number of milliseconds after which inlining a remote @import fails; defaults to `5000`; | ||
*/ | ||
inlineTimeout?: number; | ||
/** | ||
* Controls number of milliseconds after which inlining a remote @import fails; defaults to `5000`; | ||
*/ | ||
inlineTimeout?: number; | ||
/** | ||
* Controls optimization level used; defaults to `1`. | ||
* Level hash exposes `1`, and `2`. | ||
*/ | ||
level?: 0 | 1 | 2 | OptimizationsOptions; | ||
/** | ||
* Controls optimization level used; defaults to `1`. | ||
* Level hash exposes `1`, and `2`. | ||
*/ | ||
level?: 0 | 1 | 2 | CleanCSS.OptimizationsOptions; | ||
/** | ||
* Controls URL rebasing; defaults to `true`; | ||
*/ | ||
rebase?: boolean; | ||
/** | ||
* Controls URL rebasing; defaults to `true`; | ||
*/ | ||
rebase?: boolean; | ||
/** | ||
* controls a directory to which all URLs are rebased, most likely the directory under which the output file | ||
* will live; defaults to the current directory; | ||
*/ | ||
rebaseTo?: string; | ||
/** | ||
* controls a directory to which all URLs are rebased, most likely the directory under which the output file | ||
* will live; defaults to the current directory; | ||
*/ | ||
rebaseTo?: string; | ||
/** | ||
* If you prefer clean-css to return a Promise object then you need to explicitely ask for it; defaults to `false` | ||
*/ | ||
returnPromise?: boolean; | ||
/** | ||
* Controls whether an output source map is built; defaults to `false` | ||
*/ | ||
sourceMap?: boolean; | ||
/** | ||
* Controls whether an output source map is built; defaults to `false` | ||
*/ | ||
sourceMap?: boolean; | ||
/** | ||
* Controls embedding sources inside a source map's `sourcesContent` field; defaults to `false` | ||
*/ | ||
sourceMapInlineSources?: boolean; | ||
} | ||
/** | ||
* Controls embedding sources inside a source map's `sourcesContent` field; defaults to `false` | ||
*/ | ||
sourceMapInlineSources?: boolean; | ||
} | ||
declare namespace CleanCSS { | ||
/** | ||
@@ -655,7 +650,35 @@ * Output returned when calling minify functions | ||
/** | ||
* Options when returning a promise | ||
*/ | ||
type OptionsPromise = OptionsBase & { | ||
/** | ||
* If you prefer clean-css to return a Promise object then you need to explicitly ask for it; defaults to `false` | ||
*/ | ||
returnPromise: true | ||
}; | ||
/** | ||
* Options when returning an output | ||
*/ | ||
type OptionsOutput = OptionsBase & { | ||
/** | ||
* If you prefer clean-css to return a Promise object then you need to explicitly ask for it; defaults to `false` | ||
*/ | ||
returnPromise?: false | ||
}; | ||
/** | ||
* Discriminant union of both sets of options types. If you initialize without setting `returnPromise: true` | ||
* and want to return a promise, you will need to cast to the correct options type so that TypeScript | ||
* knows what the expected return type will be: | ||
* `(options = options as CleanCSS.OptionsPromise).returnPromise = true` | ||
*/ | ||
type Options = OptionsPromise | OptionsOutput; | ||
/** | ||
* Constructor interface for CleanCSS | ||
*/ | ||
interface Constructor { | ||
new(options: Options & { returnPromise: true }): MinifierPromise; | ||
new(options?: Options): MinifierOutput; | ||
new(options: OptionsPromise): MinifierPromise; | ||
new(options?: OptionsOutput): MinifierOutput; | ||
} | ||
@@ -662,0 +685,0 @@ } |
{ | ||
"name": "@types/clean-css", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"description": "TypeScript definitions for clean-css", | ||
@@ -28,4 +28,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "d5d12627e4b1b93a93db31832e5fb06dc0567b21c388f83a7bafcc9ebdd2a6fb", | ||
"typesPublisherContentHash": "5f736e5cac9679580e74bf5b52692dc45d85fa0b9b6d153ae47ed4e8d6b55e59", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Fri, 25 Jan 2019 00:14:39 GMT | ||
* Last updated: Thu, 31 Jan 2019 01:45:39 GMT | ||
* Dependencies: @types/node | ||
@@ -14,0 +14,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
23850
580
0