-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathindex.d.ts
More file actions
37 lines (33 loc) · 706 Bytes
/
index.d.ts
File metadata and controls
37 lines (33 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
type Units = {
y: 31557600000
mo: 2629800000
w: 604800000
d: 86400000
h: 3600000
m: 60000
s: 1000
ms: 1
us: 1e-3
ns: 1e-6
[key: string]: number;
} & {
group: string;
decimal: string;
}
declare module './locale/*.js' {
const unit: Units;
export default unit;
}
declare const durationRE: RegExp;
declare namespace parse {
let unit: Units;
}
/**
* Convert a string to milliseconds.
*
* @param {string} str - The string to parse.
* @param {string} format - The format to use for conversion (default is 'ms').
* @returns {number|null} - The parsed duration in milliseconds.
*/
declare function parse(str?: string, format?: string): number | null;
export default parse;