UNPKG

1.12 kBTypeScriptView Raw
1import { PluginFunc } from 'dayjs'
2
3declare const plugin: PluginFunc
4export default plugin
5
6type DurationInputType = string | number | object
7type DurationAddType = number | object | Duration
8
9export declare class Duration {
10 constructor (input: DurationInputType, unit?: string, locale?: string)
11
12 clone(): Duration
13
14 humanize(withSuffix: boolean): string
15
16 milliseconds(): number
17 asMilliseconds(): number
18
19 seconds(): number
20 asSeconds(): number
21
22 minutes(): number
23 asMinutes(): number
24
25 hours(): number
26 asHours(): number
27
28 days(): number
29 asDays(): number
30
31 weeks(): number
32 asWeeks(): number
33
34 months(): number
35 asMonths(): number
36
37 years(): number
38 asYears(): number
39
40 as(unit: string): number
41
42 get(unit: string): number
43
44 add(input: DurationAddType, unit? : string): Duration
45
46 subtract(input: DurationAddType, unit? : string): Duration
47
48 toJSON(): string
49
50 toISOString(): string
51
52 locale(locale: string): Duration
53}
54
55declare module 'dayjs' {
56 export function duration(input?: DurationInputType , unit?: string): Duration
57 export function isDuration(d: any): d is Duration
58}
59
\No newline at end of file