-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathindex.d.ts
43 lines (36 loc) · 1.02 KB
/
index.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
import { Plugin, OutputOptions } from "rollup";
import { partial } from "filesize";
export interface FileSizeInfo {
minSize: string;
gzipSize: string;
brotliSize: string;
bundleSize: string;
fileName: string;
lastVersion?: string;
bundleSizeBefore?: string;
brotliSizeBefore?: string;
minSizeBefore?: string;
gzipSizeBefore?: string;
}
export type FileSizeRender<T> = (
options: FileSizeOptions,
outputOptions: OutputOptions,
info: FileSizeInfo
) => T;
export interface FileSizeOptions {
showMinifiedSize?: boolean;
showGzippedSize?: boolean;
showBrotliSize?: boolean;
showBeforeSizes?: "release" | "build" | "none";
format?: Parameters<typeof partial>[0];
render?: FileSizeRender<string>;
theme?: "dark" | "light";
}
export type FileSizeReporter =
| "boxen"
| FileSizeRender<string | Promise<string>>;
export interface FileSizePluginOptions extends FileSizeOptions {
reporter?: FileSizeReporter | FileSizeReporter[];
}
declare const filesize: (options?: FileSizePluginOptions) => Plugin;
export default filesize;