-
Notifications
You must be signed in to change notification settings - Fork 93
/
moment.d.ts
137 lines (108 loc) · 3.25 KB
/
moment.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// https://github.com/timrwood/moment
// 1.7.2
declare module "moment" {
import moment = require("moment");
module _moment
{
class Duration {
humanize(): string;
asYears(): number;
asMonths(): number;
asDays(): number;
asHours(): number;
asMinutes(): number;
asSeconds(): number;
asMilliseconds(): number;
years(): number;
months(): number;
days(): number;
hours(): number;
minutes(): number;
seconds(): number;
milliseconds(): number;
}
class Moment {
add(type: string, count: number): Moment;
add(info: any): Moment;
subtract(type: string, count: number): Moment;
subtract(info: any): Moment;
year(value: number): Moment;
month(value: number): Moment;
day(value: number): Moment;
date(value: number): Moment;
hours(value: number): Moment;
minutes(value: number): Moment;
seconds(value: number): Moment;
milliseconds(value: number): Moment;
startOf(type: string): Moment;
endOf(type: string): Moment;
sod(type: string): Moment;
eod(type: string): Moment;
from(fromMoment: Moment, bool?: boolean): Moment;
fromNow(bool?: boolean): Moment;
local(): Moment;
utc(): Moment;
year(): number;
month(): number;
day(): number;
date(): number;
hours(): number;
minutes(): number;
seconds(): number;
milliseconds(): number;
isLeapYear(): boolean;
zone(): number;
daysInMonth(): number;
isDST(): boolean;
format(format?: string): string;
//duration(): Duration;
calendar(): string;
diff(moment: Moment, string?: string, bool?: boolean): number;
toDate(): Date;
valueOf(): number;
unix(): number;
humanizeDuration(number: number, string?: string, bool?: boolean): string;
lang(lang: string): Moment;
lang(lang: boolean): Moment;
lang(): string;
isValid(): boolean;
}
}
interface _moment
{
utc(): _moment.Moment;
utc(date: Date): _moment.Moment;
utc(moment: _moment.Moment): _moment.Moment;
utc(unixEpoch: number): _moment.Moment;
utc(date: string): _moment.Moment;
utc(date: string, format: string): _moment.Moment;
utc(date: string, formats: string[]): _moment.Moment;
utc(array: number[]): _moment.Moment;
isMoment(object?: any): boolean;
lang(): string;
lang(lang: string): void;
lang(lang: string, info: any): void;
months: any;
monthsShort: any;
weekdays: any;
weekdaysShort: any;
weekdaysMin: any;
longDateFormat: { LT: string; L: string; LL: string; LLL: string; LLLL: string; };
relativeTime: { future; past; s; m; mm; h; hh; d; dd; M; MM; y; yy; };
meridiem: Function;
calendar: { lastDay; sameDay; nextDay; lastWeek; nextWeek; sameElse; }
ordinal: Function;
duration(count: number, type?: string): _moment.Duration;
duration(info: any): _moment.Duration;
unix(unix?: number): _moment.Moment;
(): _moment.Moment;
(date: Date): _moment.Moment;
(moment: _moment.Moment): _moment.Moment;
(unixEpoch: number): _moment.Moment;
(date: string): _moment.Moment;
(date: string, format: string): _moment.Moment;
(date: string, formats: string[]): _moment.Moment;
(array: number[]): _moment.Moment;
}
export = _moment;
}