1 | // Type definitions for D3JS d3-time module 3.0
|
2 | // Project: https://github.com/d3/d3-time/, https://d3js.org/d3-time
|
3 | // Definitions by: Tom Wanzek <https://github.com/tomwanzek>
|
4 | // Alex Ford <https://github.com/gustavderdrache>
|
5 | // Boris Yankov <https://github.com/borisyankov>
|
6 | // denisname <https://github.com/denisname>
|
7 | // Nathan Bierema <https://github.com/Methuselah96>
|
8 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
9 |
|
10 | // Last module patch version validated against: 3.0.0
|
11 |
|
12 | // ---------------------------------------------------------------
|
13 | // Interfaces
|
14 | // ---------------------------------------------------------------
|
15 |
|
16 | /**
|
17 | * A D3 Time Interval
|
18 | */
|
19 | export interface TimeInterval {
|
20 | /**
|
21 | * Returns a new date representing the latest interval boundary date before or equal to date.
|
22 | * Equivalent to interval.floor, except it date is not specified, it defaults to the current time.
|
23 | * For example, d3.timeYear(date) and d3.timeYear.floor(date) are equivalent.
|
24 | *
|
25 | * For example, timeDay(date) typically returns 12:00 AM local time on the given date.
|
26 | *
|
27 | * This function is idempotent: if the specified date is already floored to the current interval,
|
28 | * a new date with an identical time is returned.
|
29 | * Furthermore, the returned date is the minimum expressible value of the associated interval,
|
30 | * such that interval.floor(interval.floor(date) - 1) returns the preceding interval boundary date.
|
31 | *
|
32 | * Note that the == and === operators do not compare by value with Date objects,
|
33 | * and thus you cannot use them to tell whether the specified date has already been floored.
|
34 | * Instead, coerce to a number and then compare.
|
35 | *
|
36 | * This is more reliable than testing whether the time is 12:00 AM, as in some time zones midnight may not exist due to daylight saving.
|
37 | *
|
38 | * @param date A date object.
|
39 | */
|
40 | (date?: Date): Date;
|
41 |
|
42 | /**
|
43 | * Returns a new date representing the latest interval boundary date before or equal to date.
|
44 | *
|
45 | * For example, timeDay.floor(date) typically returns 12:00 AM local time on the given date.
|
46 | *
|
47 | * This method is idempotent: if the specified date is already floored to the current interval,
|
48 | * a new date with an identical time is returned.
|
49 | * Furthermore, the returned date is the minimum expressible value of the associated interval,
|
50 | * such that interval.floor(interval.floor(date) - 1) returns the preceding interval boundary date.
|
51 | *
|
52 | * Note that the == and === operators do not compare by value with Date objects,
|
53 | * and thus you cannot use them to tell whether the specified date has already been floored.
|
54 | * Instead, coerce to a number and then compare.
|
55 | *
|
56 | * This is more reliable than testing whether the time is 12:00 AM, as in some time zones midnight may not exist due to daylight saving.
|
57 | *
|
58 | * @param date A date object.
|
59 | */
|
60 | floor(date: Date): Date;
|
61 |
|
62 | /**
|
63 | * Returns a new date representing the closest interval boundary date to date.
|
64 | *
|
65 | * For example, timeDay.round(date) typically returns 12:00 AM local time on the given date if it is on or before noon,
|
66 | * and 12:00 AM of the following day if it is after noon.
|
67 | *
|
68 | * This method is idempotent: if the specified date is already rounded to the current interval, a new date with an identical time is returned.
|
69 | *
|
70 | * @param date A date object.
|
71 | */
|
72 | round(date: Date): Date;
|
73 |
|
74 | /**
|
75 | * Returns a new date representing the earliest interval boundary date after or equal to date.
|
76 | *
|
77 | * For example, timeDay.ceil(date) typically returns 12:00 AM local time on the date following the given date.
|
78 | *
|
79 | * This method is idempotent: if the specified date is already ceilinged to the current interval,
|
80 | * a new date with an identical time is returned. Furthermore,
|
81 | * the returned date is the maximum expressible value of the associated interval,
|
82 | * such that interval.ceil(interval.ceil(date) + 1) returns the following interval boundary date.
|
83 | *
|
84 | * @param date A date object.
|
85 | */
|
86 | ceil(date: Date): Date;
|
87 |
|
88 | /**
|
89 | * Returns a new date equal to date plus step intervals.
|
90 | *
|
91 | * If step is not specified it defaults to 1.
|
92 | *
|
93 | * This method does not round the specified date to the interval. For example, if date is today at 5:34 PM,
|
94 | * then timeDay.offset(date, 1) returns 5:34 PM tomorrow (even if daylight saving changes!).
|
95 | *
|
96 | * @param date A date object.
|
97 | * @param step An optional number of steps to apply when calculating the offset date.
|
98 | * If step is negative, then the returned date will be before the specified date;
|
99 | * if step is zero, then a copy of the specified date is returned; if step is not an integer, it is floored.
|
100 | */
|
101 | offset(date: Date, step?: number): Date;
|
102 |
|
103 | /**
|
104 | * Returns an array of dates representing every interval boundary after or equal to start (inclusive) and before stop (exclusive).
|
105 | *
|
106 | * If step is specified, then every step-th boundary will be returned; for example,
|
107 | * for the timeDay interval a step of 2 will return every other day.
|
108 | * If step is not an integer, it is floored.
|
109 | *
|
110 | * The first date in the returned array is the earliest boundary after or equal to start;
|
111 | * subsequent dates are offset by step intervals and floored.
|
112 | * Thus, two overlapping ranges may be inconsistent.
|
113 | *
|
114 | * To make ranges consistent when a step is specified, use CountableInterval.every instead.
|
115 | *
|
116 | * @param start A start date object for the range.
|
117 | * @param stop A stop date object for the range.
|
118 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
119 | */
|
120 | range(start: Date, stop: Date, step?: number): Date[];
|
121 |
|
122 | /**
|
123 | * Returns a new interval that is a filtered subset of this interval using the specified test function.
|
124 | *
|
125 | * @param test A test function which is passed a date and should return true if and only if
|
126 | * the specified date should be considered part of the interval.
|
127 | */
|
128 | filter(test: (date: Date) => boolean): TimeInterval;
|
129 | }
|
130 |
|
131 | /**
|
132 | * A D3 Countable Time Interval
|
133 | */
|
134 | export interface CountableTimeInterval extends TimeInterval {
|
135 | /**
|
136 | * Returns the number of interval boundaries after start (exclusive) and before or equal to end (inclusive).
|
137 | *
|
138 | * Note that this behavior is slightly different than interval.range,
|
139 | * because its purpose is to return the zero-based number of the specified end date relative to the specified start date.
|
140 | *
|
141 | * @param start A start date object.
|
142 | * @param end An end date object.
|
143 | */
|
144 | count(start: Date, end: Date): number;
|
145 | /**
|
146 | * Returns a filtered view of this interval representing every stepth date.
|
147 | *
|
148 | * The meaning of step is dependent on this interval’s parent interval as defined by the field function.
|
149 | *
|
150 | * For example, timeMinute.every(15) returns an interval representing every fifteen minutes,
|
151 | * starting on the hour: :00, :15, :30, :45, etc. Note that for some intervals,
|
152 | * the resulting dates may not be uniformly-spaced;
|
153 | * timeDay’s parent interval is timeMonth, and thus the interval number resets at the start of each month.
|
154 | *
|
155 | * If step is not valid, returns null. If step is one, returns this interval.
|
156 | *
|
157 | * This method can be used in conjunction with interval.range to ensure that two overlapping ranges are consistent.
|
158 | *
|
159 | * The returned filtered interval does not support interval.count. See also interval.filter.
|
160 | *
|
161 | * @param step Number of steps.
|
162 | */
|
163 | every(step: number): TimeInterval | null;
|
164 | }
|
165 |
|
166 | // ---------------------------------------------------------------
|
167 | // Custom (Countable)Interval Factories
|
168 | // ---------------------------------------------------------------
|
169 |
|
170 | /**
|
171 | * Constructs a new custom interval given the specified floor and offset functions.
|
172 | *
|
173 | * The returned custom interval is not countable, i.e. does not expose the methods "count(..)" and "every(...)".
|
174 | *
|
175 | * @param floor A floor function which takes a single date as an argument and rounds it down to the nearest interval boundary.
|
176 | * @param offset An offset function which takes a date and an integer step as arguments and advances
|
177 | * the specified date by the specified number of boundaries; the step may be positive, negative or zero.
|
178 | */
|
179 | export function timeInterval(
|
180 | floor: (date: Date) => void,
|
181 | offset: (date: Date, step: number) => void,
|
182 | ): TimeInterval;
|
183 | /**
|
184 | * Constructs a new custom interval given the specified floor, offset and count functions.
|
185 | *
|
186 | * The returned custom interval is countable and exposes the methods "count(..)" and "every(...)".
|
187 | *
|
188 | * Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals.
|
189 | *
|
190 | * @param floor A floor function which takes a single date as an argument and rounds it down to the nearest interval boundary.
|
191 | * @param offset An offset function which takes a date and an integer step as arguments and advances
|
192 | * the specified date by the specified number of boundaries; the step may be positive, negative or zero.
|
193 | * @param count A count function which takes a start date and an end date, already floored to the current interval,
|
194 | * and returns the number of boundaries between the start (exclusive) and end (inclusive).
|
195 | * Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals.
|
196 | * @param field An optional field function which takes a date, already floored to the current interval,
|
197 | * and returns the field value of the specified date,
|
198 | * corresponding to the number of boundaries between this date (exclusive) and the latest previous parent boundary.
|
199 | * For example, for the timeDay interval, this returns the number of days since the start of the month.
|
200 | * If a field function is not specified, it defaults to counting the number of interval boundaries since
|
201 | * the UNIX epoch of January 1, 1970 UTC. The field function defines the behavior of interval.every.
|
202 | */
|
203 | export function timeInterval(
|
204 | floor: (date: Date) => void,
|
205 | offset: (date: Date, step: number) => void,
|
206 | count: (start: Date, end: Date) => number,
|
207 | field?: (date: Date) => number
|
208 | ): CountableTimeInterval;
|
209 |
|
210 | // ---------------------------------------------------------------
|
211 | // Built-In Factories and Date Array Creators
|
212 | // ---------------------------------------------------------------
|
213 |
|
214 | // local time ----------------------------------------------------------
|
215 |
|
216 | /**
|
217 | * Milliseconds Interval in Local Time; the shortest available time unit.
|
218 | */
|
219 | export const timeMillisecond: CountableTimeInterval;
|
220 |
|
221 | /**
|
222 | * This is a convenience alias for timeMillisecond.range(...).
|
223 | *
|
224 | * @param start A start date object for the range.
|
225 | * @param stop A stop date object for the range.
|
226 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
227 | */
|
228 | export function timeMilliseconds(start: Date, stop: Date, step?: number): Date[];
|
229 |
|
230 | /**
|
231 | * Seconds Interval in Local Time; seconds (e.g., 01:23:45.0000 AM); 1,000 milliseconds.
|
232 | */
|
233 | export const timeSecond: CountableTimeInterval;
|
234 |
|
235 | /**
|
236 | * This is a convenience alias for timeSecond.range(...).
|
237 | *
|
238 | * @param start A start date object for the range.
|
239 | * @param stop A stop date object for the range.
|
240 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
241 | */
|
242 | export function timeSeconds(start: Date, stop: Date, step?: number): Date[];
|
243 |
|
244 | /**
|
245 | * Minutes Interval in Local Time; minutes (e.g., 01:02:00 AM); 60 seconds. Note that ECMAScript ignores leap seconds.
|
246 | */
|
247 | export const timeMinute: CountableTimeInterval;
|
248 |
|
249 | /**
|
250 | * This is a convenience alias for timeMinute.range(...).
|
251 | *
|
252 | * @param start A start date object for the range.
|
253 | * @param stop A stop date object for the range.
|
254 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
255 | */
|
256 | export function timeMinutes(start: Date, stop: Date, step?: number): Date[];
|
257 |
|
258 | /**
|
259 | * Hours Interval in Local Time; Hours (e.g., 01:00 AM); 60 minutes.
|
260 | *
|
261 | * Note that advancing time by one hour in local time can return the same hour or skip an hour due to daylight saving.
|
262 | */
|
263 | export const timeHour: CountableTimeInterval;
|
264 |
|
265 | /**
|
266 | * This is a convenience alias for timeHour.range(...).
|
267 | *
|
268 | * @param start A start date object for the range.
|
269 | * @param stop A stop date object for the range.
|
270 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
271 | */
|
272 | export function timeHours(start: Date, stop: Date, step?: number): Date[];
|
273 |
|
274 | /**
|
275 | * Days Interval in Local Time; days (e.g., February 7, 2012 at 12:00 AM); typically 24 hours.
|
276 | * Days in local time may range from 23 to 25 hours due to daylight saving.
|
277 | */
|
278 | export const timeDay: CountableTimeInterval;
|
279 |
|
280 | /**
|
281 | * This is a convenience alias for timeDay.range(...).
|
282 | *
|
283 | * @param start A start date object for the range.
|
284 | * @param stop A stop date object for the range.
|
285 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
286 | */
|
287 | export function timeDays(start: Date, stop: Date, step?: number): Date[];
|
288 |
|
289 | /**
|
290 | * Week Interval in Local Time. Alias for sunday; 7 days and typically 168 hours.
|
291 | *
|
292 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
293 | */
|
294 | export const timeWeek: CountableTimeInterval;
|
295 |
|
296 | /**
|
297 | * This is a convenience alias for timeWeek.range(...).
|
298 | *
|
299 | * @param start A start date object for the range.
|
300 | * @param stop A stop date object for the range.
|
301 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
302 | */
|
303 | export function timeWeeks(start: Date, stop: Date, step?: number): Date[];
|
304 |
|
305 | /**
|
306 | * Week Interval for Sunday-based weeks in Local Time (e.g., February 5, 2012 at 12:00 AM).
|
307 | * 7 days and typically 168 hours.
|
308 | *
|
309 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
310 | */
|
311 | export const timeSunday: CountableTimeInterval;
|
312 |
|
313 | /**
|
314 | * This is a convenience alias for timeSunday.range(...).
|
315 | *
|
316 | * @param start A start date object for the range.
|
317 | * @param stop A stop date object for the range.
|
318 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
319 | */
|
320 | export function timeSundays(start: Date, stop: Date, step?: number): Date[];
|
321 |
|
322 | /**
|
323 | * Week Interval for Monday-based weeks in Local Time (e.g., February 6, 2012 at 12:00 AM).
|
324 | * 7 days and typically 168 hours.
|
325 | *
|
326 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
327 | */
|
328 | export const timeMonday: CountableTimeInterval;
|
329 |
|
330 | /**
|
331 | * This is a convenience alias for timeMonday.range(...).
|
332 | *
|
333 | * @param start A start date object for the range.
|
334 | * @param stop A stop date object for the range.
|
335 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
336 | */
|
337 | export function timeMondays(start: Date, stop: Date, step?: number): Date[];
|
338 |
|
339 | /**
|
340 | * Week Interval for Tuesday-based weeks in Local Time (e.g., February 7, 2012 at 12:00 AM).
|
341 | * 7 days and typically 168 hours.
|
342 | *
|
343 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
344 | */
|
345 | export const timeTuesday: CountableTimeInterval;
|
346 |
|
347 | /**
|
348 | * This is a convenience alias for timeTuesday.range(...).
|
349 | *
|
350 | * @param start A start date object for the range.
|
351 | * @param stop A stop date object for the range.
|
352 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
353 | */
|
354 | export function timeTuesdays(start: Date, stop: Date, step?: number): Date[];
|
355 |
|
356 | /**
|
357 | * Week Interval for Wednesday-based weeks in Local Time (e.g., February 8, 2012 at 12:00 AM).
|
358 | * 7 days and typically 168 hours.
|
359 | *
|
360 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
361 | */
|
362 | export const timeWednesday: CountableTimeInterval;
|
363 |
|
364 | /**
|
365 | * This is a convenience alias for timeWednesday.range(...).
|
366 | *
|
367 | * @param start A start date object for the range.
|
368 | * @param stop A stop date object for the range.
|
369 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
370 | */
|
371 | export function timeWednesdays(start: Date, stop: Date, step?: number): Date[];
|
372 |
|
373 | /**
|
374 | * Week Interval for Thursday-based weeks in Local Time (e.g., February 9, 2012 at 12:00 AM).
|
375 | * 7 days and typically 168 hours.
|
376 | *
|
377 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
378 | */
|
379 | export const timeThursday: CountableTimeInterval;
|
380 |
|
381 | /**
|
382 | * This is a convenience alias for timeThursday.range(...).
|
383 | *
|
384 | * @param start A start date object for the range.
|
385 | * @param stop A stop date object for the range.
|
386 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
387 | */
|
388 | export function timeThursdays(start: Date, stop: Date, step?: number): Date[];
|
389 |
|
390 | /**
|
391 | * Week Interval for Friday-based weeks in Local Time (e.g., February 10, 2012 at 12:00 AM).
|
392 | * 7 days and typically 168 hours.
|
393 | *
|
394 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
395 | */
|
396 | export const timeFriday: CountableTimeInterval;
|
397 |
|
398 | /**
|
399 | * This is a convenience alias for timeFriday.range(...).
|
400 | *
|
401 | * @param start A start date object for the range.
|
402 | * @param stop A stop date object for the range.
|
403 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
404 | */
|
405 | export function timeFridays(start: Date, stop: Date, step?: number): Date[];
|
406 |
|
407 | /**
|
408 | * Week Interval for Saturday-based weeks in Local Time (e.g., February 11, 2012 at 12:00 AM).
|
409 | * 7 days and typically 168 hours.
|
410 | *
|
411 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
412 | */
|
413 | export const timeSaturday: CountableTimeInterval;
|
414 |
|
415 | /**
|
416 | * This is a convenience alias for timeSaturday.range(...).
|
417 | *
|
418 | * @param start A start date object for the range.
|
419 | * @param stop A stop date object for the range.
|
420 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
421 | */
|
422 | export function timeSaturdays(start: Date, stop: Date, step?: number): Date[];
|
423 |
|
424 | /**
|
425 | * Month Interval in Local Time; months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days.
|
426 | */
|
427 | export const timeMonth: CountableTimeInterval;
|
428 |
|
429 | /**
|
430 | * This is a convenience alias for timeMonth.range(...).
|
431 | *
|
432 | * @param start A start date object for the range.
|
433 | * @param stop A stop date object for the range.
|
434 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
435 | */
|
436 | export function timeMonths(start: Date, stop: Date, step?: number): Date[];
|
437 |
|
438 | /**
|
439 | * Year Interval in Local Time; years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days.
|
440 | */
|
441 | export const timeYear: CountableTimeInterval;
|
442 |
|
443 | /**
|
444 | * This is a convenience alias for timeYear.range(...).
|
445 | *
|
446 | * @param start A start date object for the range.
|
447 | * @param stop A stop date object for the range.
|
448 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
449 | */
|
450 | export function timeYears(start: Date, stop: Date, step?: number): Date[];
|
451 |
|
452 | // utc Coordinated Universal Time ----------------------------------------------------------
|
453 |
|
454 | /**
|
455 | * Milliseconds Interval in Coordinated Universal Time (UTC); the shortest available time unit.
|
456 | */
|
457 | export const utcMillisecond: CountableTimeInterval;
|
458 |
|
459 | /**
|
460 | * This is a convenience alias for utcMillisecond.range(...).
|
461 | *
|
462 | * @param start A start date object for the range.
|
463 | * @param stop A stop date object for the range.
|
464 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
465 | */
|
466 | export function utcMilliseconds(start: Date, stop: Date, step?: number): Date[];
|
467 |
|
468 | /**
|
469 | * Seconds Interval in Coordinated Universal Time (UTC); seconds (e.g., 01:23:45.0000 AM); 1,000 milliseconds.
|
470 | */
|
471 | export const utcSecond: CountableTimeInterval;
|
472 |
|
473 | /**
|
474 | * This is a convenience alias for utcSecond.range(...).
|
475 | *
|
476 | * @param start A start date object for the range.
|
477 | * @param stop A stop date object for the range.
|
478 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
479 | */
|
480 | export function utcSeconds(start: Date, stop: Date, step?: number): Date[];
|
481 |
|
482 | /**
|
483 | * Minutes Interval in Coordinated Universal Time (UTC); minutes (e.g., 01:02:00 AM); 60 seconds.
|
484 | * Note that ECMAScript ignores leap seconds.
|
485 | */
|
486 | export const utcMinute: CountableTimeInterval;
|
487 |
|
488 | /**
|
489 | * This is a convenience alias for utcMinute.range(...).
|
490 | *
|
491 | * @param start A start date object for the range.
|
492 | * @param stop A stop date object for the range.
|
493 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
494 | */
|
495 | export function utcMinutes(start: Date, stop: Date, step?: number): Date[];
|
496 |
|
497 | /**
|
498 | * Hours Interval in Coordinated Universal Time (UTC); Hours (e.g., 01:00 AM); 60 minutes.
|
499 | */
|
500 | export const utcHour: CountableTimeInterval;
|
501 |
|
502 | /**
|
503 | * This is a convenience alias for utcHour.range(...).
|
504 | *
|
505 | * @param start A start date object for the range.
|
506 | * @param stop A stop date object for the range.
|
507 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
508 | */
|
509 | export function utcHours(start: Date, stop: Date, step?: number): Date[];
|
510 |
|
511 | /**
|
512 | * Days Interval in Coordinated Universal Time (UTC); days (e.g., February 7, 2012 at 12:00 AM); 24 hours.
|
513 | */
|
514 | export const utcDay: CountableTimeInterval;
|
515 |
|
516 | /**
|
517 | * This is a convenience alias for utcDay.range(...).
|
518 | *
|
519 | * @param start A start date object for the range.
|
520 | * @param stop A stop date object for the range.
|
521 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
522 | */
|
523 | export function utcDays(start: Date, stop: Date, step?: number): Date[];
|
524 |
|
525 | /**
|
526 | * Week Interval in Local Time. Alias for sunday; 7 days and 168 hours.
|
527 | *
|
528 | */
|
529 | export const utcWeek: CountableTimeInterval;
|
530 |
|
531 | /**
|
532 | * This is a convenience alias for utcWeek.range(...).
|
533 | *
|
534 | * @param start A start date object for the range.
|
535 | * @param stop A stop date object for the range.
|
536 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
537 | */
|
538 | export function utcWeeks(start: Date, stop: Date, step?: number): Date[];
|
539 |
|
540 | /**
|
541 | * Week Interval for Sunday-based weeks in Coordinated Universal Time (UTC) (e.g., February 5, 2012 at 12:00 AM).
|
542 | * 7 days and 168 hours.
|
543 | */
|
544 | export const utcSunday: CountableTimeInterval;
|
545 |
|
546 | /**
|
547 | * This is a convenience alias for utcSunday.range(...).
|
548 | *
|
549 | * @param start A start date object for the range.
|
550 | * @param stop A stop date object for the range.
|
551 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
552 | */
|
553 | export function utcSundays(start: Date, stop: Date, step?: number): Date[];
|
554 |
|
555 | /**
|
556 | * Week Interval for Monday-based weeks in Coordinated Universal Time (UTC) (e.g., February 6, 2012 at 12:00 AM).
|
557 | * 7 days and 168 hours.
|
558 | */
|
559 | export const utcMonday: CountableTimeInterval;
|
560 |
|
561 | /**
|
562 | * This is a convenience alias for utcMonday.range(...).
|
563 | *
|
564 | * @param start A start date object for the range.
|
565 | * @param stop A stop date object for the range.
|
566 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
567 | */
|
568 | export function utcMondays(start: Date, stop: Date, step?: number): Date[];
|
569 |
|
570 | /**
|
571 | * Week Interval for Tuesday-based weeks in Coordinated Universal Time (UTC) (e.g., February 7, 2012 at 12:00 AM).
|
572 | * 7 days and 168 hours.
|
573 | */
|
574 | export const utcTuesday: CountableTimeInterval;
|
575 |
|
576 | /**
|
577 | * This is a convenience alias for utcTuesday.range(...).
|
578 | *
|
579 | * @param start A start date object for the range.
|
580 | * @param stop A stop date object for the range.
|
581 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
582 | */
|
583 | export function utcTuesdays(start: Date, stop: Date, step?: number): Date[];
|
584 |
|
585 | /**
|
586 | * Week Interval for Wednesday-based weeks in Coordinated Universal Time (UTC) (e.g., February 8, 2012 at 12:00 AM).
|
587 | * 7 days and 168 hours.
|
588 | */
|
589 | export const utcWednesday: CountableTimeInterval;
|
590 |
|
591 | /**
|
592 | * This is a convenience alias for utcWednesday.range(...).
|
593 | *
|
594 | * @param start A start date object for the range.
|
595 | * @param stop A stop date object for the range.
|
596 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
597 | */
|
598 | export function utcWednesdays(start: Date, stop: Date, step?: number): Date[];
|
599 |
|
600 | /**
|
601 | * Week Interval for Thursday-based weeks in Coordinated Universal Time (UTC) (e.g., February 9, 2012 at 12:00 AM).
|
602 | * 7 days and 168 hours.
|
603 | */
|
604 | export const utcThursday: CountableTimeInterval;
|
605 |
|
606 | /**
|
607 | * This is a convenience alias for utcThursday.range(...).
|
608 | *
|
609 | * @param start A start date object for the range.
|
610 | * @param stop A stop date object for the range.
|
611 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
612 | */
|
613 | export function utcThursdays(start: Date, stop: Date, step?: number): Date[];
|
614 |
|
615 | /**
|
616 | * Week Interval for Friday-based weeks in Coordinated Universal Time (UTC) (e.g., February 10, 2012 at 12:00 AM).
|
617 | * 7 days and 168 hours.
|
618 | */
|
619 | export const utcFriday: CountableTimeInterval;
|
620 |
|
621 | /**
|
622 | * This is a convenience alias for utcFriday.range(...).
|
623 | *
|
624 | * @param start A start date object for the range.
|
625 | * @param stop A stop date object for the range.
|
626 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
627 | */
|
628 | export function utcFridays(start: Date, stop: Date, step?: number): Date[];
|
629 |
|
630 | /**
|
631 | * Week Interval for Saturday-based weeks in Coordinated Universal Time (UTC) (e.g., February 11, 2012 at 12:00 AM).
|
632 | * 7 days and 168 hours.
|
633 | */
|
634 | export const utcSaturday: CountableTimeInterval;
|
635 |
|
636 | /**
|
637 | * This is a convenience alias for utcSaturday.range(...).
|
638 | *
|
639 | * @param start A start date object for the range.
|
640 | * @param stop A stop date object for the range.
|
641 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
642 | */
|
643 | export function utcSaturdays(start: Date, stop: Date, step?: number): Date[];
|
644 |
|
645 | /**
|
646 | * Month Interval in Coordinated Universal Time (UTC); months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days.
|
647 | */
|
648 | export const utcMonth: CountableTimeInterval;
|
649 |
|
650 | /**
|
651 | * This is a convenience alias for utcMonth.range(...).
|
652 | *
|
653 | * @param start A start date object for the range.
|
654 | * @param stop A stop date object for the range.
|
655 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
656 | */
|
657 | export function utcMonths(start: Date, stop: Date, step?: number): Date[];
|
658 |
|
659 | /**
|
660 | * Year Interval in Coordinated Universal Time (UTC); years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days.
|
661 | */
|
662 | export const utcYear: CountableTimeInterval;
|
663 |
|
664 | /**
|
665 | * This is a convenience alias for utcYear.range(...).
|
666 | *
|
667 | * @param start A start date object for the range.
|
668 | * @param stop A stop date object for the range.
|
669 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
670 | */
|
671 | export function utcYears(start: Date, stop: Date, step?: number): Date[];
|
672 |
|
673 | /**
|
674 | * Equivalent to d3.utcTicks, but in local time.
|
675 | */
|
676 | export function timeTicks(start: Date, stop: Date, count: number): Date[];
|
677 |
|
678 | /**
|
679 | * Returns the time interval that would be used by d3.timeTicks given the same arguments.
|
680 | */
|
681 | export function timeTickInterval(start: Date, stop: Date, count: number): TimeInterval | null;
|
682 |
|
683 | /**
|
684 | * Returns an array of approximately count dates at regular intervals between start and stop (inclusive).
|
685 | * If stop is before start, dates are returned in reverse chronological order; otherwise dates are returned in chronological order.
|
686 | */
|
687 | export function utcTicks(start: Date, stop: Date, count: number): Date[];
|
688 |
|
689 | /**
|
690 | * Returns the time interval that would be used by d3.utcTicks given the same arguments.
|
691 | * If there is no associated interval, such as when start or stop is invalid, returns null.
|
692 | */
|
693 | export function utcTickInterval(start: Date, stop: Date, count: number): TimeInterval | null;
|