Skip to content

Commit 1c3d6da

Browse files
authoredJul 25, 2023
Merge pull request #171 from aitk/fixup/export-options-as-interface
fixup: Add interface for filesize options object
2 parents 57ffb51 + 2da3aaf commit 1c3d6da

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed
 

‎types/filesize.d.ts

+9-23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function filesize(arg: any, { bits, pad, base, round, locale, localeOptions, separator, spacer, symbols, standard, output, fullform, fullforms, exponent, roundingMethod, precision }?: {
1+
export interface FileSizeOptions {
22
bits?: boolean;
33
pad?: boolean;
44
base?: number;
@@ -8,37 +8,23 @@ export function filesize(arg: any, { bits, pad, base, round, locale, localeOptio
88
separator?: string;
99
spacer?: string;
1010
symbols?: {};
11-
standard?: string;
12-
output?: string;
11+
standard?: 'iec' | 'jedec';
12+
output?: 'array' | 'exponent' | 'object' | 'string';
1313
fullform?: boolean;
1414
fullforms?: any[];
1515
exponent?: number;
16-
roundingMethod?: string;
16+
roundingMethod?: 'round' | 'floor' | 'ceil';
1717
precision?: number;
18-
}): string | number | any[] | {
18+
}
19+
20+
export function filesize(arg: any, { bits, pad, base, round, locale, localeOptions, separator, spacer, symbols, standard, output, fullform, fullforms, exponent, roundingMethod, precision }?: FileSizeOptions): string | number | any[] | {
1921
value: any;
2022
symbol: any;
2123
exponent: number;
2224
unit: string;
2325
};
24-
export function partial({ bits, pad, base, round, locale, localeOptions, separator, spacer, symbols, standard, output, fullform, fullforms, exponent, roundingMethod, precision }?: {
25-
bits?: boolean;
26-
pad?: boolean;
27-
base?: number;
28-
round?: number;
29-
locale?: string;
30-
localeOptions?: {};
31-
separator?: string;
32-
spacer?: string;
33-
symbols?: {};
34-
standard?: string;
35-
output?: string;
36-
fullform?: boolean;
37-
fullforms?: any[];
38-
exponent?: number;
39-
roundingMethod?: string;
40-
precision?: number;
41-
}): (arg: any) => string | number | any[] | {
26+
27+
export function partial({ bits, pad, base, round, locale, localeOptions, separator, spacer, symbols, standard, output, fullform, fullforms, exponent, roundingMethod, precision }?: FileSizeOptions): (arg: any) => string | number | any[] | {
4228
value: any;
4329
symbol: any;
4430
exponent: number;

0 commit comments

Comments
 (0)
Please sign in to comment.