mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
Merge pull request #31160 from silh/master
Added missing options used by prettyMs function.
This commit is contained in:
Vendored
+5
-1
@@ -1,7 +1,8 @@
|
||||
// Type definitions for pretty-ms 3.2
|
||||
// Type definitions for pretty-ms 4.0
|
||||
// Project: https://github.com/sindresorhus/pretty-ms#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// ocboogie <https://github.com/ocboogie>
|
||||
// silh <https://github.com/silh>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = prettyMs;
|
||||
@@ -14,6 +15,9 @@ declare namespace prettyMs {
|
||||
msDecimalDigits?: number;
|
||||
keepDecimalsOnWholeSeconds?: boolean;
|
||||
compact?: boolean;
|
||||
unitCount?: number;
|
||||
verbose?: boolean;
|
||||
separateMs?: boolean;
|
||||
formatSubMs?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,7 @@ str = prettyMs(1335669000, {verbose: true});
|
||||
str = prettyMs(1335669000, {keepDecimalsOnWholeSeconds: true});
|
||||
str = prettyMs(1335669000, {secDecimalDigits: 1});
|
||||
str = prettyMs(1335669000, {msDecimalDigits: 2});
|
||||
str = prettyMs(1335669000, {unitCount: 2});
|
||||
str = prettyMs(1335669000, {separateMs: true});
|
||||
str = prettyMs(1335669000, {formatSubMs: true});
|
||||
str = prettyMs(new Date(2014, 0, 1, 10, 40).getTime() - new Date(2014, 0, 1, 10, 5).getTime());
|
||||
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for pretty-ms 3.2
|
||||
// Project: https://github.com/sindresorhus/pretty-ms#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// ocboogie <https://github.com/ocboogie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = prettyMs;
|
||||
|
||||
declare function prettyMs(input: number, options?: prettyMs.PrettyMsOptions): string;
|
||||
|
||||
declare namespace prettyMs {
|
||||
interface PrettyMsOptions {
|
||||
secDecimalDigits?: number;
|
||||
msDecimalDigits?: number;
|
||||
keepDecimalsOnWholeSeconds?: boolean;
|
||||
compact?: boolean;
|
||||
verbose?: boolean;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import prettyMs = require('pretty-ms');
|
||||
|
||||
let str: string;
|
||||
str = prettyMs(133);
|
||||
str = prettyMs(1337, {compact: true});
|
||||
str = prettyMs(1335669000, {verbose: true});
|
||||
str = prettyMs(1335669000, {keepDecimalsOnWholeSeconds: true});
|
||||
str = prettyMs(1335669000, {secDecimalDigits: 1});
|
||||
str = prettyMs(1335669000, {msDecimalDigits: 2});
|
||||
str = prettyMs(new Date(2014, 0, 1, 10, 40).getTime() - new Date(2014, 0, 1, 10, 5).getTime());
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"pretty-ms": [
|
||||
"pretty-ms/v3"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"pretty-ms-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user