/
index.ts
41 lines (37 loc) · 1.05 KB
/
index.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
import {
StringRegExpArray,
UserDefinedSafelist,
} from "../../../purgecss/src/types/index";
export interface RawContent<T = string> {
extension: string;
raw: T;
}
export interface RawCSS {
raw: string;
}
type ExtractorFunction<T = string> = (content: T) => string[];
export interface Extractors {
extensions: string[];
extractor: ExtractorFunction;
}
type OutputFunction = (css: string, styles: string[]) => void;
export interface UserDefinedOptions {
content: Array<string | RawContent>;
contentFunction?: (sourceFile: string) => Array<string | RawContent>;
defaultExtractor?: ExtractorFunction;
extractors?: Array<Extractors>;
fontFace?: boolean;
keyframes?: boolean;
output?: string | OutputFunction | boolean;
rejected?: boolean;
stdin?: boolean;
stdout?: boolean;
variables?: boolean;
safelist?: UserDefinedSafelist;
blocklist?: StringRegExpArray;
skippedContentGlobs?: Array<string>;
insert?: boolean;
include?: string | RegExp | (string | RegExp)[];
exclude?: string | RegExp | (string | RegExp)[];
dest?: string;
}