-
-
Notifications
You must be signed in to change notification settings - Fork 320
/
css-size.d.ts
48 lines (42 loc) · 1021 Bytes
/
css-size.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
export = cssSize;
declare function cssSize(
css: string,
options: cssSize.ProcessOptions,
processor?: cssSize.Processor
): Promise<cssSize.Result<string>>;
declare namespace cssSize {
function table(
css: string,
options: ProcessOptions,
processor?: Processor
): Promise<string>;
function numeric(
css: string,
options: ProcessOptions,
processor?: Processor
): Promise<Result<number>>;
interface HasCss {
css: string;
}
interface ProcessOptions {
[opt: string]: any;
}
type Processor = (css: string, options: ProcessOptions) => Promise<HasCss>;
/**
* The size before and after, the absolute different and the percent improvement.
*/
interface SizeInfo<T extends string | number> {
original: T;
processed: T;
difference: T;
percent: T;
}
/**
* Size deltas of the css in various formats.
*/
interface Result<T extends string | number> {
uncompressed: SizeInfo<T>;
gzip: SizeInfo<T>;
brotli: SizeInfo<T>;
}
}