forked from FullHuman/purgecss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpurgecss.d.ts
81 lines (62 loc) · 1.85 KB
/
purgecss.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
// Type definitions for Purgecss 1.0
// Project: Purgecss
// Definitions by: Ffloriel https://github.com/Ffloriel
// JounQin https://github.com/JounQin
export = Purgecss
declare class Purgecss {
options: Purgecss.Options
constructor(options: Purgecss.Options | string)
loadConfigFile(configFile: string): Purgecss.Options
checkOptions(options: Purgecss.Options): void
purge(): Array<Purgecss.FileResult>
extractFileSelector(
files: Array<string>,
extractors?: Array<Purgecss.ExtractorsObj>
): Set<string>
extractRawSelector(
content: Array<Purgecss.RawContent>,
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, type: Purgecss.IgnoreType): boolean
isRuleEmpty(node: Object): boolean
shouldKeepSelector(
selectorsInContent: Set<string>,
selectorsInRule: Array<string>
) :boolean
}
declare namespace Purgecss {
export interface Options {
content: Array<string | RawContent>
css: Array<string | RawContent>
extractors?: Array<ExtractorsObj>
whitelist?: Array<string>
whitelistPatterns?: Array<RegExp>
whitelistPatternsChildren?: Array<RegExp>
output?: string
stdout?: boolean
stdin?: boolean
keyframes?: boolean
fontFace?: boolean
rejected?: boolean
}
export interface ExtractorsObj {
extractor: Object
extensions: Array<string>
}
export interface FileResult {
file: string | null
css: string
rejected: Array<string> | null
}
export interface RawContent {
raw: string
extension: string
}
export type IgnoreType = "next" | "start" | "end"
}