Skip to content

Commit

Permalink
Revert "Fixing the hackish type definition, fixes #105"
Browse files Browse the repository at this point in the history
This reverts commit 3b09002.
  • Loading branch information
avoidwork committed Oct 31, 2019
1 parent ec99f00 commit 74d98cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 103 deletions.
104 changes: 3 additions & 101 deletions filesize.d.ts
Original file line number Diff line number Diff line change
@@ -1,103 +1,5 @@
// Type definitions for filesize 4.2
// Project: https://github.com/avoidwork/filesize.js, https://filesizejs.com
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
// Renaud Chaput <https://github.com/renchap>
// Roman Nuritdinov <https://github.com/Ky6uk>
// Sam Hulick <https://github.com/ffxsam>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function filesize(arg: any, descriptor: object): any;

declare var fileSize: Filesize.Filesize;
export = fileSize;
export as namespace filesize;

declare namespace Filesize {
interface SiJedecBits {
b?: string;
Kb?: string;
Mb?: string;
Gb?: string;
Tb?: string;
Pb?: string;
Eb?: string;
Zb?: string;
Yb?: string;
}

interface SiJedecBytes {
B?: string;
KB?: string;
MB?: string;
GB?: string;
TB?: string;
PB?: string;
EB?: string;
ZB?: string;
YB?: string;
}

type SiJedec = SiJedecBits & SiJedecBytes & { [name: string]: string };

interface Options {
/**
* Number base, default is 2
*/
base?: number;
/**
* Enables bit sizes, default is false
*/
bits?: boolean;
/**
* Specifies the SI suffix via exponent, e.g. 2 is MB for bytes, default is -1
*/
exponent?: number;
/**
* Enables full form of unit of measure, default is false
*/
fullform?: boolean;
/**
* Array of full form overrides, default is []
*/
fullforms?: string[];
/**
* BCP 47 language tag to specify a locale, or true to use default locale, default is ""
*/
locale?: string | boolean;
/**
* ECMA-402 number format option overrides, default is "{}"
*/
localeOptions?: Intl.NumberFormatOptions;
/**
* Output of function (array, exponent, object, or string), default is string
*/
output?: "array" | "exponent" | "object" | "string";
/**
* Decimal place, default is 2
*/
round?: number;
/**
* Decimal separator character, default is `.`
*/
separator?: string;
/**
* Character between the result and suffix, default is ` `
*/
spacer?: string;
/**
* Standard unit of measure, can be iec or jedec, default is jedec; can be overruled by base
*/
standard?: "iec" | "jedec";
/**
* Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found
*/
symbols?: SiJedec;
/**
* Enables unix style human readable output, e.g ls -lh, default is false
*/
unix?: boolean;
}

interface Filesize {
(bytes: number, options?: Options): string;
partial: (options: Options) => ((bytes: number) => string);
}
export interface filesize {
partial: any;
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "filesize",
"description": "JavaScript library to generate a human readable String describing the file size",
"version": "5.0.3",
"version": "5.0.0",
"homepage": "https://filesizejs.com",
"author": "Jason Mulligan <jason.mulligan@avoidwork.com>",
"repository": {
Expand Down

0 comments on commit 74d98cc

Please sign in to comment.