3.1.4 • Published 6 months ago
@types/bytes v3.1.4
Installation
npm install --save @types/bytes
Summary
This package contains type definitions for bytes (https://github.com/visionmedia/bytes.js).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bytes.
index.d.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: Tue, 06 Jul 2021 18:05:47 GMT
- Dependencies: none
- Global values: none
Credits
These definitions were written by Zhiyuan Wang, Rickard Laurin, and Florian Keller.
3.1.3
7 months ago
3.1.2
8 months ago
3.1.4
6 months ago
3.1.1
3 years ago
3.1.0
4 years ago
3.0.0
6 years ago
2.5.1
7 years ago
2.5.0
7 years ago
2.4.33
8 years ago
2.4.32
8 years ago
2.4.31
8 years ago
2.4.30
8 years ago
2.1.29
8 years ago
2.1.28-alpha
8 years ago
2.1.27-alpha
8 years ago
2.1.26-alpha
8 years ago
2.1.25-alpha
8 years ago
2.1.24-alpha
8 years ago
2.1.23-alpha
8 years ago
2.1.22-alpha
8 years ago
2.1.17-alpha
8 years ago
2.1.16-alpha
8 years ago