@types/bytes
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -22,7 +22,7 @@ // Type definitions for bytes 3.1 | ||
interface BytesOptions { | ||
decimalPlaces?: number; | ||
fixedDecimals?: boolean; | ||
thousandsSeparator?: string; | ||
unit?: Unit; | ||
unitSeparator?: string; | ||
decimalPlaces?: number | undefined; | ||
fixedDecimals?: boolean | undefined; | ||
thousandsSeparator?: string | undefined; | ||
unit?: Unit | undefined; | ||
unitSeparator?: string | undefined; | ||
} | ||
@@ -29,0 +29,0 @@ |
{ | ||
"name": "@types/bytes", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "TypeScript definitions for bytes", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bytes", | ||
"license": "MIT", | ||
@@ -32,4 +33,4 @@ "contributors": [ | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "1132907454ff62dfe83c266bba399acd50d507b2a6514309486fd20607330d8e", | ||
"typeScriptVersion": "2.8" | ||
"typesPublisherContentHash": "7d94ddf1eb193829af756d2e0aecc6e1b0938f3d2f5d46a4c6bd3a7216f084a5", | ||
"typeScriptVersion": "3.6" | ||
} |
@@ -9,5 +9,54 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bytes. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bytes/index.d.ts) | ||
````ts | ||
// Type definitions for bytes 3.1 | ||
// Project: https://github.com/visionmedia/bytes.js | ||
// Definitions by: Zhiyuan Wang <https://github.com/danny8002> | ||
// Rickard Laurin <https://github.com/believer> | ||
// Florian Keller <https://github.com/ffflorian> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
/** | ||
* Convert the given value in bytes into a string. | ||
*/ | ||
declare function bytes(value: number, options?: bytes.BytesOptions): string; | ||
/** | ||
* Parse string to an integer in bytes. | ||
*/ | ||
declare function bytes(value: string): number; | ||
declare namespace bytes { | ||
type Unit = 'b' | 'gb' | 'kb' | 'mb' | 'pb' | 'tb' | 'B' | 'GB' | 'KB' | 'MB' | 'PB' | 'TB'; | ||
interface BytesOptions { | ||
decimalPlaces?: number | undefined; | ||
fixedDecimals?: boolean | undefined; | ||
thousandsSeparator?: string | undefined; | ||
unit?: Unit | undefined; | ||
unitSeparator?: string | undefined; | ||
} | ||
/** | ||
* Format the given value in bytes into a string. | ||
* | ||
* 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; | ||
/** | ||
* Parse the string value into an integer in bytes. | ||
* | ||
* If no unit is given, it is assumed the value is in bytes. | ||
*/ | ||
function parse(value: string | number): number; | ||
} | ||
export = bytes; | ||
```` | ||
### Additional Details | ||
* Last updated: Mon, 11 Nov 2019 19:50:33 GMT | ||
* Last updated: Tue, 06 Jul 2021 18:05:47 GMT | ||
* Dependencies: none | ||
@@ -17,2 +66,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Zhiyuan Wang (https://github.com/danny8002), Rickard Laurin (https://github.com/believer), and Florian Keller (https://github.com/ffflorian). | ||
These definitions were written by [Zhiyuan Wang](https://github.com/danny8002), [Rickard Laurin](https://github.com/believer), and [Florian Keller](https://github.com/ffflorian). |
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5747
0
66