mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
Merge pull request #17723 from plantain-00/pretty-bytes
add types of pretty-bytes
This commit is contained in:
8
types/pretty-bytes/index.d.ts
vendored
Normal file
8
types/pretty-bytes/index.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Type definitions for pretty-bytes 4.0
|
||||
// Project: https://github.com/sindresorhus/pretty-bytes
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function prettyBytes(bytes: number): string;
|
||||
export = prettyBytes;
|
||||
declare namespace prettyBytes { }
|
||||
7
types/pretty-bytes/pretty-bytes-tests.ts
Normal file
7
types/pretty-bytes/pretty-bytes-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import prettyBytes = require('pretty-bytes');
|
||||
|
||||
prettyBytes(1337);
|
||||
// => '1.34 kB'
|
||||
|
||||
prettyBytes(100);
|
||||
// => '100 B'
|
||||
22
types/pretty-bytes/tsconfig.json
Normal file
22
types/pretty-bytes/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"pretty-bytes-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/pretty-bytes/tslint.json
Normal file
3
types/pretty-bytes/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user