Skip to content

Commit 7892df7

Browse files
authored
Merge pull request #1 from SectorLabs/add-ts-definitions
Add TypeScript declaration file
2 parents b19f165 + 5be3d3a commit 7892df7

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

humanize-duration.d.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
declare module "@sector-labs/humanize-duration" {
2+
export interface HumanizeDurationOptions {
3+
largest?: number;
4+
language?: string;
5+
delimiter?: string;
6+
spacer?: string;
7+
serialComma?: string;
8+
units?: string[];
9+
languages?: {};
10+
round?: boolean;
11+
unitMeasures?: {
12+
y: number;
13+
mo: number;
14+
w: number;
15+
d: number;
16+
h: number;
17+
m: number;
18+
s: number;
19+
ms: number;
20+
};
21+
}
22+
23+
declare function humanizeDuration(duration: number, options?: HumanizeDurationOptions): string;
24+
export = humanizeDuration;
25+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525
"Abdul Jalil (https://github.com/abduljalilm94)",
2626
"Alex Sam (https://github.com/sam-lex)"
2727
],
28-
"version": "3.15.1-sl.1",
28+
"version": "3.15.1-sl.2",
2929
"description": "Convert millisecond durations to English and many other languages.",
3030
"homepage": "https://github.com/SectorLabs/HumanizeDuration.js",
3131
"main": "humanize-duration.js",
32+
"types": "humanize-duration.d.ts",
3233
"scripts": {
3334
"pretest": "standard --fix",
3435
"test": "mocha"

0 commit comments

Comments
 (0)