forked from FullHuman/purgecss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpurgecss.d.ts
More file actions
51 lines (41 loc) · 1.45 KB
/
Copy pathpurgecss.d.ts
File metadata and controls
51 lines (41 loc) · 1.45 KB
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
// Type definitions for Purgecss 0.8.0
// Project: Purgecss
// Definitions by: Ffloriel https://github.com/Ffloriel
export = Purgecss;
declare class Purgecss {
options: Purgecss.Options
constructor(options: Purgecss.Options | string)
loadConfigFile(configFile: string): Purgecss.Options
checkOptions(options: Purgecss.Options)
purge(): Array<Purgecss.FileResult>
extractFileSelector(files: Array<string>, extractors?: Array<Purgecss.ExtractorsObj>): Set<string>
getFileExtractor(filename: string, extractors: Array<Purgecss.ExtractorsObj>): Object
extractorSelectors(content: string, extractor: Object): Set<string>
getSelectorsCss(css: string, selectors: Set<string>): string
isIgnoreAnnotation(node: Object): boolean
isRuleEmpty(node:Object): boolean
shouldKeepSelector(selectorsInContent: Set<string>, selectorsInRule: Array<string>)
}
declare namespace Purgecss {
export interface Options {
content: Array<string>,
css: Array<string>,
extractors?: Array<ExtractorsObj>,
whitelist?: Array<string>,
whitelistPatterns?: Array<RegExp>,
output?: string,
stdout?: boolean,
stdin?: boolean,
info?: boolean,
rejected?: boolean,
legacy?: boolean
}
export interface ExtractorsObj {
extractor: Object,
extensions: Array<string>
}
export interface FileResult {
file: string,
css: string
}
}