This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.d.ts
127 lines (98 loc) · 5.35 KB
/
index.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
// Type definitions for D3JS d3-time module v1.0.2
// Project: https://github.com/d3/d3-time/
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// ---------------------------------------------------------------
// Interfaces
// ---------------------------------------------------------------
export interface TimeInterval {
(date: Date): Date;
floor(date: Date): Date;
round(date: Date): Date;
ceil(date: Date): Date;
offset(date: Date, step?: number): Date;
range(start: Date, stop: Date, step?: number): Date[];
filter(test: (date: Date) => boolean): this;
}
export interface CountableTimeInterval extends TimeInterval {
count(start: Date, end: Date): number;
every(step: number): TimeInterval | null;
}
// ---------------------------------------------------------------
// Custom (Countable)Interval Factories
// ---------------------------------------------------------------
export function timeInterval(
floor: (date: Date) => void,
offset: (date: Date, step: number) => void,
): TimeInterval;
export function timeInterval(
floor: (date: Date) => void,
offset: (date: Date, step: number) => void,
count: (start: Date, end: Date) => number,
field?: (date: Date) => number
): CountableTimeInterval;
// ---------------------------------------------------------------
// Built-In Factories and Date Array Creators
// ---------------------------------------------------------------
// local time ----------------------------------------------------------
export var timeMillisecond: CountableTimeInterval;
export function timeMilliseconds(start: Date, stop: Date, step?: number): Date[];
export var timeSecond: CountableTimeInterval;
export function timeSeconds(start: Date, stop: Date, step?: number): Date[];
export var timeMinute: CountableTimeInterval;
export function timeMinutes(start: Date, stop: Date, step?: number): Date[];
export var timeHour: CountableTimeInterval;
export function timeHours(start: Date, stop: Date, step?: number): Date[];
export var timeDay: CountableTimeInterval;
export function timeDays(start: Date, stop: Date, step?: number): Date[];
export var timeWeek: CountableTimeInterval;
export function timeWeeks(start: Date, stop: Date, step?: number): Date[];
export var timeSunday: CountableTimeInterval;
export function timeSundays(start: Date, stop: Date, step?: number): Date[];
export var timeMonday: CountableTimeInterval;
export function timeMondays(start: Date, stop: Date, step?: number): Date[];
export var timeTuesday: CountableTimeInterval;
export function timeTuesdays(start: Date, stop: Date, step?: number): Date[];
export var timeWednesday: CountableTimeInterval;
export function timeWednesdays(start: Date, stop: Date, step?: number): Date[];
export var timeThursday: CountableTimeInterval;
export function timeThursdays(start: Date, stop: Date, step?: number): Date[];
export var timeFriday: CountableTimeInterval;
export function timeFridays(start: Date, stop: Date, step?: number): Date[];
export var timeSaturday: CountableTimeInterval;
export function timeSaturdays(start: Date, stop: Date, step?: number): Date[];
export var timeMonth: CountableTimeInterval;
export function timeMonths(start: Date, stop: Date, step?: number): Date[];
export var timeYear: CountableTimeInterval;
export function timeYears(start: Date, stop: Date, step?: number): Date[];
// utc Universal Coordinated Time ----------------------------------------------------------
export var utcMillisecond: CountableTimeInterval;
export function utcMilliseconds(start: Date, stop: Date, step?: number): Date[];
export var utcSecond: CountableTimeInterval;
export function utcSeconds(start: Date, stop: Date, step?: number): Date[];
export var utcMinute: CountableTimeInterval;
export function utcMinutes(start: Date, stop: Date, step?: number): Date[];
export var utcHour: CountableTimeInterval;
export function utcHours(start: Date, stop: Date, step?: number): Date[];
export var utcDay: CountableTimeInterval;
export function utcDays(start: Date, stop: Date, step?: number): Date[];
export var utcWeek: CountableTimeInterval;
export function utcWeeks(start: Date, stop: Date, step?: number): Date[];
export var utcSunday: CountableTimeInterval;
export function utcSundays(start: Date, stop: Date, step?: number): Date[];
export var utcMonday: CountableTimeInterval;
export function utcMondays(start: Date, stop: Date, step?: number): Date[];
export var utcTuesday: CountableTimeInterval;
export function utcTuesdays(start: Date, stop: Date, step?: number): Date[];
export var utcWednesday: CountableTimeInterval;
export function utcWednesdays(start: Date, stop: Date, step?: number): Date[];
export var utcThursday: CountableTimeInterval;
export function utcThursdays(start: Date, stop: Date, step?: number): Date[];
export var utcFriday: CountableTimeInterval;
export function utcFridays(start: Date, stop: Date, step?: number): Date[];
export var utcSaturday: CountableTimeInterval;
export function utcSaturdays(start: Date, stop: Date, step?: number): Date[];
export var utcMonth: CountableTimeInterval;
export function utcMonths(start: Date, stop: Date, step?: number): Date[];
export var utcYear: CountableTimeInterval;
export function utcYears(start: Date, stop: Date, step?: number): Date[];