1
- // Type definitions for filesize 8 .0.3
1
+ // Type definitions for filesize 6 .0.1
2
2
// Project: https://github.com/avoidwork/filesize.js, https://filesizejs.com
3
3
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
4
4
// Renaud Chaput <https://github.com/renchap>
5
5
// Roman Nuritdinov <https://github.com/Ky6uk>
6
6
// Sam Hulick <https://github.com/ffxsam>
7
- // Tomoto S. Washio < https://github.com/tomoto>
7
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
8
8
9
9
declare var fileSize : Filesize . Filesize ;
10
10
export = fileSize ;
@@ -100,24 +100,8 @@ declare namespace Filesize {
100
100
roundingMethod ?: "round" | "floor" | "ceil" ;
101
101
}
102
102
103
- // Result type inference from the output option
104
- interface ResultTypeMap {
105
- array : [ number , string ] ;
106
- exponent : number ;
107
- object : {
108
- value : number ,
109
- symbol : string ,
110
- exponent : number ,
111
- unit : string ,
112
- } ;
113
- string : string ;
114
- }
115
- type DefaultOutput < O extends Options > = Exclude < O [ "output" ] , keyof ResultTypeMap > extends never ? never : "string"
116
- type CanonicalOutput < O extends Options > = Extract < O [ "output" ] , keyof ResultTypeMap > | DefaultOutput < O >
117
-
118
103
interface Filesize {
119
- ( bytes : number ) : string ;
120
- < O extends Options > ( bytes : number , options : O ) : ResultTypeMap [ CanonicalOutput < O > ] ;
121
- partial : < O extends Options > ( options : O ) => ( ( bytes : number ) => ResultTypeMap [ CanonicalOutput < O > ] ) ;
104
+ ( bytes : number , options ?: Options ) : string ;
105
+ partial : ( options : Options ) => ( ( bytes : number ) => string ) ;
122
106
}
123
107
}
0 commit comments