forked from sindresorhus/pretty-ms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test-d.ts
24 lines (23 loc) · 924 Bytes
/
index.test-d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import {expectType} from 'tsd';
import prettyMilliseconds from './index.js';
expectType<string>(prettyMilliseconds(1_335_669_000));
expectType<string>(prettyMilliseconds(1_335_669_000n));
expectType<string>(prettyMilliseconds(1_335_669_000, {secondsDecimalDigits: 1}));
expectType<string>(
prettyMilliseconds(1_335_669_000, {millisecondsDecimalDigits: 2}),
);
expectType<string>(
prettyMilliseconds(1_335_669_000, {keepDecimalsOnWholeSeconds: true}),
);
expectType<string>(prettyMilliseconds(1337, {compact: true}));
expectType<string>(prettyMilliseconds(1_335_669_000, {unitCount: 2}));
expectType<string>(prettyMilliseconds(1_335_669_000, {verbose: true}));
expectType<string>(
prettyMilliseconds(1_335_669_000, {separateMilliseconds: true}),
);
expectType<string>(
prettyMilliseconds(1_335_669_000, {formatSubMilliseconds: true}),
);
expectType<string>(
prettyMilliseconds(1_335_669_000, {colonNotation: true}),
);