1 |
|
2 |
|
3 |
|
4 | declare function bytes(value: number, options?: bytes.BytesOptions): string | null;
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | declare function bytes(value: string): number | null;
|
10 |
|
11 | declare namespace bytes {
|
12 | type Unit = "b" | "gb" | "kb" | "mb" | "pb" | "tb" | "B" | "GB" | "KB" | "MB" | "PB" | "TB";
|
13 |
|
14 | interface BytesOptions {
|
15 | decimalPlaces?: number | undefined;
|
16 | fixedDecimals?: boolean | undefined;
|
17 | thousandsSeparator?: string | undefined;
|
18 | unit?: Unit | undefined;
|
19 | unitSeparator?: string | undefined;
|
20 | }
|
21 |
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | function format(value: number, options?: BytesOptions): string | null;
|
29 |
|
30 | |
31 |
|
32 |
|
33 |
|
34 |
|
35 | function parse(value: string | number): number | null;
|
36 | }
|
37 |
|
38 | export = bytes;
|