@types/bytes
Advanced tools
Comparing version 2.5.1 to 3.0.0
@@ -1,30 +0,22 @@ | ||
// Type definitions for bytes v2.5.0 | ||
// Type definitions for bytes 3.0 | ||
// Project: https://github.com/visionmedia/bytes.js | ||
// Definitions by: Zhiyuan Wang <https://github.com/danny8002> | ||
// Rickard Laurin <https://github.com/believer> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
interface BytesOptions { | ||
decimalPlaces?: number, | ||
thousandsSeparator?: string, | ||
unitSeparator?: string, | ||
fixedDecimals?: boolean, | ||
unit?: string | ||
decimalPlaces?: number; | ||
thousandsSeparator?: string; | ||
unitSeparator?: string; | ||
fixedDecimals?: boolean; | ||
unit?: string; | ||
} | ||
/** | ||
*Convert the given value in bytes into a string. | ||
* | ||
* @param {number} value | ||
* @param {{ | ||
* thousandsSeparator: [string] | ||
* }} [options] bytes options. | ||
* | ||
* @returns {string} | ||
* Convert the given value in bytes into a string. | ||
*/ | ||
declare function bytes(value: number, options?: { thousandsSeparator: string }): string; | ||
declare function bytes(value: number, options?: BytesOptions): string; | ||
/** | ||
*Parse string to an integer in bytes. | ||
* | ||
* @param {string} value | ||
* @returns {number} | ||
* Parse string to an integer in bytes. | ||
*/ | ||
@@ -34,34 +26,18 @@ declare function bytes(value: string): number; | ||
declare namespace bytes { | ||
/** | ||
* Format the given value in bytes into a string. | ||
* | ||
* If the value is negative, take Math.abs(). If it is a float, | ||
* it is rounded. | ||
* | ||
* @param {number} value | ||
* @param {BytesFormatOptions} [options] | ||
* If the value is negative, it is kept as such. | ||
* If it is a float, it is rounded. | ||
*/ | ||
function format(value: number, options?: BytesOptions): string; | ||
/** | ||
* Just return the input number value. | ||
* | ||
* @param {number} value | ||
* @return {number} | ||
*/ | ||
function parse(value: number): number; | ||
/** | ||
* Parse the string value into an integer in bytes. | ||
* | ||
* If no unit is given, it is assumed the value is in bytes. | ||
* | ||
* @param {string} value | ||
* @return {number} | ||
*/ | ||
function parse(value: string): number; | ||
function parse(value: string | number): number; | ||
} | ||
export = bytes; |
{ | ||
"name": "@types/bytes", | ||
"version": "2.5.1", | ||
"version": "3.0.0", | ||
"description": "TypeScript definitions for bytes", | ||
@@ -9,3 +9,9 @@ "license": "MIT", | ||
"name": "Zhiyuan Wang", | ||
"url": "https://github.com/danny8002" | ||
"url": "https://github.com/danny8002", | ||
"githubUsername": "danny8002" | ||
}, | ||
{ | ||
"name": "Rickard Laurin", | ||
"url": "https://github.com/believer", | ||
"githubUsername": "believer" | ||
} | ||
@@ -20,4 +26,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "adf7dd7328db240e155e75f43011cbef3efa06dfaac1654d83bb672e0b83f77e", | ||
"typesPublisherContentHash": "f668e9d7f1280973cb85657c8dc2dd3529fb0eff9bd1a01a0f260e68c44cc4cf", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 21 Aug 2017 21:49:18 GMT | ||
* Last updated: Thu, 01 Mar 2018 21:23:58 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Zhiyuan Wang <https://github.com/danny8002>. | ||
These definitions were written by Zhiyuan Wang <https://github.com/danny8002>, Rickard Laurin <https://github.com/believer>. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3688
36