UNPKG

1.9 kBTypeScriptView Raw
1// Type definitions for gulp-size 4.0
2// Project: https://github.com/sindresorhus/gulp-size
3// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
4// Remisery <https://github.com/remisery>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
7/// <reference types="node" />
8
9declare namespace size {
10 interface Options {
11 /**
12 * Displays the size of every file instead of just the total size.
13 *
14 * @default false
15 */
16 showFiles?: boolean | undefined;
17
18 /**
19 * Displays the gzipped size.
20 *
21 * @default false
22 */
23 gzip?: boolean | undefined;
24
25 /**
26 * Give it a title so it's possible to distinguish the output of multiple instances logging at once.
27 *
28 * @default ''
29 */
30 title?: string | undefined;
31
32 /**
33 * Displays prettified size: 1337 B → 1.34 kB.
34 *
35 * @default true
36 */
37 pretty?: boolean | undefined;
38
39 /**
40 * Displays the total of all files.
41 *
42 * @default true
43 */
44 showTotal?: boolean | undefined;
45
46 /**
47 * Displays the brotli compressed size.
48 *
49 * @default false
50 */
51 brotli?: boolean | undefined;
52
53 /**
54 * Displays the uncompressed size.
55 *
56 * @default false
57 */
58 uncompressed?: boolean | undefined;
59 }
60
61 interface SizeStream extends NodeJS.ReadWriteStream {
62 /**
63 * The total size of all files in bytes.
64 *
65 * @example 12423000
66 */
67 size: number;
68
69 /**
70 * Prettified version of .size.
71 *
72 * @example 14 kB
73 */
74 prettySize: string;
75 }
76}
77
78declare function size(options?: size.Options): size.SizeStream;
79
80export = size;