@js-joda/core 1.12.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/js-joda.d.ts CHANGED
@@ -1,1710 +1,2452 @@
1
- declare namespace JSJoda {
2
-
3
- abstract class TemporalAccessor {
4
- get(field: TemporalField): number
5
-
6
- query(query: TemporalQuery): any
7
-
8
- range(field: TemporalField): ValueRange
9
- }
10
-
11
- abstract class Temporal extends TemporalAccessor {
12
- }
13
-
14
- abstract class Clock {
15
- static fixed(fixedInstant: Instant, zoneOffset: ZoneOffset): Clock
16
-
17
- static system(zone: ZoneId): Clock
18
-
19
- static systemDefaultZone(): Clock
20
-
21
- static systemUTC(): Clock
22
-
23
- abstract instant(): Instant
24
-
25
- abstract millis(): number
26
-
27
- abstract zone(): ZoneId
28
-
29
- abstract withZone(zone: ZoneId): Clock
30
-
31
- abstract equals(other: any): boolean
32
- }
33
-
34
- class DayOfWeek extends Temporal {
35
- static MONDAY: DayOfWeek
36
- static TUESDAY: DayOfWeek
37
- static WEDNESDAY: DayOfWeek
38
- static THURSDAY: DayOfWeek
39
- static FRIDAY: DayOfWeek
40
- static SATURDAY: DayOfWeek
41
- static SUNDAY: DayOfWeek
42
-
43
- private constructor()
44
-
45
- static from(temporal: TemporalAccessor): DayOfWeek
46
-
47
- static of(dayOfWeek: number): DayOfWeek
48
-
49
- static valueOf(name: string): DayOfWeek
50
-
51
- static values(): DayOfWeek[]
52
-
53
- adjustInto(temporal: TemporalAdjuster): this
54
-
55
- compareTo(other: DayOfWeek): number
56
-
57
- equals(other: any): boolean
58
-
59
- getDisplayName(style: TextStyle, locale: Locale): string
60
-
61
- getLong(field: TemporalField): number
62
-
63
- isSupported(field: TemporalField): boolean
64
-
65
- minus(days: number): DayOfWeek
66
-
67
- name(): string
68
-
69
- ordinal(): number
70
-
71
- plus(days: number): DayOfWeek
72
-
73
- toString(): string
74
-
75
- value(): number
76
- }
77
-
78
- abstract class TemporalAmount {
79
- abstract addTo<T extends Temporal>(temporal: T): T
80
-
81
- abstract get(unit: TemporalUnit): number
82
-
83
- abstract units(): TemporalUnit[]
84
-
85
- abstract subtractFrom<T extends Temporal>(temporal: T): T
86
- }
87
-
88
- class Duration extends TemporalAmount {
89
- static ZERO: Duration
90
-
91
- static between(startInclusive: Temporal, endExclusive: Temporal): Duration
92
-
93
- static from(amount: TemporalAmount): Duration
94
-
95
- static of(amount: number, unit: TemporalUnit): Duration
96
-
97
- static ofDays(days: number): Duration
98
-
99
- static ofHours(hours: number): Duration
100
-
101
- static ofMillis(millis: number): Duration
102
-
103
- static ofMinutes(minutes: number): Duration
104
-
105
- static ofNanos(nanos: number): Duration
106
-
107
- static ofSeconds(seconds: number): Duration
108
-
109
- static parse(text: string): Duration
110
-
111
- private constructor()
112
-
113
- abs(): Duration
114
-
115
- addTo<T extends Temporal>(temporal: T): T
116
-
117
- compareTo(otherDuration: Duration): number
118
-
119
- dividedBy(divisor: number): Duration
120
-
121
- equals(other: any): boolean
122
-
123
- get(unit: TemporalUnit): number
124
-
125
- isNegative(): boolean
126
-
127
- isZero(): boolean
128
-
129
- minus(durationOrNumber: Duration|number, unit: ChronoUnit): Duration
130
-
131
- minusAmountUnit(amountToSubtract: number, unit: TemporalUnit): Duration
132
-
133
- minusDays(daysToSubtract: number): Duration
134
-
135
- minusDuration(duration: Duration): Duration
136
-
137
- minusHours(hoursToSubtract: number): Duration
138
-
139
- minusMillis(millisToSubtract: number): Duration
140
-
141
- minusMinutes(minutesToSubtract: number): Duration
142
-
143
- minusNanos(nanosToSubtract: number): Duration
144
-
145
- minusSeconds(secondsToSubtract: number): Duration
146
-
147
- multipliedBy(multiplicand: number): Duration
148
-
149
- nano(): number
150
-
151
- negated(): Duration
152
-
153
- plus(durationOrNumber: Duration|number, unitOrNumber: TemporalUnit|number): Duration
154
-
155
- plusAmountUnit(amountToAdd: number, unit: TemporalUnit): Duration
156
-
157
- plusDays(daysToAdd: number): Duration
158
-
159
- plusDuration(duration: Duration): Duration
160
-
161
- plusHours(hoursToAdd: number): Duration
162
-
163
- plusMillis(millisToAdd: number): Duration
164
-
165
- plusMinutes(minutesToAdd: number): Duration
166
-
167
- plusNanos(nanosToAdd: number): Duration
168
-
169
- plusSeconds(secondsToAdd: number): Duration
170
-
171
- plusSecondsNanos(secondsToAdd: number, nanosToAdd: number): Duration
172
-
173
- seconds(): number
174
-
175
- subtractFrom<T extends Temporal>(temporal: T): T
176
-
177
- toDays(): number
178
-
179
- toHours(): number
180
-
181
- toJSON(): string
182
-
183
- toMillis(): number
184
-
185
- toMinutes(): number
186
-
187
- toNanos(): number
188
-
189
- toString(): string
190
-
191
- units(): TemporalUnit[]
192
-
193
- withNanos(nanoOfSecond: number): Duration
194
-
195
- withSeconds(seconds: number): Duration
196
- }
197
-
198
- class Instant extends Temporal {
199
- static EPOCH: Instant
200
- static MIN: Instant
201
- static MAX: Instant
202
- static MIN_SECONDS: Instant
203
- static MAX_SECONDS: Instant
204
-
205
- static from(temporal: TemporalAccessor): Instant
206
-
207
- static now(clock?: Clock): Instant
208
-
209
- static ofEpochMilli(epochMilli: number): Instant
210
-
211
- static ofEpochSecond(epochSecond: number, nanoAdjustment?: number): Instant
212
-
213
- static parse(text: string): Instant
214
-
215
- private constructor()
216
-
217
- adjustInto(temporal: Temporal): Temporal
218
-
219
- atZone(zone: ZoneId): ZonedDateTime
220
-
221
- compareTo(otherInstant: Instant): number
222
-
223
- epochSecond(): number
224
-
225
- equals(other: any): boolean
226
-
227
- get(field: TemporalField): number
228
-
229
- getLong(field: TemporalField): number
230
-
231
- hashCode(): number
232
-
233
- isAfter(otherInstant: Instant): boolean
234
-
235
- isBefore(otherInstant: Instant): boolean
236
-
237
- isSupported(fieldOrUnit: TemporalField|TemporalUnit): boolean
238
-
239
- minus(amount: TemporalAmount): Instant
240
- minus(amountToSubtract: number, unit: TemporalUnit): Instant
241
-
242
- minusMillis(millisToSubtract: number): Instant
243
-
244
- minusNanos(nanosToSubtract: number): Instant
245
-
246
- minusSeconds(secondsToSubtract: number): Instant
247
-
248
- nano(): number
249
-
250
- plus(amount: TemporalAmount): Instant
251
- plus(amountToAdd: number, unit: TemporalUnit): Instant
252
-
253
- plusMillis(millisToAdd: number): Instant
254
-
255
- plusNanos(nanosToAdd: number): Instant
256
-
257
- plusSeconds(secondsToAdd: number): Instant
258
-
259
- query(query: TemporalQuery): any
260
-
261
- range(field: TemporalField): ValueRange
262
-
263
- toEpochMilli(): number
264
-
265
- toJSON(): string;
266
-
267
- toString(): string
268
-
269
- truncatedTo(unit: TemporalUnit): Instant
270
-
271
- until(endExclusive: Temporal, unit: TemporalUnit): number
272
-
273
- with(adjuster: TemporalAdjuster): Instant
274
- with(field: TemporalField, newValue: number): Instant
275
-
276
- withTemporalAdjuster(adjuster: TemporalAdjuster): Instant
277
-
278
- }
279
-
280
- class ResolverStyle {
281
- static STRICT: ResolverStyle
282
- static SMART: ResolverStyle
283
- static LENIENT: ResolverStyle
284
-
285
- private constructor()
286
- }
287
-
288
- class SignStyle {
289
- static NORMAL: SignStyle;
290
- static NEVER: SignStyle;
291
- static ALWAYS: SignStyle;
292
- static EXCEEDS_PAD: SignStyle;
293
- static NOT_NEGATIVE: SignStyle;
294
- }
295
-
296
- class DateTimeFormatter {
297
- static ISO_LOCAL_DATE: DateTimeFormatter
298
- static ISO_LOCAL_TIME: DateTimeFormatter
299
- static ISO_LOCAL_DATE_TIME: DateTimeFormatter
300
- static ISO_INSTANT: DateTimeFormatter
301
- static ISO_OFFSET_DATE_TIME: DateTimeFormatter
302
- static ISO_ZONED_DATE_TIME: DateTimeFormatter
303
-
304
- static ofPattern(pattern: string): DateTimeFormatter
305
-
306
- static parsedExcessDays(): TemporalQuery
307
-
308
- static parsedLeapSecond(): boolean
309
-
310
- private constructor()
311
-
312
- chronology(): any
313
-
314
- decimalStyle(): any
315
-
316
- format(temporal: TemporalAccessor): string
317
-
318
- locale(): any
319
-
320
- parse(text: string, type: TemporalQuery): TemporalAccessor
321
-
322
- parse1(text: string): TemporalAccessor
323
-
324
- parse2(text: any, type: any): any
325
-
326
- parseUnresolved(text: any, position: any): any
327
-
328
- toString(): string
329
-
330
- withChronology(chrono: any): any
331
-
332
- withLocale(locale: Locale): DateTimeFormatter
333
-
334
- withResolverStyle(resolverStyle: ResolverStyle): DateTimeFormatter
335
- }
336
-
337
- class DateTimeFormatterBuilder {
338
- constructor()
339
-
340
- append(formatter: DateTimeFormatter): DateTimeFormatterBuilder
341
-
342
- appendFraction(field: TemporalField, minWidth: number, maxWidth: number, decimalPoint: boolean): DateTimeFormatterBuilder
343
-
344
- appendInstant(fractionalDigits: number): DateTimeFormatterBuilder
345
-
346
- appendLiteral(literal: any): DateTimeFormatterBuilder
347
-
348
- appendOffset(pattern: string, noOffsetText: string): DateTimeFormatterBuilder
349
-
350
- appendOffsetId(): DateTimeFormatterBuilder
351
-
352
- appendPattern(pattern: string): DateTimeFormatterBuilder
353
-
354
- appendValue(field: TemporalField, width?: number, maxWidth?: number, signStyle?: SignStyle): DateTimeFormatterBuilder
355
-
356
- appendValueReduced(field: TemporalField, width: number, maxWidth: number, base: ChronoLocalDate | number): DateTimeFormatterBuilder
357
-
358
- appendZoneId(): DateTimeFormatterBuilder
359
-
360
- optionalEnd(): DateTimeFormatterBuilder
361
-
362
- optionalStart(): DateTimeFormatterBuilder
363
-
364
- padNext(): DateTimeFormatterBuilder
365
-
366
- parseCaseInsensitive(): DateTimeFormatterBuilder
367
-
368
- parseCaseSensitive(): DateTimeFormatterBuilder
369
-
370
- parseLenient(): DateTimeFormatterBuilder
371
-
372
- parseStrict(): DateTimeFormatterBuilder
373
-
374
- toFormatter(resolverStyle: ResolverStyle): DateTimeFormatter
375
- }
376
-
377
- // TODO: js-joda doesn't have Chronology yet. Methods like `LocalDate.chronology()`
378
- // actually return an `IsoChronology` so Chronology is an alias type of that class
379
- // for now. Change this if Chronology is added.
380
- type Chronology = IsoChronology
381
-
382
-
383
- class LocalTime extends Temporal {
384
- static MIN: LocalTime
385
- static MAX: LocalTime
386
- static MIDNIGHT: LocalTime
387
- static NOON: LocalTime
388
-
389
- static HOURS_PER_DAY: number
390
- static MINUTES_PER_HOUR: number
391
- static MINUTES_PER_DAY: number
392
- static SECONDS_PER_MINUTE: number
393
- static SECONDS_PER_HOUR: number
394
- static SECONDS_PER_DAY: number
395
- static MILLIS_PER_DAY: number
396
- static MICROS_PER_DAY: number
397
- static NANOS_PER_SECOND: number
398
- static NANOS_PER_MINUTE: number
399
- static NANOS_PER_HOUR: number
400
- static NANOS_PER_DAY: number
401
-
402
- static from(temporal: TemporalAccessor): LocalTime
403
-
404
- static now(clockOrZone?: Clock|ZoneId): LocalTime
405
-
406
- static of(hour?: number, minute?: number, second?: number, nanoOfSecond?: number): LocalTime
407
-
408
- static ofInstant(instant: Instant, zone?: ZoneId): LocalTime
409
-
410
- static ofNanoOfDay(nanoOfDay: number): LocalTime
411
-
412
- static ofSecondOfDay(secondOfDay?: number, nanoOfSecond?: number): LocalTime
413
-
414
- static parse(text: String, formatter?: DateTimeFormatter): LocalTime
415
-
416
- private constructor()
417
-
418
- adjustInto(temporal: TemporalAdjuster): Temporal
419
-
420
- atDate(date: LocalDate): LocalDateTime
421
-
422
- compareTo(other: LocalTime): number
423
-
424
- equals(other: any): boolean
425
-
426
- format(formatter: DateTimeFormatter): string
427
-
428
- get(field: ChronoField): number
429
-
430
- getLong(field: ChronoField): number
431
-
432
- hashCode(): number
433
-
434
- hour(): number
435
-
436
- isAfter(other: LocalTime): boolean
437
-
438
- isBefore(other: LocalTime): boolean
439
-
440
- isSupported(fieldOrUnit: ChronoField|ChronoUnit): boolean
441
-
442
- minus(amount: TemporalAmount): LocalTime
443
- minus(amountToSubtract: number, unit: ChronoUnit): LocalTime
444
-
445
- minusHours(hoursToSubtract: number): LocalTime
446
-
447
- minusMinutes(minutesToSubtract: number): LocalTime
448
-
449
- minusNanos(nanosToSubtract: number): LocalTime
450
-
451
- minusSeconds(secondsToSubtract: number): LocalTime
452
-
453
- minute(): number
454
-
455
- nano(): number
456
-
457
- plus(amount: TemporalAmount): LocalTime
458
- plus(amountToAdd: number, unit: TemporalUnit): LocalTime
459
-
460
- plusHours(hoursToAdd: number): LocalTime
461
-
462
- plusMinutes(minutesToAdd: number): LocalTime
463
-
464
- plusNanos(nanosToAdd: number): LocalTime
465
-
466
- plusSeconds(secondstoAdd: number): LocalTime
467
-
468
- query(query: TemporalQuery): any
469
-
470
- range(field: ChronoField): ValueRange
471
-
472
- second(): number
473
-
474
- toJSON(): string
475
-
476
- toNanoOfDay(): number
477
-
478
- toSecondOfDay(): number
479
-
480
- toString(): string
481
-
482
- truncatedTo(unit: ChronoUnit): LocalTime
483
-
484
- until(endExclusive: TemporalAccessor, unit: TemporalUnit): number
485
-
486
- with(adjuster: TemporalAdjuster): LocalTime
487
- with(field: TemporalField, newValue: number): LocalTime
488
-
489
- withHour(hour: number): LocalTime
490
-
491
- withMinute(minute: number): LocalTime
492
-
493
- withNano(nanoOfSecond: number): LocalTime
494
-
495
- withSecond(second: number): LocalTime
496
-
497
- withTemporalAdjuster(adjuster: TemporalAdjuster): LocalTime
498
- }
499
-
500
- class MathUtil {
501
- static compareNumbers(a: number, b: number): number
502
-
503
- static floorDiv(x: number, y: number): number
504
-
505
- static floorMod(x: number, y: number): number
506
-
507
- static intDiv(x: number, y: number): number
508
-
509
- static intMod(x: number, y: number): number
510
-
511
- static parseInt(value: number): number
512
-
513
- static roundDown(r: number): number
514
-
515
- static safeAdd(x: number, y: number): number
516
-
517
- static safeMultiply(x: number, y: number): number
518
-
519
- static safeSubtract(x: number, y: number): number
520
-
521
- static safeToInt(value: number): number
522
-
523
- static safeZero(value: number): number
524
-
525
- static verifyInt(value: number): void
526
- }
527
-
528
- class Month extends Temporal {
529
- static JANUARY: Month
530
- static FEBRUARY: Month
531
- static MARCH: Month
532
- static APRIL: Month
533
- static MAY: Month
534
- static JUNE: Month
535
- static JULY: Month
536
- static AUGUST: Month
537
- static SEPTEMBER: Month
538
- static OCTOBER: Month
539
- static NOVEMBER: Month
540
- static DECEMBER: Month
541
-
542
- static from(temporal: TemporalAccessor): Month
543
-
544
- static of(month: number): Month
545
-
546
- static valueOf(name: string): Month
547
-
548
- static values(): Month[]
549
-
550
- private constructor()
551
-
552
- adjustInto(temporal: Temporal): Temporal
553
-
554
- compareTo(other: Month): number
555
-
556
- equals(other: any): boolean
557
-
558
- firstDayOfYear(leapYear: boolean): number
559
-
560
- firstMonthOfQuarter(): Month
561
-
562
- get(field: TemporalField): number
563
-
564
- getDisplayName(style: TextStyle, locale: Locale): string
565
-
566
- getLong(field: TemporalField): number
567
-
568
- isSupported(field: TemporalField): boolean
569
-
570
- length(leapYear: boolean): number
571
-
572
- maxLength(): number
573
-
574
- minLength(): number
575
-
576
- minus(months: number): Month
577
-
578
- name(): string
579
-
580
- ordinal(): number
581
-
582
- plus(months: number): Month
583
-
584
- query(query: TemporalQuery): any
585
-
586
- toString(): string
587
-
588
- value(): number
589
- }
590
-
591
- class MonthDay extends Temporal {
592
- static from(temporal: TemporalAccessor): MonthDay
593
-
594
- static now(arg1?: ZoneId|Clock): MonthDay
595
-
596
- static of(monthOrNumber: Month|number, number?: number): MonthDay
597
-
598
- static ofMonthNumber(month: Month, dayOfMonth: number): MonthDay
599
-
600
- static ofNumberNumber(month: number, dayOfMonth: number): MonthDay
601
-
602
- static parse(text: string, formatter?: DateTimeFormatter): MonthDay
603
-
604
- static parseString(text: string): MonthDay
605
-
606
- static parseStringFormatter(text: string, formatter: DateTimeFormatter): MonthDay
607
-
608
- private constructor()
609
-
610
- adjustInto(temporal: Temporal): Temporal
611
-
612
- atYear(year: number): LocalDate
613
-
614
- compareTo(other: MonthDay): number
615
-
616
- dayOfMonth(): number
617
-
618
- equals(other: any): boolean
619
-
620
- format(formatter: DateTimeFormatter): string
621
-
622
- get(field: TemporalField): number
623
-
624
- getLong(field: TemporalField): number
625
-
626
- isAfter(other: MonthDay): boolean
627
-
628
- isBefore(other: MonthDay): boolean
629
-
630
- isSupported(field: TemporalField): boolean
631
-
632
- isValidYear(year: number): boolean
633
-
634
- month(): Month
635
-
636
- monthValue(): number
637
-
638
- query(query: TemporalQuery): any
639
-
640
- range(field: TemporalField): ValueRange
641
-
642
- toString(): string
643
-
644
- with(month: Month): MonthDay
645
-
646
- withDayOfMonth(dayOfMonth: number): MonthDay
647
-
648
- withMonth(month: number): MonthDay
649
- }
650
-
651
- abstract class TemporalField {
652
- abstract isDateBased(): boolean
653
- abstract isTimeBased(): boolean
654
- abstract name(): string
655
- }
656
-
657
- class ChronoField extends TemporalField {
658
- static NANO_OF_SECOND: ChronoField
659
- static NANO_OF_DAY: ChronoField
660
- static MICRO_OF_SECOND: ChronoField
661
- static MICRO_OF_DAY: ChronoField
662
- static MILLI_OF_SECOND: ChronoField
663
- static MILLI_OF_DAY: ChronoField
664
- static SECOND_OF_MINUTE: ChronoField
665
- static SECOND_OF_DAY: ChronoField
666
- static MINUTE_OF_HOUR: ChronoField
667
- static MINUTE_OF_DAY: ChronoField
668
- static HOUR_OF_AMPM: ChronoField
669
- static CLOCK_HOUR_OF_AMPM: ChronoField
670
- static HOUR_OF_DAY: ChronoField
671
- static CLOCK_HOUR_OF_DAY: ChronoField
672
- static AMPM_OF_DAY: ChronoField
673
- static DAY_OF_WEEK: ChronoField
674
- static ALIGNED_DAY_OF_WEEK_IN_MONTH: ChronoField
675
- static ALIGNED_DAY_OF_WEEK_IN_YEAR: ChronoField
676
- static DAY_OF_MONTH: ChronoField
677
- static DAY_OF_YEAR: ChronoField
678
- static EPOCH_DAY: ChronoField
679
- static ALIGNED_WEEK_OF_MONTH: ChronoField
680
- static ALIGNED_WEEK_OF_YEAR: ChronoField
681
- static MONTH_OF_YEAR: ChronoField
682
- static PROLEPTIC_MONTH: ChronoField
683
- static YEAR_OF_ERA: ChronoField
684
- static YEAR: ChronoField
685
- static ERA: ChronoField
686
- static INSTANT_SECONDS: ChronoField
687
- static OFFSET_SECONDS: ChronoField
688
-
689
- private constructor()
690
-
691
- baseUnit(): number
692
-
693
- checkValidIntValue(value: number): number
694
-
695
- checkValidValue(value: number): any
696
-
697
- displayName(): string
698
-
699
- equals(other: any): boolean
700
-
701
- getFrom(temporal: TemporalAccessor): number
702
-
703
- isDateBased(): boolean
704
-
705
- isTimeBased(): boolean
706
-
707
- name(): string
708
-
709
- range(): ValueRange
710
-
711
- rangeRefinedBy(temporal: TemporalAccessor): ValueRange
712
-
713
- rangeUnit(): number
714
-
715
- toString(): string
716
- }
717
-
718
- abstract class TemporalUnit {
719
- abstract addTo<T extends Temporal>(temporal: T, amount: number): T
720
-
721
- abstract between(temporal1: Temporal, temporal2: Temporal): number
722
-
723
- abstract duration(): Duration
724
-
725
- abstract isDateBased(): boolean
726
-
727
- abstract isDurationEstimated(): boolean
728
-
729
- abstract isSupportedBy(temporal: Temporal): boolean
730
-
731
- abstract isTimeBased(): boolean
732
- }
733
-
734
- class ChronoUnit extends TemporalUnit {
735
- static NANOS: ChronoUnit
736
- static MICROS: ChronoUnit
737
- static MILLIS: ChronoUnit
738
- static SECONDS: ChronoUnit
739
- static MINUTES: ChronoUnit
740
- static HOURS: ChronoUnit
741
- static HALF_DAYS: ChronoUnit
742
- static DAYS: ChronoUnit
743
- static WEEKS: ChronoUnit
744
- static MONTHS: ChronoUnit
745
- static YEARS: ChronoUnit
746
- static DECADES: ChronoUnit
747
- static CENTURIES: ChronoUnit
748
- static MILLENNIA: ChronoUnit
749
- static ERAS: ChronoUnit
750
- static FOREVER: ChronoUnit
751
-
752
- private constructor()
753
-
754
- addTo<T extends Temporal>(temporal: T, amount: number): T
755
-
756
- between(temporal1: Temporal, temporal2: Temporal): number
757
-
758
- compareTo(other: TemporalUnit): number
759
-
760
- duration(): Duration
761
-
762
- isDateBased(): boolean
763
-
764
- isDurationEstimated(): boolean
765
-
766
- isSupportedBy(temporal: Temporal): boolean
767
-
768
- isTimeBased(): boolean
769
-
770
- toString(): string
771
- }
772
-
773
- class IsoFields {
774
- static DAY_OF_QUARTER: TemporalField
775
- static QUARTER_OF_YEAR: TemporalField
776
- static WEEK_OF_WEEK_BASED_YEAR: TemporalField
777
- static WEEK_BASED_YEAR: TemporalField
778
- static WEEK_BASED_YEARS: TemporalUnit
779
- static QUARTER_YEARS: TemporalUnit
780
-
781
- private constructor()
782
- }
783
-
784
- abstract class ChronoLocalDate extends Temporal {
785
- adjustInto(temporal: TemporalAdjuster): this
786
-
787
- format(formatter: DateTimeFormatter): string
788
-
789
- isSupported(fieldOrUnit: TemporalField|TemporalUnit): boolean
790
- }
791
-
792
- class LocalDate extends ChronoLocalDate {
793
- static MIN: LocalDate
794
- static MAX: LocalDate
795
- static EPOCH_0: LocalDate
796
-
797
- static from(temporal: TemporalAccessor): LocalDate
798
-
799
- static now(clockOrZone?: Clock|ZoneId): LocalDate
800
-
801
- static of(year: number, month: Month|number, dayOfMonth: number): LocalDate
802
-
803
- static ofEpochDay(epochDay: number): LocalDate
804
-
805
- static ofInstant(instant: Instant, zoneId?: ZoneId): LocalDate
806
-
807
- static ofYearDay(year: number, dayOfYear: number): LocalDate
808
-
809
- static parse(text: string, formatter?: DateTimeFormatter): LocalDate
810
-
811
- private constructor()
812
-
813
- atStartOfDay(): LocalDateTime
814
- atStartOfDay(zone: ZoneId): ZonedDateTime
815
-
816
- atStartOfDayWithZone(zone: ZoneId): ZonedDateTime
817
-
818
- atTime(time: LocalTime): LocalDateTime
819
- atTime(hour: number, minute: number, second?: number, nanoOfSecond?: number): LocalDateTime
820
-
821
- chronology(): Chronology
822
-
823
- compareTo(other: LocalDate): number
824
-
825
- dayOfMonth(): number
826
-
827
- dayOfWeek(): DayOfWeek
828
-
829
- dayOfYear(): number
830
-
831
- equals(other: any): boolean
832
-
833
- get(field: TemporalField): number
834
-
835
- getLong(field: TemporalField): number
836
-
837
- hashCode(): number
838
-
839
- isAfter(other: LocalDate): boolean
840
-
841
- isBefore(other: LocalDate): boolean
842
-
843
- isEqual(other: LocalDate): boolean
844
-
845
- isLeapYear(): boolean
846
-
847
- isoWeekOfWeekyear(): number; //implemented in IsoFields.js
848
- isoWeekyear(): number; //implemented in IsoFields.js
849
-
850
- lengthOfMonth(): number;
851
-
852
- lengthOfYear(): number;
853
-
854
- minus(amount: TemporalAmount): LocalDate
855
- minus(amountToSubtract: number, unit: TemporalUnit): LocalDate
856
-
857
- minusDays(daysToSubtract: number): LocalDate
858
-
859
- minusMonths(monthsToSubtract: number): LocalDate
860
-
861
- minusWeeks(weeksToSubtract: number): LocalDate
862
-
863
- minusYears(yearsToSubtract: number): LocalDate
864
-
865
- month(): Month
866
-
867
- monthValue(): number
868
-
869
- plus(amount: TemporalAmount): LocalDate
870
- plus(amountToAdd: number, unit: TemporalUnit): LocalDate
871
-
872
- plusDays(daysToAdd: number): LocalDate
873
-
874
- plusMonths(monthsToAdd: number): LocalDate
875
-
876
- plusWeeks(weeksToAdd: number): LocalDate
877
-
878
- plusYears(yearsToAdd: number): LocalDate
879
-
880
- query(query: TemporalQuery): any
881
-
882
- range(field: TemporalField): ValueRange
883
-
884
- toEpochDay(): number
885
-
886
- toJSON(): string
887
-
888
- toString(): string
889
-
890
- until(endDate: TemporalAccessor): Period
891
- until(endExclusive: TemporalAccessor, unit: TemporalUnit): number
892
-
893
- with(fieldOrAdjuster: TemporalField, newValue: Number): LocalDate
894
- with(adjuster: TemporalAdjuster): LocalDate
895
-
896
- withDayOfMonth(dayOfMonth: number): LocalDate
897
-
898
- withDayOfYear(dayOfYear: number): LocalDate
899
-
900
- withFieldAndValue(field: TemporalField, newValue: number): LocalDate
901
-
902
- withMonth(month: Month|number): LocalDate
903
-
904
- withTemporalAdjuster(adjuster: TemporalAdjuster): LocalDate
905
-
906
- withYear(year: number): LocalDate
907
-
908
- year(): number
909
- }
910
-
911
- abstract class ChronoLocalDateTime extends Temporal {
912
- adjustInto(temporal: any): any
913
-
914
- chronology(): Chronology
915
-
916
- toEpochSecond(offset: ZoneOffset): number
917
-
918
- toInstant(offset: ZoneOffset): Instant
919
- }
920
-
921
- class LocalDateTime extends ChronoLocalDateTime {
922
- static MIN: LocalDateTime
923
- static MAX: LocalDateTime
924
-
925
- static from(temporal: TemporalAccessor): LocalDateTime
926
-
927
- static now(clockOrZone?: Clock|ZoneId): LocalDateTime
928
-
929
- static of(date: LocalDate, time: LocalTime): LocalDateTime
930
- static of(year: number, month: Month|number, dayOfMonth: number, hour?: number, minute?: number, second?: number, nanoSecond?: number): LocalDateTime
931
-
932
- static ofEpochSecond(epochSecond: number, offset:ZoneOffset): LocalDateTime
933
- static ofEpochSecond(epochSecond: number, nanoOfSecond: number, offset:ZoneOffset): LocalDateTime
934
-
935
- static ofInstant(instant: Instant, zoneId?: ZoneId): LocalDateTime
936
-
937
- static parse(text: string, formatter?: DateTimeFormatter): LocalDateTime
938
-
939
- private constructor()
940
-
941
- adjustInto(temporal: TemporalAdjuster): LocalDateTime
942
-
943
- atZone(zone: ZoneId): ZonedDateTime
944
-
945
- compareTo(other: LocalDateTime): number
946
-
947
- dayOfMonth(): number
948
-
949
- dayOfWeek(): DayOfWeek
950
-
951
- dayOfYear(): number
952
-
953
- equals(other: any): boolean
954
-
955
- format(formatter: DateTimeFormatter): string
956
-
957
- get(field: TemporalField): number
958
-
959
- getLong(field: TemporalField): number
960
-
961
- hashCode(): number
962
-
963
- hour(): number
964
-
965
- isAfter(other: LocalDateTime): boolean
966
-
967
- isBefore(other: LocalDateTime): boolean
968
-
969
- isEqual(other: LocalDateTime): boolean
970
-
971
- isSupported(fieldOrUnit: TemporalField|TemporalUnit): boolean
972
-
973
- minus(amount: TemporalAmount): LocalDateTime
974
- minus(amountToSubtract: number, unit: TemporalUnit): LocalDateTime
975
-
976
- minusDays(days: number): LocalDateTime
977
-
978
- minusHours(hours: number): LocalDateTime
979
-
980
- minusMinutes(minutes: number): LocalDateTime
981
-
982
- minusMonths(months: number): LocalDateTime
983
-
984
- minusNanos(nanos: number): LocalDateTime
985
-
986
- minusSeconds(seconds: number): LocalDateTime
987
-
988
- minusTemporalAmount(amount: TemporalAmount): LocalDateTime
989
-
990
- minusWeeks(weeks: number): LocalDateTime
991
-
992
- minusYears(years: number): LocalDateTime
993
-
994
- minute(): number
995
-
996
- month(): Month
997
-
998
- monthValue(): number
999
-
1000
- nano(): number
1001
-
1002
- plus(amount: TemporalAmount): LocalDateTime
1003
- plus(amountToAdd: number, unit: TemporalUnit): LocalDateTime
1004
-
1005
- plusDays(days: number): LocalDateTime
1006
-
1007
- plusHours(hours: number): LocalDateTime
1008
-
1009
- plusMinutes(minutes: number): LocalDateTime
1010
-
1011
- plusMonths(months: number): LocalDateTime
1012
-
1013
- plusNanos(nanos: number): LocalDateTime
1014
-
1015
- plusSeconds(seconds: number): LocalDateTime
1016
-
1017
- plusTemporalAmount(amount: TemporalAmount): LocalDateTime
1018
-
1019
- plusWeeks(weeks: number): LocalDateTime
1020
-
1021
- plusYears(years: number): LocalDateTime
1022
-
1023
- query(query: TemporalQuery): any
1024
-
1025
- range(field: TemporalField): ValueRange
1026
-
1027
- second(): number
1028
-
1029
- toJSON(): string
1030
-
1031
- toLocalDate(): LocalDate
1032
-
1033
- toLocalTime(): LocalTime
1034
-
1035
- toString(): string
1036
-
1037
- truncatedTo(unit: TemporalUnit): LocalDateTime
1038
-
1039
- until(endExclusive: Temporal, unit: TemporalUnit): number
1040
-
1041
- with(adjuster: TemporalAdjuster): LocalDateTime
1042
- with(field: TemporalField, newValue: number): LocalDateTime
1043
-
1044
- withDayOfMonth(dayOfMonth: number): LocalDateTime
1045
-
1046
- withDayOfYear(dayOfYear: number): LocalDateTime
1047
-
1048
- withHour(hour: number): LocalDateTime
1049
-
1050
- withMinute(minute: number): LocalDateTime
1051
-
1052
- withMonth(month: number|Month): LocalDateTime
1053
-
1054
- withNano(nanoOfSecond: number): LocalDateTime
1055
-
1056
- withSecond(second: number): LocalDateTime
1057
-
1058
- withTemporalAdjuster(adjuster: TemporalAdjuster): LocalDateTime
1059
-
1060
- withYear(year: number): LocalDateTime
1061
-
1062
- year(): number
1063
- }
1064
-
1065
- class Period extends TemporalAmount {
1066
- static ZERO: Period
1067
-
1068
- static between(startDate: LocalDate, endDate: LocalDate): Period
1069
-
1070
- static create(years: number, months: number, days: number): Duration
1071
-
1072
- static from(amount: TemporalAmount): Period
1073
-
1074
- static of(years: number, months: number, days: number): Period
1075
-
1076
- static ofDays(days: number): Period
1077
-
1078
- static ofMonths(months: number): Period
1079
-
1080
- static ofWeeks(weeks: number): Period
1081
-
1082
- static ofYears(years: number): Period
1083
-
1084
- static parse(text: string): Period
1085
-
1086
- private constructor()
1087
-
1088
- addTo<T extends Temporal>(temporal: T): T
1089
-
1090
- chronology(): IsoChronology
1091
-
1092
- days(): number
1093
-
1094
- equals(other: any): boolean
1095
-
1096
- get(unit: TemporalUnit): number
1097
-
1098
- hashCode(): number
1099
-
1100
- isNegative(): boolean
1101
-
1102
- isZero(): boolean
1103
-
1104
- minus(amountToSubtract: TemporalAmount): Period
1105
-
1106
- minusDays(daysToSubtract: number): Period
1107
-
1108
- minusMonths(monthsToSubtract: number): Period
1109
-
1110
- minusYears(yearsToSubtract: number): Period
1111
-
1112
- months(): number
1113
-
1114
- multipliedBy(scalar: number): Period
1115
-
1116
- negated(): Period
1117
-
1118
- normalized(): Period
1119
-
1120
- plus(amountToAdd: TemporalAmount): Period
1121
-
1122
- plusDays(daysToAdd: number): Period
1123
-
1124
- plusMonths(monthsToAdd: number): Period
1125
-
1126
- plusYears(yearsToAdd: number): Period
1127
-
1128
- subtractFrom<T extends Temporal>(temporal: T): T
1129
-
1130
- toJSON(): string
1131
-
1132
- toString(): string
1133
-
1134
- toTotalMonths(): number
1135
-
1136
- units(): TemporalUnit[]
1137
-
1138
- withDays(days: number): Period
1139
-
1140
- withMonths(months: number): Period
1141
-
1142
- withYears(years: number): Period
1143
-
1144
- years(): number
1145
- }
1146
-
1147
- abstract class TemporalAdjuster {
1148
- abstract adjustInto(temporal: Temporal): Temporal
1149
- }
1150
-
1151
- class TemporalAdjusters {
1152
- static dayOfWeekInMonth(ordinal: number, dayOfWeek: DayOfWeek): TemporalAdjuster
1153
-
1154
- static firstDayOfMonth(): TemporalAdjuster
1155
-
1156
- static firstDayOfNextMonth(): TemporalAdjuster
1157
-
1158
- static firstDayOfNextYear(): TemporalAdjuster
1159
-
1160
- static firstDayOfYear(): TemporalAdjuster
1161
-
1162
- static firstInMonth(dayOfWeek: DayOfWeek): TemporalAdjuster
1163
-
1164
- static lastDayOfMonth(): TemporalAdjuster
1165
-
1166
- static lastDayOfYear(): TemporalAdjuster
1167
-
1168
- static lastInMonth(dayOfWeek: DayOfWeek): TemporalAdjuster
1169
-
1170
- static next(dayOfWeek: DayOfWeek): TemporalAdjuster
1171
-
1172
- static nextOrSame(dayOfWeek: DayOfWeek): TemporalAdjuster
1173
-
1174
- static previous(dayOfWeek: DayOfWeek): TemporalAdjuster
1175
-
1176
- static previousOrSame(dayOfWeek: DayOfWeek): TemporalAdjuster
1177
-
1178
- private constructor()
1179
- }
1180
-
1181
- class TemporalQueries {
1182
- static chronology(): TemporalQuery
1183
-
1184
- static localDate(): TemporalQuery
1185
-
1186
- static localTime(): TemporalQuery
1187
-
1188
- static offset(): TemporalQuery
1189
-
1190
- static precision(): TemporalQuery
1191
-
1192
- static zone(): TemporalQuery
1193
-
1194
- static zoneId(): TemporalQuery
1195
-
1196
- private constructor()
1197
- }
1198
-
1199
- abstract class TemporalQuery {
1200
- abstract queryFrom(temporal: TemporalAccessor): any
1201
- }
1202
-
1203
- class ValueRange {
1204
- static of(min: number, max: number): ValueRange
1205
- static of(min: number, maxSmallest: number, maxLargest: number): ValueRange
1206
- static of(minSmallest: number, minLargest: number, maxSmallest: number, maxLargest: number): ValueRange
1207
-
1208
- private constructor()
1209
-
1210
- checkValidIntValue(value: number, field: TemporalField): number
1211
-
1212
- checkValidValue(value: number, field: TemporalField): any
1213
-
1214
- equals(other: any): boolean
1215
-
1216
- hashCode(): number
1217
-
1218
- isFixed(): boolean
1219
-
1220
- isIntValue(): boolean
1221
-
1222
- isValidIntValue(value: number): boolean
1223
-
1224
- isValidValue(value: any): boolean
1225
-
1226
- largestMinimum(): number
1227
-
1228
- maximum(): number
1229
-
1230
- minimum(): number
1231
-
1232
- smallestMaximum(): number
1233
-
1234
- toString(): string
1235
- }
1236
-
1237
- class Year extends Temporal {
1238
- static MIN_VALUE: number;
1239
- static MAX_VALUE: number;
1240
-
1241
- static from(temporal: TemporalAccessor): Year
1242
- static isLeap(year: number): boolean
1243
- static now(zoneIdOrClock?: ZoneId | Clock): Year
1244
- static of(isoYear: number): Year
1245
- static parse(text: string, formatter?: DateTimeFormatter): Year
1246
-
1247
- private constructor()
1248
-
1249
- atDay(dayOfYear: number): LocalDate
1250
- atMonth(month: Month | number): YearMonth
1251
- atMonthDay(monthDay: MonthDay): LocalDate
1252
- compareTo(other: Year): number
1253
- equals(other: any): boolean
1254
- isAfter(other: Year): boolean
1255
- isBefore(other: Year): boolean
1256
- isLeap(): boolean
1257
- isValidMonthDay(monthDay: MonthDay): boolean
1258
- length(): number
1259
- plus(amount: TemporalAmount): Year
1260
- plus(amountToAdd: number, unit: TemporalUnit): Year
1261
- plusYears(yearsToAdd: number): Year
1262
- minus(amount: TemporalAmount): Year
1263
- minus(amountToSubtract: number, unit: TemporalUnit): Year
1264
- minusYears(yearsToSubtract: number): Year
1265
- value(): number
1266
- with(adjuster: TemporalAdjuster): Year
1267
- with(field: TemporalField, newValue: number): Year
1268
- }
1269
-
1270
- class YearMonth extends Temporal {
1271
- static from(temporal: TemporalAccessor): YearMonth
1272
-
1273
- static now(zoneIdOrClock?: ZoneId|Clock): YearMonth
1274
-
1275
- static of(year: number, monthOrNumber: Month|number): YearMonth
1276
-
1277
- static parse(text: string, formatter?: DateTimeFormatter): YearMonth
1278
-
1279
- private constructor()
1280
-
1281
- minus(amount: TemporalAmount): YearMonth
1282
- minus(amountToSubtract: number, unit: TemporalUnit): YearMonth
1283
- minusYears(yearsToSubtract: number): YearMonth
1284
- minusMonths(monthsToSubtract: number): YearMonth
1285
-
1286
- plus(amount: TemporalAmount): YearMonth
1287
- plus(amountToAdd: number, unit: TemporalUnit): YearMonth
1288
- plusYears(yearsToAdd: number): YearMonth
1289
- plusMonths(monthsToAdd: number): YearMonth
1290
-
1291
- with(adjuster: TemporalAdjuster): YearMonth
1292
- with(field: TemporalField, value: number): YearMonth
1293
- withYearMonth(newYear: number, newMonth: number): YearMonth
1294
- withYear(year: number): YearMonth
1295
- withMonth(month: number): YearMonth
1296
-
1297
- isSupported(fieldOrUnit: TemporalField|ChronoUnit): boolean
1298
-
1299
- year(): number
1300
-
1301
- monthValue(): number
1302
-
1303
- month(): Month
1304
-
1305
- isLeapYear(): boolean
1306
-
1307
- isValidDay(): boolean
1308
-
1309
- lengthOfMonth(): number
1310
-
1311
- lengthOfYear(): number
1312
-
1313
- atDay(dayOfMonth: number): LocalDate
1314
-
1315
- atEndOfMonth(): LocalDate
1316
-
1317
- compareTo(other: YearMonth): number
1318
-
1319
- isAfter(other: YearMonth): boolean
1320
-
1321
- isBefore(other: YearMonth): boolean
1322
-
1323
- equals(other: any): boolean
1324
-
1325
- toJSON(): string
1326
-
1327
- format(formatter: DateTimeFormatter): string
1328
- }
1329
-
1330
- abstract class ZoneId {
1331
- static SYSTEM: ZoneId
1332
- static UTC: ZoneId
1333
-
1334
- static systemDefault(): ZoneId
1335
- static of(zoneId: string): ZoneId
1336
- static ofOffset(prefix: string, offset: ZoneOffset): ZoneId
1337
- static from(temporal: TemporalAccessor): ZoneId
1338
-
1339
- static getAvailableZoneIds(): string[]
1340
-
1341
- equals(other: any): boolean
1342
-
1343
- hashCode(): number
1344
-
1345
- abstract id(): string
1346
-
1347
- normalized(): ZoneId
1348
-
1349
- abstract rules(): ZoneRules
1350
-
1351
- toString(): string
1352
- }
1353
-
1354
- class ZoneOffset extends ZoneId {
1355
- static MAX_SECONDS: ZoneOffset
1356
- static UTC: ZoneOffset
1357
- static MIN: ZoneOffset
1358
- static MAX: ZoneOffset
1359
-
1360
- static of(offsetId: string): ZoneOffset
1361
-
1362
- static ofHours(hours: number): ZoneOffset
1363
-
1364
- static ofHoursMinutes(hours: number, minutes: number): ZoneOffset
1365
-
1366
- static ofHoursMinutesSeconds(hours: number, minutes: number, seconds: number): ZoneOffset
1367
-
1368
- static ofTotalMinutes(totalMinutes: number): ZoneOffset
1369
-
1370
- static ofTotalSeconds(totalSeconds: number): ZoneOffset
1371
-
1372
- private constructor()
1373
-
1374
- adjustInto(temporal: Temporal): Temporal
1375
-
1376
- compareTo(other: ZoneOffset): number
1377
-
1378
- equals(other: any): boolean
1379
-
1380
- get(field: TemporalField): number
1381
-
1382
- getLong(field: TemporalField): number
1383
-
1384
- hashCode(): number
1385
-
1386
- id(): string
1387
-
1388
- query(query: TemporalQuery): any
1389
-
1390
- rules(): ZoneRules
1391
-
1392
- toString(): string
1393
-
1394
- totalSeconds(): number
1395
- }
1396
-
1397
- class ZoneRegion extends ZoneId {
1398
- static ofId(zoneId: string): ZoneId
1399
-
1400
- private constructor()
1401
-
1402
- id(): string
1403
-
1404
- rules(): ZoneRules
1405
- }
1406
-
1407
- class ZoneOffsetTransition {
1408
- static of(transition: LocalDateTime, offsetBefore: ZoneOffset, offsetAfter: ZoneOffset): ZoneOffsetTransition
1409
-
1410
- private constructor()
1411
-
1412
- instant(): Instant
1413
-
1414
- toEpochSecond(): number
1415
-
1416
- dateTimeBefore(): LocalDateTime
1417
-
1418
- dateTimeAfter(): LocalDateTime
1419
-
1420
- offsetBefore(): ZoneOffset
1421
-
1422
- offsetAfter(): ZoneOffset
1423
-
1424
- duration(): Duration
1425
-
1426
- durationSeconds(): number
1427
-
1428
- isGap(): boolean
1429
-
1430
- isOverlap(): boolean
1431
-
1432
- isValidOffset(offset: ZoneOffset): boolean
1433
-
1434
- validOffsets(): ZoneOffset[]
1435
-
1436
- compareTo(transition: ZoneOffsetTransition): number
1437
-
1438
- equals(other: any): boolean
1439
-
1440
- hashCode(): number
1441
-
1442
- toString(): string
1443
- }
1444
-
1445
- interface ZoneOffsetTransitionRule {
1446
- // TODO: Not implemented yet
1447
- }
1448
-
1449
- abstract class ZoneRules {
1450
- static of(offest: ZoneOffset): ZoneRules
1451
-
1452
- abstract isFixedOffset(): boolean
1453
-
1454
- offset(instantOrLocalDateTime: Instant|LocalDateTime): ZoneOffset
1455
-
1456
- toJSON(): string
1457
-
1458
- abstract offsetOfEpochMilli(epochMilli: number): ZoneOffset
1459
-
1460
- abstract offsetOfInstant(instant: Instant): ZoneOffset
1461
-
1462
- abstract offsetOfLocalDateTime(localDateTime: LocalDateTime): ZoneOffset
1463
-
1464
- abstract validOffsets(localDateTime: LocalDateTime): ZoneOffset[]
1465
-
1466
- abstract transition(localDateTime: LocalDateTime): ZoneOffsetTransition
1467
-
1468
- abstract standardOffset(instant: Instant): ZoneOffset
1469
-
1470
- abstract daylightSavings(instant: Instant): Duration
1471
-
1472
- abstract isDaylightSavings(instant: Instant): boolean
1473
-
1474
- abstract isValidOffset(localDateTime: LocalDateTime, offset: ZoneOffset): boolean
1475
-
1476
- abstract nextTransition(instant: Instant): ZoneOffsetTransition
1477
-
1478
- abstract previousTransition(instant: Instant): ZoneOffsetTransition
1479
-
1480
- abstract transitions(): ZoneOffsetTransition[]
1481
-
1482
- abstract transitionRules(): ZoneOffsetTransitionRule[]
1483
-
1484
- abstract toString(): string
1485
- }
1486
-
1487
- abstract class ChronoZonedDateTime extends Temporal {
1488
- compareTo(other: ChronoZonedDateTime): number
1489
-
1490
- equals(other: any): boolean
1491
-
1492
- format(formatter: DateTimeFormatter): string
1493
-
1494
- isAfter(other: ChronoZonedDateTime): boolean
1495
-
1496
- isBefore(other: ChronoZonedDateTime): boolean
1497
-
1498
- isEqual(other: ChronoZonedDateTime): boolean
1499
-
1500
- query(query: any): any
1501
-
1502
- toEpochSecond(): number
1503
-
1504
- toInstant(): Instant
1505
- }
1506
-
1507
- class ZonedDateTime extends ChronoZonedDateTime {
1508
- static from(temporal: TemporalAccessor): ZonedDateTime
1509
-
1510
- static now(clockOrZone?: Clock|ZoneId): ZonedDateTime
1511
-
1512
- static of(): any
1513
- static of(localDateTime: LocalDateTime, zone: ZoneId): ZonedDateTime
1514
- static of(date: LocalDate, time: LocalTime, zone: ZoneId): ZonedDateTime
1515
- static of(year: number, month: number, dayOfMonth: number, hour: number, minute: number, second: number, nanoOfSecond: number, zone: ZoneId): ZonedDateTime
1516
-
1517
- static ofInstant(): ZonedDateTime
1518
- static ofInstant(instant: Instant, zone: ZoneId): ZonedDateTime
1519
- static ofInstant(localDateTime: LocalDateTime, offset: ZoneOffset, zone: ZoneId): ZonedDateTime
1520
-
1521
- static ofLocal(localDateTime: LocalDateTime, zone: ZoneId, preferredOffset: ZoneOffset | null): ZonedDateTime
1522
-
1523
- static ofStrict(localDateTime: LocalDateTime, offset: ZoneOffset, zone: ZoneId): ZonedDateTime
1524
-
1525
- static parse(text: string, formatter?: DateTimeFormatter): ZonedDateTime
1526
-
1527
- private constructor()
1528
-
1529
- dayOfMonth(): number
1530
-
1531
- dayOfWeek(): DayOfWeek
1532
-
1533
- dayOfYear(): number
1534
-
1535
- equals(other: any): boolean
1536
-
1537
- format(formatter: DateTimeFormatter): string
1
+ // ----------------------------------------------------------------------------
2
+ // TEMPORAL
3
+ // ----------------------------------------------------------------------------
4
+
5
+ /**
6
+ * A field of date-time, such as month-of-year or hour-of-minute.
7
+ *
8
+ * Date and time is expressed using fields which partition the time-line into something meaningful
9
+ * for humans. Implementations of this interface represent those fields.
10
+ *
11
+ * The most commonly used units are defined in `ChronoField`. Further fields are supplied in
12
+ * `IsoFields`. Fields can also be written by application code by implementing this interface.
13
+ */
14
+ export abstract class TemporalField {
15
+ /** Checks if this field is supported by the temporal object. */
16
+ abstract isSupportedBy(temporal: TemporalAccessor): boolean;
17
+ /** Checks if this field represents a component of a date. */
18
+ abstract isDateBased(): boolean;
19
+ /** Checks if this field represents a component of a time. */
20
+ abstract isTimeBased(): boolean;
21
+ /** Gets the unit that the field is measured in. */
22
+ abstract baseUnit(): TemporalUnit;
23
+ /** Gets the range that the field is bound by. */
24
+ abstract rangeUnit(): TemporalUnit;
25
+ /** Gets the range of valid values for the field. */
26
+ abstract range(): ValueRange;
27
+ /**
28
+ * Get the range of valid values for this field using the temporal object to
29
+ * refine the result.
30
+ */
31
+ abstract rangeRefinedBy(temporal: TemporalAccessor): ValueRange;
32
+ /** Gets the value of this field from the specified temporal object. */
33
+ abstract getFrom(temporal: TemporalAccessor): number;
34
+ /** Returns a copy of the specified temporal object with the value of this field set. */
35
+ abstract adjustInto<R extends Temporal>(temporal: R, newValue: number): R;
36
+ abstract name(): string;
37
+ abstract displayName(/* TODO: locale */): string;
38
+ abstract equals(other: any): boolean;
39
+ }
1538
40
 
1539
- get(field: TemporalField): number
41
+ /**
42
+ * A unit of date-time, such as Days or Hours.
43
+ *
44
+ * Measurement of time is built on units, such as years, months, days, hours, minutes and seconds.
45
+ * Implementations of this interface represent those units.
46
+ *
47
+ * An instance of this interface represents the unit itself, rather than an amount of the unit.
48
+ * See `Period` for a class that represents an amount in terms of the common units.
49
+ *
50
+ * The most commonly used units are defined in `ChronoUnit`. Further units are supplied in
51
+ * `IsoFields`. Units can also be written by application code by implementing this interface.
52
+ */
53
+ export abstract class TemporalUnit {
54
+ /** Returns a copy of the specified temporal object with the specified period added. */
55
+ abstract addTo<T extends Temporal>(temporal: T, amount: number): T;
56
+ /**
57
+ * Calculates the period in terms of this unit between two temporal objects of the same type.
58
+ *
59
+ * Returns the period between temporal1 and temporal2 in terms of this unit; a positive number
60
+ * if `temporal2` is later than `temporal1`, negative if earlier.
61
+ */
62
+ abstract between(temporal1: Temporal, temporal2: Temporal): number;
63
+ /** Gets the duration of this unit, which may be an estimate. */
64
+ abstract duration(): Duration;
65
+ /** Checks if this unit is date-based. */
66
+ abstract isDateBased(): boolean;
67
+ /** Checks if the duration of the unit is an estimate. */
68
+ abstract isDurationEstimated(): boolean;
69
+ /** Checks if this unit is supported by the specified temporal object. */
70
+ abstract isSupportedBy(temporal: Temporal): boolean;
71
+ /** Checks if this unit is time-based. */
72
+ abstract isTimeBased(): boolean;
73
+ }
1540
74
 
1541
- getLong(field: TemporalField): number
75
+ /**
76
+ * The range of valid values for a date-time field.
77
+ *
78
+ * All TemporalField instances have a valid range of values. For example, the ISO day-of-month
79
+ * runs from 1 to somewhere between 28 and 31. This class captures that valid range.
80
+ *
81
+ * It is important to be aware of the limitations of this class. Only the minimum and maximum
82
+ * values are provided. It is possible for there to be invalid values within the outer range.
83
+ * For example, a weird field may have valid values of 1, 2, 4, 6, 7, thus have a range of '1 - 7',
84
+ * despite that fact that values 3 and 5 are invalid.
85
+ *
86
+ * Instances of this class are not tied to a specific field.
87
+ */
88
+ export class ValueRange {
89
+ static of(min: number, max: number): ValueRange;
90
+ static of(min: number, maxSmallest: number, maxLargest: number): ValueRange;
91
+ static of(minSmallest: number, minLargest: number, maxSmallest: number, maxLargest: number): ValueRange;
92
+
93
+ private constructor();
94
+
95
+ checkValidValue(value: number, field: TemporalField): number;
96
+ checkValidIntValue(value: number, field: TemporalField): number;
97
+ equals(other: any): boolean;
98
+ hashCode(): number;
99
+ isFixed(): boolean;
100
+ isIntValue(): boolean;
101
+ isValidIntValue(value: number): boolean;
102
+ isValidValue(value: number): boolean;
103
+ largestMinimum(): number;
104
+ maximum(): number;
105
+ minimum(): number;
106
+ smallestMaximum(): number;
107
+ toString(): string;
108
+ }
1542
109
 
1543
- hashCode(): number
110
+ /**
111
+ * Framework-level class defining an amount of time, such as "6 hours", "8 days" or
112
+ * "2 years and 3 months".
113
+ *
114
+ * This is the base class type for amounts of time. An amount is distinct from a date or
115
+ * time-of-day in that it is not tied to any specific point on the time-line.
116
+ *
117
+ * The amount can be thought of as a `Map` of `TemporalUnit` to `number`, exposed via
118
+ * `units()` and `get()`. A simple case might have a single unit-value pair, such
119
+ * as "6 hours". A more complex case may have multiple unit-value pairs, such as "7 years,
120
+ * 3 months and 5 days".
121
+ *
122
+ * There are two common implementations. `Period` is a date-based implementation,
123
+ * storing years, months and days. `Duration` is a time-based implementation, storing
124
+ * seconds and nanoseconds, but providing some access using other duration based units such
125
+ * as minutes, hours and fixed 24-hour days.
126
+ *
127
+ * This class is a framework-level class that should not be widely used in application code.
128
+ * Instead, applications should create and pass around instances of concrete types, such as
129
+ * `Period` and `Duration`.
130
+ */
131
+ export abstract class TemporalAmount {
132
+ /**
133
+ * This adds to the specified temporal object using the logic encapsulated in the
134
+ * implementing class.
135
+ *
136
+ * There are two equivalent ways of using this method. The first is to invoke this method
137
+ * directly. The second is to use `Temporal.plus(TemporalAmount)`:
138
+ *
139
+ * ```
140
+ * // these two lines are equivalent, but the second approach is recommended
141
+ * dateTime = amount.addTo(dateTime);
142
+ * dateTime = dateTime.plus(amount);
143
+ * ```
144
+ *
145
+ * It is recommended to use the second approach, `plus(TemporalAmount)`, as it is a lot
146
+ * clearer to read in code.
147
+ */
148
+ abstract addTo<T extends Temporal>(temporal: T): T;
149
+ /** Gets the amount associated with the specified unit. */
150
+ abstract get(unit: TemporalUnit): number;
151
+ /** Gets the list of units, from largest to smallest, that fully define this amount. */
152
+ abstract units(): TemporalUnit[];
153
+ /**
154
+ * This substract to the specified temporal object using the logic encapsulated in the
155
+ * implementing class.
156
+ *
157
+ * There are two equivalent ways of using this method. The first is to invoke this method
158
+ * directly. The second is to use `Temporal.minus(TemporalAmount)`:
159
+ * ```
160
+ * // these two lines are equivalent, but the second approach is recommended
161
+ * dateTime = amount.substractFrom(dateTime);
162
+ * dateTime = dateTime.minus(amount);
163
+ * ```
164
+ *
165
+ * It is recommended to use the second approach, `minus(TemporalAmount)`, as it is a lot
166
+ * clearer to read in code.
167
+ */
168
+ abstract subtractFrom<T extends Temporal>(temporal: T): T;
169
+ }
1544
170
 
1545
- hour(): number
171
+ /**
172
+ * Framework-level interface defining read-only access to a temporal object, such as a date, time,
173
+ * offset or some combination of these.
174
+ *
175
+ * This is the base interface type for date, time and offset objects. It is implemented by those
176
+ * classes that can provide information as fields or queries.
177
+ *
178
+ * Most date and time information can be represented as a number. These are modeled using
179
+ * `TemporalField` with the number held using a long to handle large values. Year, month and
180
+ * day-of-month are simple examples of fields, but they also include instant and offsets. See
181
+ * `ChronoField` for the standard set of fields.
182
+ *
183
+ * Two pieces of date/time information cannot be represented by numbers, the chronology and the
184
+ * time-zone. These can be accessed via queries using the static methods defined on
185
+ * `TemporalQueries`.
186
+ *
187
+ * A sub-interface, `Temporal`, extends this definition to one that also supports adjustment and
188
+ * manipulation on more complete temporal objects.
189
+ *
190
+ * This interface is a framework-level interface that should not be widely used in application code.
191
+ * Instead, applications should create and pass around instances of concrete types, such as
192
+ * `LocalDate`. There are many reasons for this, part of which is that implementations of this
193
+ * interface may be in calendar systems other than ISO. See `ChronoLocalDate` for a fuller
194
+ * discussion of the issues.
195
+ */
196
+ export abstract class TemporalAccessor {
197
+ /**
198
+ * Gets the value of the specified field as an integer number.
199
+ *
200
+ * This queries the date-time for the value for the specified field. The returned value will
201
+ * always be within the valid range of values for the field. If the date-time cannot return
202
+ * the value, because the field is unsupported or for some other reason, an exception will
203
+ * be thrown.
204
+ */
205
+ get(field: TemporalField): number;
206
+ /**
207
+ * Queries this date-time.
208
+ *
209
+ * This queries this date-time using the specified query strategy object.
210
+ *
211
+ * Queries are a key tool for extracting information from date-times. They exists to
212
+ * externalize the process of querying, permitting different approaches, as per the strategy
213
+ * design pattern. Examples might be a query that checks if the date is the day before
214
+ * February 29th in a leap year, or calculates the number of days to your next birthday.
215
+ *
216
+ * The most common query implementations are method references, such as `LocalDate::FROM` and
217
+ * `ZoneId::FROM`. Further implementations are on `TemporalQueries`. Queries may also be
218
+ * defined by applications.
219
+ */
220
+ query<R>(query: TemporalQuery<R>): R | null;
221
+ /**
222
+ * Gets the range of valid values for the specified field.
223
+ *
224
+ * All fields can be expressed as an integer number. This method returns an object that
225
+ * describes the valid range for that value. The value of this temporal object is used to
226
+ * enhance the accuracy of the returned range. If the date-time cannot return the range,
227
+ * because the field is unsupported or for some other reason, an exception will be thrown.
228
+ *
229
+ * Note that the result only describes the minimum and maximum valid values and it is
230
+ * important not to read too much into them. For example, there could be values within the
231
+ * range that are invalid for the field.
232
+ */
233
+ range(field: TemporalField): ValueRange;
234
+ abstract getLong(field: TemporalField): number;
235
+ /**
236
+ * Checks if the specified field is supported.
237
+ *
238
+ * This checks if the date-time can be queried for the specified field. If false, then
239
+ * calling the `range` and `get` methods will throw an exception.
240
+ */
241
+ abstract isSupported(field: TemporalField): boolean;
242
+ }
1546
243
 
1547
- isSupported(fieldOrUnit: TemporalField|TemporalUnit): boolean
244
+ /**
245
+ * Framework-level interface defining read-write access to a temporal object, such as a date, time,
246
+ * offset or some combination of these.
247
+ *
248
+ * This is the base interface type for date, time and offset objects that are complete enough to be
249
+ * manipulated using plus and minus. It is implemented by those classes that can provide and
250
+ * manipulate information as fields or queries. See `TemporalAccessor` for the read-only version of
251
+ * this interface.
252
+ *
253
+ * Most date and time information can be represented as a number. These are modeled using
254
+ * `TemporalField` with the number held using a long to handle large values. Year, month and
255
+ * day-of-month are simple examples of fields, but they also include instant and offsets. See
256
+ * `ChronoField` for the standard set of fields.
257
+ *
258
+ * Two pieces of date/time information cannot be represented by numbers, the chronology and the
259
+ * time-zone. These can be accessed via queries using the static methods defined on
260
+ * `TemporalQueries`.
261
+ *
262
+ * This interface is a framework-level interface that should not be widely used in application code.
263
+ * Instead, applications should create and pass around instances of concrete types, such as
264
+ * `LocalDate`. There are many reasons for this, part of which is that implementations of this
265
+ * interface may be in calendar systems other than ISO. See `ChronoLocalDate` for a fuller
266
+ * discussion of the issues.
267
+ */
268
+ export abstract class Temporal extends TemporalAccessor {
269
+ abstract isSupported(field: TemporalField): boolean;
270
+ /**
271
+ * Checks if the specified unit is supported.
272
+ *
273
+ * This checks if the date-time can be queried for the specified unit. If false, then calling
274
+ * the plus and minus methods will throw an exception.
275
+ */
276
+ abstract isSupported(unit: TemporalUnit): boolean;
277
+ abstract minus(amountToSubtract: number, unit: TemporalUnit): Temporal;
278
+ /**
279
+ * Returns an object of the same type as this object with an amount subtracted.
280
+ *
281
+ * This adjusts this temporal, subtracting according to the rules of the specified amount.
282
+ * The amount is typically a `Period` but may be any other type implementing `TemporalAmount`,
283
+ * such as `Duration`.
284
+ *
285
+ * Some example code indicating how and why this method is used:
286
+ * ```
287
+ * date = date.minus(period); // subtract a Period instance
288
+ * date = date.minus(duration); // subtract a Duration instance
289
+ * date = date.minus(workingDays(6)); // example user-written workingDays method
290
+ * ```
291
+ *
292
+ * Note that calling plus followed by minus is not guaranteed to return the same date-time.
293
+ */
294
+ abstract minus(amount: TemporalAmount): Temporal;
295
+ abstract plus(amountToAdd: number, unit: TemporalUnit): Temporal;
296
+ /**
297
+ * Returns an object of the same type as this object with an amount added.
298
+ *
299
+ * This adjusts this temporal, adding according to the rules of the specified amount. The
300
+ * amount is typically a `Period` but may be any other type implementing `TemporalAmount`,
301
+ * such as `Duration`.
302
+ *
303
+ * Some example code indicating how and why this method is used:
304
+ * ```
305
+ * date = date.plus(period); // add a Period instance
306
+ * date = date.plus(duration); // add a Duration instance
307
+ * date = date.plus(workingDays(6)); // example user-written workingDays method
308
+ * ```
309
+ *
310
+ * Note that calling plus followed by minus is not guaranteed to return the same date-time.
311
+ */
312
+ abstract plus(amount: TemporalAmount): Temporal;
313
+ /**
314
+ * Calculates the period between this temporal and another temporal in terms of the
315
+ * specified unit.
316
+ *
317
+ * This calculates the period between two temporals in terms of a single unit. The start
318
+ * and end points are this and the specified temporal. The result will be negative if the
319
+ * end is before the start. For example, the period in hours between two temporal objects
320
+ * can be calculated using `startTime.until(endTime, HOURS)`.
321
+ *
322
+ * The calculation returns a whole number, representing the number of complete units between
323
+ * the two temporals. For example, the period in hours between the times 11:30 and 13:29 will
324
+ * only be one hour as it is one minute short of two hours.
325
+ *
326
+ * There are two equivalent ways of using this method. The first is to invoke this method
327
+ * directly. The second is to use `TemporalUnit.between(Temporal, Temporal)`:
328
+ * ```
329
+ * // these two lines are equivalent
330
+ * between = thisUnit.between(start, end);
331
+ * between = start.until(end, thisUnit);
332
+ * ```
333
+ *
334
+ * The choice should be made based on which makes the code more readable.
335
+ *
336
+ * For example, this method allows the number of days between two dates to be calculated:
337
+ * ```
338
+ * const daysBetween = DAYS.between(start, end);
339
+ * // or alternatively
340
+ * const daysBetween = start.until(end, DAYS);
341
+ * ```
342
+ */
343
+ abstract until(endTemporal: Temporal, unit: TemporalUnit): number;
344
+ /**
345
+ * Returns an adjusted object of the same type as this object with the adjustment made.
346
+ *
347
+ * This adjusts this date-time according to the rules of the specified adjuster. A simple
348
+ * adjuster might simply set the one of the fields, such as the year field. A more complex
349
+ * adjuster might set the date to the last day of the month. A selection of common adjustments
350
+ * is provided in `TemporalAdjusters`. These include finding the "last day of the month" and
351
+ * "next Wednesday". The adjuster is responsible for handling special cases, such as the
352
+ * varying lengths of month and leap years.
353
+ *
354
+ * Some example code indicating how and why this method is used:
355
+ * ```
356
+ * date = date.with(Month.JULY); // most key classes implement TemporalAdjuster
357
+ * date = date.with(lastDayOfMonth()); // static import from TemporalAdjusters
358
+ * date = date.with(next(WEDNESDAY)); // static import from TemporalAdjusters and DayOfWeek
359
+ * ```
360
+ */
361
+ abstract with(adjuster: TemporalAdjuster): Temporal;
362
+ /**
363
+ * Returns an object of the same type as this object with the specified field altered.
364
+ *
365
+ * This returns a new object based on this one with the value for the specified field changed.
366
+ * For example, on a `LocalDate`, this could be used to set the year, month or day-of-month.
367
+ * The returned object will have the same observable type as this object.
368
+ *
369
+ * In some cases, changing a field is not fully defined. For example, if the target object is
370
+ * a date representing the 31st January, then changing the month to February would be unclear.
371
+ * In cases like this, the field is responsible for resolving the result. Typically it will
372
+ * choose the previous valid date, which would be the last valid day of February in this
373
+ * example.
374
+ */
375
+ abstract with(field: TemporalField, newValue: number): Temporal;
376
+ }
1548
377
 
1549
- minus(): any
1550
- minus(amountToSubtract: number, unit: TemporalUnit): ZonedDateTime
378
+ /**
379
+ * Strategy for adjusting a temporal object.
380
+ *
381
+ * Adjusters are a key tool for modifying temporal objects. They exist to externalize the process
382
+ * of adjustment, permitting different approaches, as per the strategy design pattern. Examples
383
+ * might be an adjuster that sets the date avoiding weekends, or one that sets the date to the
384
+ * last day of the month.
385
+ *
386
+ * There are two equivalent ways of using a `TemporalAdjuster`. The first is to invoke the method
387
+ * on this interface directly. The second is to use `Temporal.with(TemporalAdjuster)`:
388
+ *
389
+ * ```
390
+ * // these two lines are equivalent, but the second approach is recommended
391
+ * temporal = thisAdjuster.adjustInto(temporal);
392
+ * temporal = temporal.with(thisAdjuster);
393
+ * ```
394
+ *
395
+ * It is recommended to use the second approach, `with(TemporalAdjuster)`, as it is a lot clearer
396
+ * to read in code.
397
+ *
398
+ * See `TemporalAdjusters` for a standard set of adjusters, including finding the last day of
399
+ * the month. Adjusters may also be defined by applications.
400
+ */
401
+ export abstract class TemporalAdjuster {
402
+ abstract adjustInto(temporal: Temporal): Temporal;
403
+ }
1551
404
 
1552
- minusDays(days: number): ZonedDateTime
405
+ export abstract class TemporalQuery<R> {
406
+ abstract queryFrom(temporal: TemporalAccessor): R;
407
+ }
1553
408
 
1554
- minusHours(hours: number): ZonedDateTime
409
+ /**
410
+ A standard set of fields.
411
+ *
412
+ * This set of fields provide field-based access to manipulate a date, time or date-time.
413
+ * The standard set of fields can be extended by implementing {@link TemporalField}.
414
+ */
415
+ export class ChronoField extends TemporalField {
416
+ /**
417
+ * This represents concept of the count of
418
+ * days within the period of a week where the weeks are aligned to the start of the month.
419
+ * This field is typically used with `ALIGNED_WEEK_OF_MONTH`.
420
+ */
421
+ static ALIGNED_DAY_OF_WEEK_IN_MONTH: ChronoField;
422
+ /**
423
+ * This represents concept of the count of days
424
+ * within the period of a week where the weeks are aligned to the start of the year.
425
+ * This field is typically used with `ALIGNED_WEEK_OF_YEAR`.
426
+ */
427
+ static ALIGNED_DAY_OF_WEEK_IN_YEAR: ChronoField;
428
+ /**
429
+ * This represents concept of the count of weeks within
430
+ * the period of a month where the weeks are aligned to the start of the month. This field
431
+ * is typically used with `ALIGNED_DAY_OF_WEEK_IN_MONTH`.
432
+ */
433
+ static ALIGNED_WEEK_OF_MONTH: ChronoField;
434
+ /**
435
+ * his represents concept of the count of weeks within
436
+ * the period of a year where the weeks are aligned to the start of the year. This field
437
+ * is typically used with `ALIGNED_DAY_OF_WEEK_IN_YEAR`.
438
+ */
439
+ static ALIGNED_WEEK_OF_YEAR: ChronoField;
440
+ /**
441
+ * This counts the AM/PM within the day, from 0 (AM) to 1 (PM).
442
+ */
443
+ static AMPM_OF_DAY: ChronoField;
444
+ /**
445
+ * This counts the hour within the AM/PM, from 1 to 12.
446
+ * This is the hour that would be observed on a standard 12-hour analog wall clock.
447
+ */
448
+ static CLOCK_HOUR_OF_AMPM: ChronoField;
449
+ /**
450
+ * This counts the hour within the AM/PM, from 1 to 24.
451
+ * This is the hour that would be observed on a 24-hour analog wall clock.
452
+ */
453
+ static CLOCK_HOUR_OF_DAY: ChronoField;
454
+ /**
455
+ * This represents the concept of the day within the month.
456
+ * In the default ISO calendar system, this has values from 1 to 31 in most months.
457
+ * April, June, September, November have days from 1 to 30, while February has days from
458
+ * 1 to 28, or 29 in a leap year.
459
+ */
460
+ static DAY_OF_MONTH: ChronoField;
461
+ /**
462
+ * This represents the standard concept of the day of the week.
463
+ * In the default ISO calendar system, this has values from Monday (1) to Sunday (7).
464
+ * The {@link DayOfWeek} class can be used to interpret the result.
465
+ */
466
+ static DAY_OF_WEEK: ChronoField;
467
+ /**
468
+ * This represents the concept of the day within the year.
469
+ * In the default ISO calendar system, this has values from 1 to 365 in standard years and
470
+ * 1 to 366 in leap years.
471
+ */
472
+ static DAY_OF_YEAR: ChronoField;
473
+ /**
474
+ * This field is the sequential count of days where
475
+ * 1970-01-01 (ISO) is zero. Note that this uses the local time-line, ignoring offset and
476
+ * time-zone.
477
+ */
478
+ static EPOCH_DAY: ChronoField;
479
+ /**
480
+ * This represents the concept of the era, which is the largest
481
+ * division of the time-line. This field is typically used with `YEAR_OF_ERA`.
482
+ *
483
+ * In the default ISO calendar system, there are two eras defined, 'BCE' and 'CE'. The era
484
+ * 'CE' is the one currently in use and year-of-era runs from 1 to the maximum value.
485
+ * The era 'BCE' is the previous era, and the year-of-era runs backwards.
486
+ */
487
+ static ERA: ChronoField;
488
+ /**
489
+ * This counts the hour within the AM/PM, from 0 to 11.
490
+ * This is the hour that would be observed on a standard 12-hour digital clock.
491
+ */
492
+ static HOUR_OF_AMPM: ChronoField;
493
+ /**
494
+ * This counts the hour within the day, from 0 to 23. This is
495
+ * the hour that would be observed on a standard 24-hour digital clock.
496
+ */
497
+ static HOUR_OF_DAY: ChronoField;
498
+ /**
499
+ * This represents the concept of the sequential count of
500
+ * seconds where `1970-01-01T00:00Z` (ISO) is zero. This field may be used with `NANO_OF_DAY`
501
+ * to represent the fraction of the day.
502
+ *
503
+ * An Instant represents an instantaneous point on the time-line. On their own they have
504
+ * no elements which allow a local date-time to be obtained. Only when paired with an offset
505
+ * or time-zone can the local date or time be found. This field allows the seconds part of
506
+ * the instant to be queried.
507
+ */
508
+ static INSTANT_SECONDS: ChronoField;
509
+ /**
510
+ * This counts the microsecond within the day, from `0` to
511
+ * `(24 * 60 * 60 * 1_000_000) - 1`.
512
+ *
513
+ * This field is used to represent the micro-of-day handling any fraction of the second.
514
+ * Implementations of {@link TemporalAccessor} should provide a value for this field if they
515
+ * can return a value for `SECOND_OF_DAY` filling unknown precision with zero.
516
+ *
517
+ * When this field is used for setting a value, it should behave in the same way as
518
+ * setting `NANO_OF_DAY` with the value multiplied by 1,000.
519
+ */
520
+ static MICRO_OF_DAY: ChronoField;
521
+ /**
522
+ * This counts the microsecond within the second, from 0 to 999,999.
523
+ *
524
+ * This field is used to represent the micro-of-second handling any fraction of the second.
525
+ * Implementations of {@link TemporalAccessor} should provide a value for this field if they
526
+ * can return a value for `SECOND_OF_MINUTE`, `SECOND_OF_DAY` or `INSTANT_SECONDS` filling
527
+ * unknown precision with zero.
528
+ */
529
+ static MICRO_OF_SECOND: ChronoField;
530
+ /**
531
+ * This counts the millisecond within the day, from 0 to
532
+ * `(24 * 60 * 60 * 1,000) - 1`.
533
+ *
534
+ * This field is used to represent the milli-of-day handling any fraction of the second.
535
+ * Implementations of {@link TemporalAccessor} should provide a value for this field if they
536
+ * can return a value for `SECOND_OF_DAY` filling unknown precision with zero.
537
+ *
538
+ * When this field is used for setting a value, it should behave in the same way as
539
+ * setting `NANO_OF_DAY` with the value multiplied by 1,000,000.
540
+ */
541
+ static MILLI_OF_DAY: ChronoField;
542
+ /**
543
+ * This counts the millisecond within the second, from 0 to
544
+ * 999.
545
+ *
546
+ * This field is used to represent the milli-of-second handling any fraction of the second.
547
+ * Implementations of {@link TemporalAccessor} should provide a value for this field if they can
548
+ * return a value for `SECOND_OF_MINUTE`, `SECOND_OF_DAY` or `INSTANT_SECONDS` filling unknown
549
+ * precision with zero.
550
+ *
551
+ * When this field is used for setting a value, it should behave in the same way as
552
+ * setting `NANO_OF_SECOND` with the value multiplied by 1,000,000.
553
+ */
554
+ static MILLI_OF_SECOND: ChronoField;
555
+ /**
556
+ * This counts the minute within the day, from 0 to `(24 * 60) - 1`.
557
+ */
558
+ static MINUTE_OF_DAY: ChronoField;
559
+ /**
560
+ * This counts the minute within the hour, from 0 to 59.
561
+ */
562
+ static MINUTE_OF_HOUR: ChronoField;
563
+ /**
564
+ * The month-of-year, such as March. This represents the concept
565
+ * of the month within the year. In the default ISO calendar system, this has values from
566
+ * January (1) to December (12).
567
+ */
568
+ static MONTH_OF_YEAR: ChronoField;
569
+ /**
570
+ * This counts the nanosecond within the day, from 0 to
571
+ * `(24 * 60 * 60 * 1,000,000,000) - 1`.
572
+ *
573
+ * This field is used to represent the nano-of-day handling any fraction of the second.
574
+ * Implementations of {@link TemporalAccessor} should provide a value for this field if they
575
+ * can return a value for `SECOND_OF_DAY` filling unknown precision with zero.
576
+ */
577
+ static NANO_OF_DAY: ChronoField;
578
+ /**
579
+ * This counts the nanosecond within the second, from 0
580
+ * to 999,999,999.
581
+ *
582
+ * This field is used to represent the nano-of-second handling any fraction of the second.
583
+ * Implementations of {@link TemporalAccessor} should provide a value for this field if they
584
+ * can return a value for `SECOND_OF_MINUTE`, `SECOND_OF_DAY` or `INSTANT_SECONDS` filling
585
+ * unknown precision with zero.
586
+ *
587
+ * When this field is used for setting a value, it should set as much precision as the
588
+ * object stores, using integer division to remove excess precision. For example, if the
589
+ * {@link TemporalAccessor} stores time to millisecond precision, then the nano-of-second must
590
+ * be divided by 1,000,000 before replacing the milli-of-second.
591
+ */
592
+ static NANO_OF_SECOND: ChronoField;
593
+ /**
594
+ * This represents the concept of the offset in seconds of
595
+ * local time from UTC/Greenwich.
596
+ *
597
+ * A {@link ZoneOffset} represents the period of time that local time differs from
598
+ * UTC/Greenwich. This is usually a fixed number of hours and minutes. It is equivalent to
599
+ * the total amount of the offset in seconds. For example, during the winter Paris has an
600
+ * offset of +01:00, which is 3600 seconds.
601
+ */
602
+ static OFFSET_SECONDS: ChronoField;
603
+ /**
604
+ * The proleptic-month, which counts months sequentially
605
+ * from year 0.
606
+ *
607
+ * The first month in year zero has the value zero. The value increase for later months
608
+ * and decrease for earlier ones. Note that this uses the local time-line, ignoring offset
609
+ * and time-zone.
610
+ */
611
+ static PROLEPTIC_MONTH: ChronoField;
612
+ /**
613
+ * This counts the second within the day, from 0 to
614
+ * (24 * 60 * 60) - 1.
615
+ */
616
+ static SECOND_OF_DAY: ChronoField;
617
+ /**
618
+ * This counts the second within the minute, from 0 to 59.
619
+ */
620
+ static SECOND_OF_MINUTE: ChronoField;
621
+ /**
622
+ * The proleptic year, such as 2012. This represents the concept of
623
+ * the year, counting sequentially and using negative numbers. The proleptic year is not
624
+ * interpreted in terms of the era.
625
+ *
626
+ * The standard mental model for a date is based on three concepts - year, month and day.
627
+ * These map onto the `YEAR`, `MONTH_OF_YEAR` and `DAY_OF_MONTH` fields. Note that there is no
628
+ * reference to eras. The full model for a date requires four concepts - era, year, month and
629
+ * day. These map onto the `ERA`, `YEAR_OF_ERA`, `MONTH_OF_YEAR` and `DAY_OF_MONTH` fields.
630
+ * Whether this field or `YEAR_OF_ERA` is used depends on which mental model is being used.
631
+ */
632
+ static YEAR: ChronoField;
633
+ /**
634
+ * This represents the concept of the year within the era. This
635
+ * field is typically used with `ERA`. The standard mental model for a date is based on three
636
+ * concepts - year, month and day. These map onto the `YEAR`, `MONTH_OF_YEAR` and
637
+ * `DAY_OF_MONTH` fields. Note that there is no reference to eras. The full model for a date
638
+ * requires four concepts - era, year, month and day. These map onto the `ERA`, `YEAR_OF_ERA`,
639
+ * `MONTH_OF_YEAR` and `DAY_OF_MONTH` fields. Whether this field or `YEAR` is used depends on
640
+ * which mental model is being used.
641
+ *
642
+ * In the default ISO calendar system, there are two eras defined, 'BCE' and 'CE'.
643
+ * The era 'CE' is the one currently in use and year-of-era runs from 1 to the maximum value.
644
+ * The era 'BCE' is the previous era, and the year-of-era runs backwards.
645
+ *
646
+ * For example, subtracting a year each time yield the following:
647
+ * - year-proleptic 2 = 'CE' year-of-era 2
648
+ * - year-proleptic 1 = 'CE' year-of-era 1
649
+ * - year-proleptic 0 = 'BCE' year-of-era 1
650
+ * - year-proleptic -1 = 'BCE' year-of-era 2
651
+ *
652
+ * Note that the ISO-8601 standard does not actually define eras. Note also that the
653
+ * ISO eras do not align with the well-known AD/BC eras due to the change between the Julian
654
+ * and Gregorian calendar systems.
655
+ */
656
+ static YEAR_OF_ERA: ChronoField;
657
+
658
+ private constructor();
659
+
660
+ isSupportedBy(temporal: TemporalAccessor): boolean;
661
+ baseUnit(): TemporalUnit;
662
+ /** Checks that the specified value is valid for this field. */
663
+ checkValidValue(value: number): number;
664
+ /**
665
+ * Checks that the specified value is valid for this field and
666
+ * is within the range of a safe integer.
667
+ */
668
+ checkValidIntValue(value: number): number;
669
+ displayName(): string;
670
+ equals(other: any): boolean;
671
+ getFrom(temporal: TemporalAccessor): number;
672
+ isDateBased(): boolean;
673
+ isTimeBased(): boolean;
674
+ name(): string;
675
+ range(): ValueRange;
676
+ rangeRefinedBy(temporal: TemporalAccessor): ValueRange;
677
+ rangeUnit(): TemporalUnit;
678
+ adjustInto<R extends Temporal>(temporal: R, newValue: number): R;
679
+ toString(): string;
680
+ }
1555
681
 
1556
- minusMinutes(minutes: number): ZonedDateTime
682
+ /**
683
+ * A standard set of date periods units.
684
+ *
685
+ * This set of units provide unit-based access to manipulate a date, time or date-time.
686
+ * The standard set of units can be extended by implementing TemporalUnit.
687
+ */
688
+ export class ChronoUnit extends TemporalUnit {
689
+ /**
690
+ * Unit that represents the concept of a nanosecond, the smallest supported unit
691
+ * of time. For the ISO calendar system, it is equal to the 1,000,000,000th part of the second unit.
692
+ */
693
+ static NANOS: ChronoUnit;
694
+ /**
695
+ * Unit that represents the concept of a microsecond. For the ISO calendar
696
+ * system, it is equal to the 1,000,000th part of the second unit.
697
+ */
698
+ static MICROS: ChronoUnit;
699
+ /**
700
+ * Unit that represents the concept of a millisecond. For the ISO calendar
701
+ * system, it is equal to the 1000th part of the second unit.
702
+ */
703
+ static MILLIS: ChronoUnit;
704
+ /**
705
+ * Unit that represents the concept of a second. For the ISO calendar system,
706
+ * it is equal to the second in the SI system of units, except around a leap-second.
707
+ */
708
+ static SECONDS: ChronoUnit;
709
+ /**
710
+ * Unit that represents the concept of a minute. For the ISO calendar system,
711
+ * it is equal to 60 seconds.
712
+ */
713
+ static MINUTES: ChronoUnit;
714
+ /**
715
+ * Unit that represents the concept of an hour. For the ISO calendar system,
716
+ * it is equal to 60 minutes.
717
+ */
718
+ static HOURS: ChronoUnit;
719
+ /**
720
+ * Unit that represents the concept of half a day, as used in AM/PM. For
721
+ * the ISO calendar system, it is equal to 12 hours.
722
+ */
723
+ static HALF_DAYS: ChronoUnit;
724
+ /**
725
+ * Unit that represents the concept of a day. For the ISO calendar system, it
726
+ * is the standard day from midnight to midnight. The estimated duration of a day is 24 Hours.
727
+ */
728
+ static DAYS: ChronoUnit;
729
+ /**
730
+ * Unit that represents the concept of a week. For the ISO calendar system,
731
+ * it is equal to 7 Days.
732
+ */
733
+ static WEEKS: ChronoUnit;
734
+ /**
735
+ * Unit that represents the concept of a month. For the ISO calendar system,
736
+ * the length of the month varies by month-of-year. The estimated duration of a month is
737
+ * one twelfth of 365.2425 Days.
738
+ */
739
+ static MONTHS: ChronoUnit;
740
+ /**
741
+ * Unit that represents the concept of a year. For the ISO calendar system, it
742
+ * is equal to 12 months. The estimated duration of a year is 365.2425 Days.
743
+ */
744
+ static YEARS: ChronoUnit;
745
+ /**
746
+ * Unit that represents the concept of a decade. For the ISO calendar system,
747
+ * it is equal to 10 years.
748
+ */
749
+ static DECADES: ChronoUnit;
750
+ /**
751
+ * Unit that represents the concept of a century. For the ISO calendar
752
+ * system, it is equal to 100 years.
753
+ */
754
+ static CENTURIES: ChronoUnit;
755
+ /**
756
+ * Unit that represents the concept of a millennium. For the ISO calendar
757
+ * system, it is equal to 1,000 years.
758
+ */
759
+ static MILLENNIA: ChronoUnit;
760
+ /**
761
+ * Unit that represents the concept of an era. The ISO calendar system doesn't
762
+ * have eras thus it is impossible to add an era to a date or date-time. The estimated duration
763
+ * of the era is artificially defined as 1,000,000,000 Years.
764
+ */
765
+ static ERAS: ChronoUnit;
766
+ /**
767
+ * Artificial unit that represents the concept of forever. This is primarily
768
+ * used with {@link TemporalField} to represent unbounded fields such as the year or era. The
769
+ * estimated duration of the era is artificially defined as the largest duration supported by
770
+ * {@link Duration}.
771
+ */
772
+ static FOREVER: ChronoUnit;
773
+
774
+ private constructor();
775
+
776
+ addTo<T extends Temporal>(temporal: T, amount: number): T;
777
+ between(temporal1: Temporal, temporal2: Temporal): number;
778
+ /**
779
+ * Compares this ChronoUnit to the specified {@link TemporalUnit}.
780
+ * The comparison is based on the total length of the durations.
781
+ */
782
+ compareTo(other: TemporalUnit): number;
783
+ duration(): Duration;
784
+ isDateBased(): boolean;
785
+ isDurationEstimated(): boolean;
786
+ isSupportedBy(temporal: Temporal): boolean;
787
+ isTimeBased(): boolean;
788
+ toString(): string;
789
+ }
1557
790
 
1558
- minusMonths(months: number): ZonedDateTime
791
+ /**
792
+ * Fields and units specific to the ISO-8601 calendar system,
793
+ * including quarter-of-year and week-based-year.
794
+ */
795
+ export namespace IsoFields {
796
+ /**
797
+ * This field allows the day-of-quarter value to be queried and set. The day-of-quarter has
798
+ * values from 1 to 90 in Q1 of a standard year, from 1 to 91 in Q1 of a leap year, from
799
+ * 1 to 91 in Q2 and from 1 to 92 in Q3 and Q4.
800
+ *
801
+ * The day-of-quarter can only be calculated if the day-of-year, month-of-year and year are available.
802
+ *
803
+ * When setting this field, the value is allowed to be partially lenient, taking any value from
804
+ * 1 to 92. If the quarter has less than 92 days, then day 92, and potentially day 91, is in
805
+ * the following quarter.
806
+ */
807
+ export const DAY_OF_QUARTER: TemporalField;
808
+ /**
809
+ * This field allows the quarter-of-year value to be queried and set. The quarter-of-year has
810
+ * values from 1 to 4.
811
+ *
812
+ * The day-of-quarter can only be calculated if the month-of-year is available.
813
+ */
814
+ export const QUARTER_OF_YEAR: TemporalField;
815
+ /**
816
+ * The field that represents the week-of-week-based-year.
817
+ */
818
+ export const WEEK_OF_WEEK_BASED_YEAR: TemporalField;
819
+ /**
820
+ * The field that represents the week-based-year.
821
+ */
822
+ export const WEEK_BASED_YEAR: TemporalField;
823
+ /**
824
+ * The unit that represents week-based-years for the purpose of addition and subtraction.
825
+ *
826
+ * This allows a number of week-based-years to be added to, or subtracted from, a date.
827
+ * The unit is equal to either 52 or 53 weeks. The estimated duration of a week-based-year is
828
+ * the same as that of a standard ISO year at 365.2425 Days.
829
+ *
830
+ * The rules for addition add the number of week-based-years to the existing value for the
831
+ * week-based-year field. If the resulting week-based-year only has 52 weeks, then the date
832
+ * will be in week 1 of the following week-based-year.
833
+ */
834
+ export const WEEK_BASED_YEARS: TemporalUnit;
835
+ /**
836
+ * Unit that represents the concept of a quarter-year. For the ISO calendar system, it is equal
837
+ * to 3 months. The estimated duration of a quarter-year is one quarter of 365.2425 days.
838
+ */
839
+ export const QUARTER_YEARS: TemporalUnit;
840
+ }
1559
841
 
1560
- minusNanos(nanos: number): ZonedDateTime
842
+ export namespace TemporalAdjusters {
843
+ /**
844
+ * Returns the day-of-week in month adjuster, which returns a new date in the same month with
845
+ * the ordinal day-of-week. This is used for expressions like the 'second Tuesday in March'.
846
+ *
847
+ * The ISO calendar system behaves as follows:
848
+ * - The input 2011-12-15 for (1,TUESDAY) will return 2011-12-06.
849
+ * - The input 2011-12-15 for (2,TUESDAY) will return 2011-12-13.
850
+ * - The input 2011-12-15 for (3,TUESDAY) will return 2011-12-20.
851
+ * - The input 2011-12-15 for (4,TUESDAY) will return 2011-12-27.
852
+ * - The input 2011-12-15 for (5,TUESDAY) will return 2012-01-03.
853
+ * - The input 2011-12-15 for (-1,TUESDAY) will return 2011-12-27 (last in month).
854
+ * - The input 2011-12-15 for (-4,TUESDAY) will return 2011-12-06 (3 weeks before last in month).
855
+ * - The input 2011-12-15 for (-5,TUESDAY) will return 2011-11-29 (4 weeks before last in month).
856
+ * - The input 2011-12-15 for (0,TUESDAY) will return 2011-11-29 (last in previous month).
857
+ *
858
+ * For a positive or zero ordinal, the algorithm is equivalent to finding the first day-of-week
859
+ * that matches within the month and then adding a number of weeks to it. For a negative
860
+ * ordinal, the algorithm is equivalent to finding the last day-of-week that matches within the
861
+ * month and then subtracting a number of weeks to it. The ordinal number of weeks is not
862
+ * validated and is interpreted leniently according to this algorithm. This definition means
863
+ * that an ordinal of zero finds the last matching day-of-week in the previous month.
864
+ *
865
+ * The behavior is suitable for use with most calendar systems. It uses the `DAY_OF_WEEK`
866
+ * and `DAY_OF_MONTH` fields and the `DAYS` unit, and assumes a seven day week.
867
+ */
868
+ function dayOfWeekInMonth(ordinal: number, dayOfWeek: DayOfWeek): TemporalAdjuster;
869
+ /**
870
+ * Returns the "first day of month" adjuster, which returns a new date set to the first day
871
+ * of the current month.
872
+ *
873
+ * The ISO calendar system behaves as follows:
874
+ * - The input 2011-01-15 will return 2011-01-01.
875
+ * - The input 2011-02-15 will return 2011-02-01.
876
+ *
877
+ * The behavior is suitable for use with most calendar systems. It is equivalent to:
878
+ * ```
879
+ * temporal.with(DAY_OF_MONTH, 1);
880
+ * ```
881
+ */
882
+ function firstDayOfMonth(): TemporalAdjuster;
883
+ /**
884
+ * Returns the "first day of next month" adjuster, which returns a new date set to the first
885
+ * day of the next month.
886
+ *
887
+ * The ISO calendar system behaves as follows:
888
+ * - The input 2011-01-15 will return 2011-02-01.
889
+ * - The input 2011-02-15 will return 2011-03-01.
890
+ *
891
+ * The behavior is suitable for use with most calendar systems. It is equivalent to:
892
+ * ```
893
+ * temporal.with(DAY_OF_MONTH, 1).plus(1, MONTHS);
894
+ * ```
895
+ */
896
+ function firstDayOfNextMonth(): TemporalAdjuster;
897
+ /**
898
+ * Returns the "first day of next year" adjuster, which returns a new date set to the first
899
+ * day of the next year.
900
+ *
901
+ * The ISO calendar system behaves as follows:
902
+ * - The input 2011-01-15 will return 2012-01-01.
903
+ *
904
+ * The behavior is suitable for use with most calendar systems. It is equivalent to:
905
+ * ```
906
+ * temporal.with(DAY_OF_YEAR, 1).plus(1, YEARS);
907
+ * ```
908
+ */
909
+ function firstDayOfNextYear(): TemporalAdjuster;
910
+ /**
911
+ * Returns the "first day of year" adjuster, which returns a new date set to the first day
912
+ * of the current year.
913
+ *
914
+ * The ISO calendar system behaves as follows:
915
+ * - The input 2011-01-15 will return 2011-01-01.
916
+ * - The input 2011-02-15 will return 2011-01-01.
917
+ *
918
+ * The behavior is suitable for use with most calendar systems. It is equivalent to:
919
+ * ```
920
+ * temporal.with(DAY_OF_YEAR, 1);
921
+ * ```
922
+ */
923
+ function firstDayOfYear(): TemporalAdjuster;
924
+ /**
925
+ * Returns the first in month adjuster, which returns a new date in the same month with the
926
+ * first matching day-of-week. This is used for expressions like 'first Tuesday in March'.
927
+ *
928
+ * The ISO calendar system behaves as follows:
929
+ * - The input 2011-12-15 for (MONDAY) will return 2011-12-05.
930
+ * - The input 2011-12-15 for (FRIDAY) will return 2011-12-02.
931
+ *
932
+ * The behavior is suitable for use with most calendar systems. It uses the `DAY_OF_WEEK`
933
+ * and `DAY_OF_MONTH` fields and the `DAYS` unit, and assumes a seven day week.
934
+ */
935
+ function firstInMonth(dayOfWeek: DayOfWeek): TemporalAdjuster;
936
+ /**
937
+ * Returns the "last day of month" adjuster, which returns a new date set to the last day of
938
+ * the current month.
939
+ *
940
+ * The ISO calendar system behaves as follows:
941
+ * - The input 2011-01-15 will return 2011-01-31.
942
+ * - The input 2011-02-15 will return 2011-02-28.
943
+ * - The input 2012-02-15 will return 2012-02-29 (leap year).
944
+ * - The input 2011-04-15 will return 2011-04-30.
945
+ *
946
+ * The behavior is suitable for use with most calendar systems. It is equivalent to:
947
+ * ```
948
+ * const lastDay = temporal.range(DAY_OF_MONTH).getMaximum();
949
+ * temporal.with(DAY_OF_MONTH, lastDay);
950
+ * ```
951
+ */
952
+ function lastDayOfMonth(): TemporalAdjuster;
953
+ /**
954
+ * Returns the "last day of year" adjuster, which returns a new date set to the last day of
955
+ * the current year.
956
+ *
957
+ * The ISO calendar system behaves as follows:
958
+ * - The input 2011-01-15 will return 2011-12-31.
959
+ * - The input 2011-02-15 will return 2011-12-31.
960
+ *
961
+ * The behavior is suitable for use with most calendar systems. It is equivalent to:
962
+ * ```
963
+ * const lastDay = temporal.range(DAY_OF_YEAR).getMaximum();
964
+ * temporal.with(DAY_OF_YEAR, lastDay);
965
+ * ```
966
+ */
967
+ function lastDayOfYear(): TemporalAdjuster;
968
+ /**
969
+ * Returns the last in month adjuster, which returns a new date in the same month with the
970
+ * last matching day-of-week. This is used for expressions like 'last Tuesday in March'.
971
+ *
972
+ * The ISO calendar system behaves as follows:
973
+ * - The input 2011-12-15 for (MONDAY) will return 2011-12-26.
974
+ * - The input 2011-12-15 for (FRIDAY) will return 2011-12-30.
975
+ *
976
+ * The behavior is suitable for use with most calendar systems. It uses the `DAY_OF_WEEK`
977
+ * and `DAY_OF_MONTH` fields and the `DAYS` unit, and assumes a seven day week.
978
+ */
979
+ function lastInMonth(dayOfWeek: DayOfWeek): TemporalAdjuster;
980
+ /**
981
+ * Returns the next day-of-week adjuster, which adjusts the date to the first occurrence of
982
+ * the specified day-of-week after the date being adjusted.
983
+ *
984
+ * - The ISO calendar system behaves as follows:
985
+ * - The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-17 (two
986
+ * days later).
987
+ * - The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-19 (four
988
+ * days later).
989
+ * - The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-22 (seven
990
+ * days later).
991
+ *
992
+ * The behavior is suitable for use with most calendar systems. It uses the `DAY_OF_WEEK`
993
+ * field and the `DAYS` unit, and assumes a seven day week.
994
+ */
995
+ function next(dayOfWeek: DayOfWeek): TemporalAdjuster;
996
+ /**
997
+ * Returns the next-or-same day-of-week adjuster, which adjusts the date to the first
998
+ * occurrence of the specified day-of-week after the date being adjusted unless it is already
999
+ * on that day in which case the same object is returned.
1000
+ *
1001
+ * The ISO calendar system behaves as follows:
1002
+ * - The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-17 (two
1003
+ * days later).
1004
+ * - The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-19 (four
1005
+ * days later).
1006
+ * - The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-15 (same
1007
+ * as input).
1008
+ *
1009
+ * The behavior is suitable for use with most calendar systems. It uses the `DAY_OF_WEEK`
1010
+ * field and the `DAYS` unit, and assumes a seven day week.
1011
+ */
1012
+ function nextOrSame(dayOfWeek: DayOfWeek): TemporalAdjuster;
1013
+ /**
1014
+ * Returns the previous day-of-week adjuster, which adjusts the date to the first occurrence
1015
+ * of the specified day-of-week before the date being adjusted.
1016
+ *
1017
+ * The ISO calendar system behaves as follows:
1018
+ * - The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-10 (five
1019
+ * days earlier).
1020
+ * - The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-12 (three
1021
+ * days earlier).
1022
+ * - The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-08 (seven
1023
+ * days earlier).
1024
+ *
1025
+ * The behavior is suitable for use with most calendar systems. It uses the `DAY_OF_WEEK` field
1026
+ * and the `DAYS` unit, and assumes a seven day week.
1027
+ */
1028
+ function previous(dayOfWeek: DayOfWeek): TemporalAdjuster;
1029
+ /**
1030
+ * Returns the previous-or-same day-of-week adjuster, which adjusts the date to the first
1031
+ * occurrence of the specified day-of-week before the date being adjusted unless it is already
1032
+ * on that day in which case the same object is returned.
1033
+ *
1034
+ * The ISO calendar system behaves as follows:
1035
+ * - The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-10 (five
1036
+ * days earlier).
1037
+ * - The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-12 (three
1038
+ * days earlier).
1039
+ * - The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-15 (same
1040
+ * as input).
1041
+ *
1042
+ * The behavior is suitable for use with most calendar systems. It uses the `DAY_OF_WEEK`
1043
+ * field and the `DAYS` unit, and assumes a seven day week.
1044
+ */
1045
+ function previousOrSame(dayOfWeek: DayOfWeek): TemporalAdjuster;
1046
+ }
1561
1047
 
1562
- minusSeconds(seconds: number): ZonedDateTime
1048
+ export namespace TemporalQueries {
1049
+ function chronology(): TemporalQuery<Chronology | null>;
1050
+ function localDate(): TemporalQuery<LocalDate | null>;
1051
+ function localTime(): TemporalQuery<LocalTime | null>;
1052
+ function offset(): TemporalQuery<ZoneOffset | null>;
1053
+ function precision(): TemporalQuery<TemporalUnit | null>;
1054
+ function zone(): TemporalQuery<ZoneId | null>;
1055
+ function zoneId(): TemporalQuery<ZoneId | null>;
1056
+ }
1563
1057
 
1564
- minusTemporalAmount(amount: TemporalAmount): ZonedDateTime
1058
+ // ----------------------------------------------------------------------------
1059
+ // MAIN
1060
+ // ----------------------------------------------------------------------------
1061
+
1062
+ export abstract class Clock {
1063
+ static fixed(fixedInstant: Instant, zoneId: ZoneId): Clock;
1064
+ static offset(baseClock: Clock, offsetDuration: Duration): Clock;
1065
+ static system(zone: ZoneId): Clock;
1066
+ static systemDefaultZone(): Clock;
1067
+ static systemUTC(): Clock;
1068
+
1069
+ abstract equals(other: any): boolean;
1070
+ abstract instant(): Instant;
1071
+ abstract millis(): number;
1072
+ abstract withZone(zone: ZoneId): Clock;
1073
+ abstract zone(): ZoneId;
1074
+ }
1565
1075
 
1566
- minusWeeks(weeks: number): ZonedDateTime
1076
+ export class Duration extends TemporalAmount {
1077
+ static ZERO: Duration;
1078
+
1079
+ static between(startInclusive: Temporal, endExclusive: Temporal): Duration;
1080
+ static from(amount: TemporalAmount): Duration;
1081
+ static of(amount: number, unit: TemporalUnit): Duration;
1082
+ static ofDays(days: number): Duration;
1083
+ static ofHours(hours: number): Duration;
1084
+ static ofMillis(millis: number): Duration;
1085
+ static ofMinutes(minutes: number): Duration;
1086
+ static ofNanos(nanos: number): Duration;
1087
+ static ofSeconds(seconds: number, nanoAdjustment?: number): Duration;
1088
+ static parse(text: string): Duration;
1089
+
1090
+ private constructor();
1091
+
1092
+ abs(): Duration;
1093
+ addTo<T extends Temporal>(temporal: T): T;
1094
+ compareTo(otherDuration: Duration): number;
1095
+ dividedBy(divisor: number): Duration;
1096
+ equals(other: any): boolean;
1097
+ get(unit: TemporalUnit): number;
1098
+ isNegative(): boolean;
1099
+ isZero(): boolean;
1100
+ minus(amount: number, unit: TemporalUnit): Duration;
1101
+ minus(duration: Duration): Duration;
1102
+ minusDays(daysToSubtract: number): Duration;
1103
+ minusHours(hoursToSubtract: number): Duration;
1104
+ minusMillis(millisToSubtract: number): Duration;
1105
+ minusMinutes(minutesToSubtract: number): Duration;
1106
+ minusNanos(nanosToSubtract: number): Duration;
1107
+ minusSeconds(secondsToSubtract: number): Duration;
1108
+ multipliedBy(multiplicand: number): Duration;
1109
+ nano(): number;
1110
+ negated(): Duration;
1111
+ plus(amount: number, unit: TemporalUnit): Duration;
1112
+ plus(duration: Duration): Duration;
1113
+ plusDays(daysToAdd: number): Duration;
1114
+ plusHours(hoursToAdd: number): Duration;
1115
+ plusMillis(millisToAdd: number): Duration;
1116
+ plusMinutes(minutesToAdd: number): Duration;
1117
+ plusNanos(nanosToAdd: number): Duration;
1118
+ plusSeconds(secondsToAdd: number): Duration;
1119
+ plusSecondsNanos(secondsToAdd: number, nanosToAdd: number): Duration;
1120
+ seconds(): number;
1121
+ subtractFrom<T extends Temporal>(temporal: T): T;
1122
+ toDays(): number;
1123
+ toHours(): number;
1124
+ toJSON(): string;
1125
+ toMillis(): number;
1126
+ toMinutes(): number;
1127
+ toNanos(): number;
1128
+ toString(): string;
1129
+ units(): TemporalUnit[];
1130
+ withNanos(nanoOfSecond: number): Duration;
1131
+ withSeconds(seconds: number): Duration;
1132
+ }
1567
1133
 
1568
- minusYears(years: number): ZonedDateTime
1134
+ export class Instant extends Temporal implements TemporalAdjuster {
1135
+ static EPOCH: Instant;
1136
+ static MIN: Instant;
1137
+ static MAX: Instant;
1138
+ static MIN_SECONDS: Instant;
1139
+ static MAX_SECONDS: Instant;
1140
+
1141
+ static FROM: TemporalQuery<Instant>;
1142
+
1143
+ static from(temporal: TemporalAccessor): Instant;
1144
+ static now(clock?: Clock): Instant;
1145
+ static ofEpochMilli(epochMilli: number): Instant;
1146
+ static ofEpochSecond(epochSecond: number, nanoAdjustment?: number): Instant;
1147
+ static parse(text: string): Instant;
1148
+
1149
+ private constructor();
1150
+
1151
+ adjustInto(temporal: Temporal): Temporal;
1152
+ atZone(zone: ZoneId): ZonedDateTime;
1153
+ compareTo(otherInstant: Instant): number;
1154
+ epochSecond(): number;
1155
+ equals(other: any): boolean;
1156
+ getLong(field: TemporalField): number;
1157
+ hashCode(): number;
1158
+ isAfter(otherInstant: Instant): boolean;
1159
+ isBefore(otherInstant: Instant): boolean;
1160
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1161
+ minus(amount: TemporalAmount): Instant;
1162
+ minus(amountToSubtract: number, unit: TemporalUnit): Instant;
1163
+ minusMillis(millisToSubtract: number): Instant;
1164
+ minusNanos(nanosToSubtract: number): Instant;
1165
+ minusSeconds(secondsToSubtract: number): Instant;
1166
+ nano(): number;
1167
+ plus(amount: TemporalAmount): Instant;
1168
+ plus(amountToAdd: number, unit: TemporalUnit): Instant;
1169
+ plusMillis(millisToAdd: number): Instant;
1170
+ plusNanos(nanosToAdd: number): Instant;
1171
+ plusSeconds(secondsToAdd: number): Instant;
1172
+ toEpochMilli(): number;
1173
+ toJSON(): string;
1174
+ toString(): string;
1175
+ truncatedTo(unit: TemporalUnit): Instant;
1176
+ until(endExclusive: Temporal, unit: TemporalUnit): number;
1177
+ with(adjuster: TemporalAdjuster): Instant;
1178
+ with(field: TemporalField, newValue: number): Instant;
1179
+ }
1569
1180
 
1570
- minute(): number
1181
+ export class LocalDate extends ChronoLocalDate implements TemporalAdjuster {
1182
+ static MIN: LocalDate;
1183
+ static MAX: LocalDate;
1184
+ static EPOCH_0: LocalDate;
1185
+
1186
+ static FROM: TemporalQuery<LocalDate>;
1187
+
1188
+ static from(temporal: TemporalAccessor): LocalDate;
1189
+ static now(clockOrZone?: Clock | ZoneId): LocalDate;
1190
+ static of(year: number, month: Month | number, dayOfMonth: number): LocalDate;
1191
+ static ofEpochDay(epochDay: number): LocalDate;
1192
+ static ofInstant(instant: Instant, zoneId?: ZoneId): LocalDate;
1193
+ static ofYearDay(year: number, dayOfYear: number): LocalDate;
1194
+ static parse(text: string, formatter?: DateTimeFormatter): LocalDate;
1195
+
1196
+ private constructor();
1197
+
1198
+ atStartOfDay(): LocalDateTime;
1199
+ atStartOfDay(zone: ZoneId): ZonedDateTime;
1200
+ atTime(hour: number, minute: number, second?: number, nanoOfSecond?: number): LocalDateTime;
1201
+ atTime(time: LocalTime): LocalDateTime;
1202
+ chronology(): Chronology;
1203
+ compareTo(other: LocalDate): number;
1204
+ dayOfMonth(): number;
1205
+ dayOfWeek(): DayOfWeek;
1206
+ dayOfYear(): number;
1207
+ equals(other: any): boolean;
1208
+ getLong(field: TemporalField): number;
1209
+ hashCode(): number;
1210
+ isAfter(other: LocalDate): boolean;
1211
+ isBefore(other: LocalDate): boolean;
1212
+ isEqual(other: LocalDate): boolean;
1213
+ isLeapYear(): boolean;
1214
+ isoWeekOfWeekyear(): number;
1215
+ isoWeekyear(): number;
1216
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1217
+ lengthOfMonth(): number;
1218
+ lengthOfYear(): number;
1219
+ minus(amount: TemporalAmount): LocalDate;
1220
+ minus(amountToSubtract: number, unit: TemporalUnit): LocalDate;
1221
+ minusDays(daysToSubtract: number): LocalDate;
1222
+ minusMonths(monthsToSubtract: number): LocalDate;
1223
+ minusWeeks(weeksToSubtract: number): LocalDate;
1224
+ minusYears(yearsToSubtract: number): LocalDate;
1225
+ month(): Month;
1226
+ monthValue(): number;
1227
+ plus(amount: TemporalAmount): LocalDate;
1228
+ plus(amountToAdd: number, unit: TemporalUnit): LocalDate;
1229
+ plusDays(daysToAdd: number): LocalDate;
1230
+ plusMonths(monthsToAdd: number): LocalDate;
1231
+ plusWeeks(weeksToAdd: number): LocalDate;
1232
+ plusYears(yearsToAdd: number): LocalDate;
1233
+ toEpochDay(): number;
1234
+ toJSON(): string;
1235
+ toString(): string;
1236
+ until(endDate: TemporalAccessor): Period;
1237
+ until(endExclusive: Temporal, unit: TemporalUnit): number;
1238
+ with(adjuster: TemporalAdjuster): LocalDate;
1239
+ with(field: TemporalField, newValue: number): LocalDate;
1240
+ withDayOfMonth(dayOfMonth: number): LocalDate;
1241
+ withDayOfYear(dayOfYear: number): LocalDate;
1242
+ withMonth(month: Month | number): LocalDate;
1243
+ withYear(year: number): LocalDate;
1244
+ year(): number;
1245
+ }
1571
1246
 
1572
- month(): Month
1247
+ export class LocalDateTime extends ChronoLocalDateTime implements TemporalAdjuster {
1248
+ static MIN: LocalDateTime;
1249
+ static MAX: LocalDateTime;
1250
+
1251
+ static FROM: TemporalQuery<LocalDateTime>;
1252
+
1253
+ static from(temporal: TemporalAccessor): LocalDateTime;
1254
+ static now(clockOrZone?: Clock | ZoneId): LocalDateTime;
1255
+ static of(date: LocalDate, time: LocalTime): LocalDateTime;
1256
+ static of(year: number, month: Month | number, dayOfMonth: number, hour?: number, minute?: number, second?: number, nanoSecond?: number): LocalDateTime;
1257
+ static ofEpochSecond(epochSecond: number, nanoOfSecond: number, offset: ZoneOffset): LocalDateTime;
1258
+ static ofEpochSecond(epochSecond: number, offset: ZoneOffset): LocalDateTime;
1259
+ static ofInstant(instant: Instant, zoneId?: ZoneId): LocalDateTime;
1260
+ static parse(text: string, formatter?: DateTimeFormatter): LocalDateTime;
1261
+
1262
+ private constructor();
1263
+
1264
+ atOffset(offset: ZoneOffset): OffsetDateTime;
1265
+ atZone(zone: ZoneId): ZonedDateTime;
1266
+ compareTo(other: LocalDateTime): number;
1267
+ dayOfMonth(): number;
1268
+ dayOfWeek(): DayOfWeek;
1269
+ dayOfYear(): number;
1270
+ equals(other: any): boolean;
1271
+ format(formatter: DateTimeFormatter): string;
1272
+ getLong(field: TemporalField): number;
1273
+ hashCode(): number;
1274
+ hour(): number;
1275
+ isAfter(other: LocalDateTime): boolean;
1276
+ isBefore(other: LocalDateTime): boolean;
1277
+ isEqual(other: LocalDateTime): boolean;
1278
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1279
+ minus(amount: TemporalAmount): LocalDateTime;
1280
+ minus(amountToSubtract: number, unit: TemporalUnit): LocalDateTime;
1281
+ minusDays(days: number): LocalDateTime;
1282
+ minusHours(hours: number): LocalDateTime;
1283
+ minusMinutes(minutes: number): LocalDateTime;
1284
+ minusMonths(months: number): LocalDateTime;
1285
+ minusNanos(nanos: number): LocalDateTime;
1286
+ minusSeconds(seconds: number): LocalDateTime;
1287
+ minusWeeks(weeks: number): LocalDateTime;
1288
+ minusYears(years: number): LocalDateTime;
1289
+ minute(): number;
1290
+ month(): Month;
1291
+ monthValue(): number;
1292
+ nano(): number;
1293
+ plus(amount: TemporalAmount): LocalDateTime;
1294
+ plus(amountToAdd: number, unit: TemporalUnit): LocalDateTime;
1295
+ plusDays(days: number): LocalDateTime;
1296
+ plusHours(hours: number): LocalDateTime;
1297
+ plusMinutes(minutes: number): LocalDateTime;
1298
+ plusMonths(months: number): LocalDateTime;
1299
+ plusNanos(nanos: number): LocalDateTime;
1300
+ plusSeconds(seconds: number): LocalDateTime;
1301
+ plusWeeks(weeks: number): LocalDateTime;
1302
+ plusYears(years: number): LocalDateTime;
1303
+ second(): number;
1304
+ toJSON(): string;
1305
+ toLocalDate(): LocalDate;
1306
+ toLocalTime(): LocalTime;
1307
+ toString(): string;
1308
+ truncatedTo(unit: TemporalUnit): LocalDateTime;
1309
+ until(endExclusive: Temporal, unit: TemporalUnit): number;
1310
+ with(adjuster: TemporalAdjuster): LocalDateTime;
1311
+ with(field: TemporalField, newValue: number): LocalDateTime;
1312
+ withDayOfMonth(dayOfMonth: number): LocalDateTime;
1313
+ withDayOfYear(dayOfYear: number): LocalDateTime;
1314
+ withHour(hour: number): LocalDateTime;
1315
+ withMinute(minute: number): LocalDateTime;
1316
+ withMonth(month: number | Month): LocalDateTime;
1317
+ withNano(nanoOfSecond: number): LocalDateTime;
1318
+ withSecond(second: number): LocalDateTime;
1319
+ withYear(year: number): LocalDateTime;
1320
+ year(): number;
1321
+ }
1573
1322
 
1574
- monthValue(): number
1323
+ export class LocalTime extends Temporal implements TemporalAdjuster {
1324
+ static MIN: LocalTime;
1325
+ static MAX: LocalTime;
1326
+ static MIDNIGHT: LocalTime;
1327
+ static NOON: LocalTime;
1328
+ static HOURS_PER_DAY: number;
1329
+ static MINUTES_PER_HOUR: number;
1330
+ static MINUTES_PER_DAY: number;
1331
+ static SECONDS_PER_MINUTE: number;
1332
+ static SECONDS_PER_HOUR: number;
1333
+ static SECONDS_PER_DAY: number;
1334
+ static MILLIS_PER_DAY: number;
1335
+ static MICROS_PER_DAY: number;
1336
+ static NANOS_PER_SECOND: number;
1337
+ static NANOS_PER_MINUTE: number;
1338
+ static NANOS_PER_HOUR: number;
1339
+ static NANOS_PER_DAY: number;
1340
+
1341
+ static FROM: TemporalQuery<LocalTime>;
1342
+
1343
+ static from(temporal: TemporalAccessor): LocalTime;
1344
+ static now(clockOrZone?: Clock | ZoneId): LocalTime;
1345
+ static of(hour?: number, minute?: number, second?: number, nanoOfSecond?: number): LocalTime;
1346
+ static ofInstant(instant: Instant, zone?: ZoneId): LocalTime;
1347
+ static ofNanoOfDay(nanoOfDay: number): LocalTime;
1348
+ static ofSecondOfDay(secondOfDay?: number, nanoOfSecond?: number): LocalTime;
1349
+ static parse(text: String, formatter?: DateTimeFormatter): LocalTime;
1350
+
1351
+ private constructor();
1352
+
1353
+ adjustInto(temporal: Temporal): Temporal;
1354
+ atDate(date: LocalDate): LocalDateTime;
1355
+ compareTo(other: LocalTime): number;
1356
+ equals(other: any): boolean;
1357
+ format(formatter: DateTimeFormatter): string;
1358
+ getLong(field: ChronoField): number;
1359
+ hashCode(): number;
1360
+ hour(): number;
1361
+ isAfter(other: LocalTime): boolean;
1362
+ isBefore(other: LocalTime): boolean;
1363
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1364
+ minus(amount: TemporalAmount): LocalTime;
1365
+ minus(amountToSubtract: number, unit: TemporalUnit): LocalTime;
1366
+ minusHours(hoursToSubtract: number): LocalTime;
1367
+ minusMinutes(minutesToSubtract: number): LocalTime;
1368
+ minusNanos(nanosToSubtract: number): LocalTime;
1369
+ minusSeconds(secondsToSubtract: number): LocalTime;
1370
+ minute(): number;
1371
+ nano(): number;
1372
+ plus(amount: TemporalAmount): LocalTime;
1373
+ plus(amountToAdd: number, unit: TemporalUnit): LocalTime;
1374
+ plusHours(hoursToAdd: number): LocalTime;
1375
+ plusMinutes(minutesToAdd: number): LocalTime;
1376
+ plusNanos(nanosToAdd: number): LocalTime;
1377
+ plusSeconds(secondstoAdd: number): LocalTime;
1378
+ second(): number;
1379
+ toJSON(): string;
1380
+ toNanoOfDay(): number;
1381
+ toSecondOfDay(): number;
1382
+ toString(): string;
1383
+ toString(): string;
1384
+ truncatedTo(unit: ChronoUnit): LocalTime;
1385
+ until(endExclusive: Temporal, unit: TemporalUnit): number;
1386
+ with(adjuster: TemporalAdjuster): LocalTime;
1387
+ with(field: TemporalField, newValue: number): LocalTime;
1388
+ withHour(hour: number): LocalTime;
1389
+ withMinute(minute: number): LocalTime;
1390
+ withNano(nanoOfSecond: number): LocalTime;
1391
+ withSecond(second: number): LocalTime;
1392
+ }
1575
1393
 
1576
- nano(): number
1394
+ export class MonthDay extends TemporalAccessor implements TemporalAdjuster {
1395
+ static FROM: TemporalQuery<MonthDay>;
1396
+
1397
+ static from(temporal: TemporalAccessor): MonthDay;
1398
+ static now(zoneIdOrClock?: ZoneId | Clock): MonthDay;
1399
+ static of(month: Month | number, dayOfMonth: number): MonthDay;
1400
+ static parse(text: string, formatter?: DateTimeFormatter): MonthDay;
1401
+
1402
+ private constructor();
1403
+
1404
+ adjustInto(temporal: Temporal): Temporal;
1405
+ atYear(year: number): LocalDate;
1406
+ compareTo(other: MonthDay): number;
1407
+ dayOfMonth(): number;
1408
+ equals(other: any): boolean;
1409
+ format(formatter: DateTimeFormatter): string;
1410
+ getLong(field: TemporalField): number;
1411
+ isAfter(other: MonthDay): boolean;
1412
+ isBefore(other: MonthDay): boolean;
1413
+ isSupported(field: TemporalField): boolean;
1414
+ isValidYear(year: number): boolean;
1415
+ month(): Month;
1416
+ monthValue(): number;
1417
+ toJSON(): string;
1418
+ toString(): string;
1419
+ with(month: Month): MonthDay;
1420
+ withDayOfMonth(dayOfMonth: number): MonthDay;
1421
+ withMonth(month: number): MonthDay;
1422
+ }
1577
1423
 
1578
- offset(): any
1424
+ export class Period extends TemporalAmount {
1425
+ static ZERO: Period;
1426
+
1427
+ static between(startDate: LocalDate, endDate: LocalDate): Period;
1428
+ static from(amount: TemporalAmount): Period;
1429
+ static of(years: number, months: number, days: number): Period;
1430
+ static ofDays(days: number): Period;
1431
+ static ofMonths(months: number): Period;
1432
+ static ofWeeks(weeks: number): Period;
1433
+ static ofYears(years: number): Period;
1434
+ static parse(text: string): Period;
1435
+
1436
+ private constructor();
1437
+
1438
+ addTo<T extends Temporal>(temporal: T): T;
1439
+ chronology(): IsoChronology;
1440
+ days(): number;
1441
+ equals(other: any): boolean;
1442
+ get(unit: TemporalUnit): number;
1443
+ hashCode(): number;
1444
+ isNegative(): boolean;
1445
+ isZero(): boolean;
1446
+ minus(amountToSubtract: TemporalAmount): Period;
1447
+ minusDays(daysToSubtract: number): Period;
1448
+ minusMonths(monthsToSubtract: number): Period;
1449
+ minusYears(yearsToSubtract: number): Period;
1450
+ months(): number;
1451
+ multipliedBy(scalar: number): Period;
1452
+ negated(): Period;
1453
+ normalized(): Period;
1454
+ plus(amountToAdd: TemporalAmount): Period;
1455
+ plusDays(daysToAdd: number): Period;
1456
+ plusMonths(monthsToAdd: number): Period;
1457
+ plusYears(yearsToAdd: number): Period;
1458
+ subtractFrom<T extends Temporal>(temporal: T): T;
1459
+ toJSON(): string;
1460
+ toString(): string;
1461
+ toTotalMonths(): number;
1462
+ units(): TemporalUnit[];
1463
+ withDays(days: number): Period;
1464
+ withMonths(months: number): Period;
1465
+ withYears(years: number): Period;
1466
+ years(): number;
1467
+ }
1579
1468
 
1580
- plus(): any
1581
- plus(amountToAdd: number, unit: TemporalUnit): ZonedDateTime
1469
+ export class Year extends Temporal implements TemporalAdjuster {
1470
+ static MIN_VALUE: number;
1471
+ static MAX_VALUE: number;
1472
+
1473
+ static FROM: TemporalQuery<Year>;
1474
+
1475
+ static from(temporal: TemporalAccessor): Year;
1476
+ static isLeap(year: number): boolean;
1477
+ static now(zoneIdOrClock?: ZoneId | Clock): Year;
1478
+ static of(isoYear: number): Year;
1479
+ static parse(text: string, formatter?: DateTimeFormatter): Year;
1480
+
1481
+ private constructor();
1482
+
1483
+ adjustInto(temporal: Temporal): Temporal;
1484
+ atDay(dayOfYear: number): LocalDate;
1485
+ atMonth(month: Month | number): YearMonth;
1486
+ atMonthDay(monthDay: MonthDay): LocalDate;
1487
+ compareTo(other: Year): number;
1488
+ equals(other: any): boolean;
1489
+ getLong(field: TemporalField): number;
1490
+ isAfter(other: Year): boolean;
1491
+ isBefore(other: Year): boolean;
1492
+ isLeap(): boolean;
1493
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1494
+ isValidMonthDay(monthDay: MonthDay): boolean;
1495
+ length(): number;
1496
+ minus(amount: TemporalAmount): Year;
1497
+ minus(amountToSubtract: number, unit: TemporalUnit): Year;
1498
+ minusYears(yearsToSubtract: number): Year;
1499
+ plus(amount: TemporalAmount): Year;
1500
+ plus(amountToAdd: number, unit: TemporalUnit): Year;
1501
+ plusYears(yearsToAdd: number): Year;
1502
+ toJSON(): string;
1503
+ toString(): string;
1504
+ until(endExclusive: Temporal, unit: TemporalUnit): number;
1505
+ value(): number;
1506
+ with(adjuster: TemporalAdjuster): Year;
1507
+ with(field: TemporalField, newValue: number): Year;
1508
+ }
1582
1509
 
1583
- plusDays(days: number): any
1510
+ export class YearMonth extends Temporal implements TemporalAdjuster {
1511
+ static FROM: TemporalQuery<YearMonth>;
1512
+
1513
+ static from(temporal: TemporalAccessor): YearMonth;
1514
+ static now(zoneIdOrClock?: ZoneId | Clock): YearMonth;
1515
+ static of(year: number, monthOrNumber: Month | number): YearMonth;
1516
+ static parse(text: string, formatter?: DateTimeFormatter): YearMonth;
1517
+
1518
+ private constructor();
1519
+
1520
+ adjustInto(temporal: Temporal): Temporal;
1521
+ atDay(dayOfMonth: number): LocalDate;
1522
+ atEndOfMonth(): LocalDate;
1523
+ compareTo(other: YearMonth): number;
1524
+ equals(other: any): boolean;
1525
+ format(formatter: DateTimeFormatter): string;
1526
+ getLong(field: TemporalField): number;
1527
+ isAfter(other: YearMonth): boolean;
1528
+ isBefore(other: YearMonth): boolean;
1529
+ isLeapYear(): boolean;
1530
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1531
+ isValidDay(): boolean;
1532
+ lengthOfMonth(): number;
1533
+ lengthOfYear(): number;
1534
+ minus(amount: TemporalAmount): YearMonth;
1535
+ minus(amountToSubtract: number, unit: TemporalUnit): YearMonth;
1536
+ minusMonths(monthsToSubtract: number): YearMonth;
1537
+ minusYears(yearsToSubtract: number): YearMonth;
1538
+ month(): Month;
1539
+ monthValue(): number;
1540
+ plus(amount: TemporalAmount): YearMonth;
1541
+ plus(amountToAdd: number, unit: TemporalUnit): YearMonth;
1542
+ plusMonths(monthsToAdd: number): YearMonth;
1543
+ plusYears(yearsToAdd: number): YearMonth;
1544
+ toJSON(): string;
1545
+ until(endExclusive: Temporal, unit: TemporalUnit): number;
1546
+ with(adjuster: TemporalAdjuster): YearMonth;
1547
+ with(field: TemporalField, newValue: number): YearMonth;
1548
+ withMonth(month: number): YearMonth;
1549
+ withYear(year: number): YearMonth;
1550
+ year(): number;
1551
+ }
1584
1552
 
1585
- plusHours(hours: number): ZonedDateTime
1553
+ /**
1554
+ * A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as
1555
+ * `2007-12-03T10:15:30+01:00`.
1556
+ *
1557
+ * `OffsetDateTime` is an immutable representation of a date-time with an offset. This class stores
1558
+ * all date and time fields, to a precision of nanoseconds, as well as the offset from
1559
+ * UTC/Greenwich. For example, the value "2nd October 2007 at 13:45:30.123456789 +02:00" can be
1560
+ * stored in an `OffsetDateTime`.
1561
+ *
1562
+ * `OffsetDateTime`, `ZonedDateTime` and `Instant` all store an instant on the time-line to
1563
+ * nanosecond precision. `Instant` is the simplest, simply representing the instant. `OffsetDateTime`
1564
+ * adds to the instant the offset from UTC/Greenwich, which allows the local date-time to be obtained.
1565
+ * `ZonedDateTime` adds full time-zone rules.
1566
+ *
1567
+ * It is intended that `ZonedDateTime` or `Instant` is used to model data in simpler applications. This
1568
+ * class may be used when modeling date-time concepts in more detail, or when communicating to a
1569
+ * database or in a network protocol.
1570
+ *
1571
+ * This is a value-based class; use of identity-sensitive operations (including reference equality
1572
+ * (`==`), identity hash code, or synchronization) on instances of `OffsetDateTime` may have
1573
+ * unpredictable results and should be avoided. The `equals` method should be used for comparisons.
1574
+ */
1575
+ export class OffsetDateTime extends Temporal implements TemporalAdjuster {
1576
+ static MIN: OffsetDateTime;
1577
+ static MAX: OffsetDateTime;
1578
+ static FROM: TemporalQuery<OffsetDateTime>;
1579
+
1580
+ static from(temporal: TemporalAccessor): OffsetDateTime
1581
+ static now(clockOrZone?: Clock | ZoneId): OffsetDateTime;
1582
+ static of(dateTime: LocalDateTime, offset: ZoneOffset): OffsetDateTime;
1583
+ static of(date: LocalDate, time: LocalTime, offset: ZoneOffset): OffsetDateTime;
1584
+ static of(year: number, month: number, day: number, hour: number, minute: number, second: number, nanoOfSecond: number, offset: ZoneOffset): OffsetDateTime;
1585
+ static ofInstant(instant: Instant, zone: ZoneId): OffsetDateTime;
1586
+ static parse(text: string, formatter?: DateTimeFormatter): OffsetDateTime;
1587
+
1588
+ private constructor();
1589
+
1590
+ adjustInto(temporal: Temporal): Temporal
1591
+ atZoneSameInstant(zone: ZoneId): ZonedDateTime
1592
+ atZoneSimilarLocal(zone: ZoneId): ZonedDateTime
1593
+ compareTo(other: OffsetDateTime): number
1594
+ equals(obj: any): boolean
1595
+ format(formatter: DateTimeFormatter): string
1596
+ get(field: TemporalField): number
1597
+ dayOfMonth(): number
1598
+ dayOfWeek(): DayOfWeek
1599
+ dayOfYear(): number
1600
+ hour(): number
1601
+ getLong(field: TemporalField): number
1602
+ minute(): number
1603
+ month(): Month
1604
+ monthValue(): number
1605
+ nano(): number
1606
+ offset(): ZoneOffset
1607
+ second(): number
1608
+ year(): number
1609
+ hashCode(): number
1610
+ isAfter(other: OffsetDateTime): boolean
1611
+ isBefore(other: OffsetDateTime): boolean
1612
+ isEqual(other: OffsetDateTime): boolean
1613
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean
1614
+ minus(amountToSubtract: number, unit: TemporalUnit): OffsetDateTime
1615
+ minus(amountToSubtract: TemporalAmount): OffsetDateTime
1616
+ minusDays(days: number): OffsetDateTime
1617
+ minusHours(hours: number): OffsetDateTime
1618
+ minusMinutes(minutes: number): OffsetDateTime
1619
+ minusMonths(months: number): OffsetDateTime
1620
+ minusNanos(nanos: number): OffsetDateTime
1621
+ minusSeconds(seconds: number): OffsetDateTime
1622
+ minusWeeks(weeks: number): OffsetDateTime
1623
+ minusYears(years: number): OffsetDateTime
1624
+ plus(amountToAdd: number, unit: TemporalUnit): OffsetDateTime
1625
+ plus(amountToAdd: TemporalAmount): OffsetDateTime
1626
+ plusDays(days: number): OffsetDateTime
1627
+ plusHours(hours: number): OffsetDateTime
1628
+ plusMinutes(minutes: number): OffsetDateTime
1629
+ plusMonths(months: number): OffsetDateTime
1630
+ plusNanos(nanos: number): OffsetDateTime
1631
+ plusSeconds(seconds: number): OffsetDateTime
1632
+ plusWeeks(weeks: number): OffsetDateTime
1633
+ plusYears(years: number): OffsetDateTime
1634
+ query<T>(query: TemporalQuery<T>): T
1635
+ range(field: TemporalField): ValueRange
1636
+ toEpochSecond(): number
1637
+ toJSON(): string;
1638
+ toInstant(): Instant
1639
+ toLocalDate(): LocalDate
1640
+ toLocalDateTime(): LocalDateTime
1641
+ toLocalTime(): LocalTime
1642
+ toOffsetTime(): OffsetTime
1643
+ toString(): string
1644
+ truncatedTo(unit: TemporalUnit): OffsetDateTime
1645
+ until(endExclusive: Temporal, unit: TemporalUnit): number
1646
+ with(adjuster: TemporalAdjuster): OffsetDateTime
1647
+ with(field: TemporalField, newValue: number): OffsetDateTime
1648
+ withDayOfMonth(dayOfMonth: number): OffsetDateTime
1649
+ withDayOfYear(dayOfYear: number): OffsetDateTime
1650
+ withHour(hour: number): OffsetDateTime
1651
+ withMinute(minute: number): OffsetDateTime
1652
+ withMonth(month: number): OffsetDateTime
1653
+ withNano(nanoOfSecond: number): OffsetDateTime
1654
+ withOffsetSameInstant(offset: ZoneOffset): OffsetDateTime
1655
+ withOffsetSameLocal(offset: ZoneOffset): OffsetDateTime
1656
+ withSecond(second: number): OffsetDateTime
1657
+ withYear(year: number): OffsetDateTime
1658
+ }
1586
1659
 
1587
- plusMinutes(minutes: number): ZonedDateTime
1660
+ /**
1661
+ * A time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as `10:15:30+01:00`.
1662
+ *
1663
+ * `OffsetTime` is an immutable date-time object that represents a time, often viewed as
1664
+ * hour-minute-second-offset. This class stores all time fields, to a precision of nanoseconds, as
1665
+ * well as a zone offset. For example, the value "13:45:30.123456789+02:00" can be stored in an
1666
+ * `OffsetTime`.
1667
+ *
1668
+ * This is a value-based class; use of identity-sensitive operations (including reference equality
1669
+ * (`==`), identity hash code, or synchronization) on instances of `OffsetTime` may have
1670
+ * unpredictable results and should be avoided. The `equals` method should be used for comparisons.
1671
+ */
1672
+ export class OffsetTime extends Temporal implements TemporalAdjuster {
1673
+ static MIN: OffsetTime;
1674
+ static MAX: OffsetTime;
1675
+ static FROM: TemporalQuery<OffsetTime>;
1676
+
1677
+ static from(temporal: TemporalAccessor): OffsetTime
1678
+ static now(clockOrZone?: Clock | ZoneId): OffsetTime;
1679
+ static of(time: LocalTime, offset: ZoneOffset): OffsetTime;
1680
+ static of(hour: number, minute: number, second: number, nanoOfSecond: number, offset: ZoneOffset): OffsetTime;
1681
+ static ofInstant(instant: Instant, zone: ZoneId): OffsetTime;
1682
+ static parse(text: string, formatter?: DateTimeFormatter): OffsetTime;
1683
+
1684
+ private constructor();
1685
+
1686
+ adjustInto(temporal: Temporal): Temporal
1687
+ atDate(date: LocalDate): OffsetDateTime
1688
+ compareTo(other: OffsetTime): number
1689
+ equals(other: any): boolean
1690
+ format(formatter: DateTimeFormatter): string
1691
+ get(field: TemporalField): number
1692
+ hour(): number
1693
+ getLong(field: TemporalField): number
1694
+ minute(): number
1695
+ nano(): number
1696
+ offset(): ZoneOffset
1697
+ second(): number
1698
+ hashCode(): number
1699
+ isAfter(other: OffsetTime): boolean
1700
+ isBefore(other: OffsetTime): boolean
1701
+ isEqual(other: OffsetTime): boolean
1702
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean
1703
+ minus(amountToSubtract: number, unit: TemporalUnit): OffsetTime
1704
+ minus(amountToSubtract: TemporalAmount): OffsetTime
1705
+ minusHours(hours: number): OffsetTime
1706
+ minusMinutes(minutes: number): OffsetTime
1707
+ minusNanos(nanos: number): OffsetTime
1708
+ minusSeconds(seconds: number): OffsetTime
1709
+ plus(amountToAdd: number, unit: TemporalUnit): OffsetTime
1710
+ plus(amountToAdd: TemporalAmount): OffsetTime
1711
+ plusHours(hours: number): OffsetTime
1712
+ plusMinutes(minutes: number): OffsetTime
1713
+ plusNanos(nanos: number): OffsetTime
1714
+ plusSeconds(seconds: number): OffsetTime
1715
+ query<T>(query: TemporalQuery<T>): T
1716
+ range(field: TemporalField): ValueRange
1717
+ toEpochSecond(date: LocalDate): number
1718
+ toJSON(): string;
1719
+ toLocalTime(): LocalTime
1720
+ toString(): string
1721
+ truncatedTo(unit: TemporalUnit): OffsetTime
1722
+ until(endExclusive: Temporal, unit: TemporalUnit): number
1723
+ with(adjuster: TemporalAdjuster): OffsetTime
1724
+ with(field: TemporalField, newValue: number): OffsetTime
1725
+ withHour(hour: number): OffsetTime
1726
+ withMinute(minute: number): OffsetTime
1727
+ withNano(nanoOfSecond: number): OffsetTime
1728
+ withOffsetSameInstant(offset: ZoneOffset): OffsetTime
1729
+ withOffsetSameLocal(offset: ZoneOffset): OffsetTime
1730
+ withSecond(second: number): OffsetTime
1731
+ }
1588
1732
 
1589
- plusMonths(months: number): ZonedDateTime
1733
+ /**
1734
+ * A date-time with a time-zone in the ISO-8601 calendar system, such as
1735
+ * `2007-12-23T10:15:30+01:00 Europe/Paris`.
1736
+ *
1737
+ * `ZonedDateTime` is an immutable representation of a date-time with a time-zone. This class
1738
+ * stores all date and time fields, to a precision of nanoseconds, and a time-zone, with a zone
1739
+ * offset used to handle ambiguous local date-times. For example, the value "2nd October 2007 at
1740
+ * 13:45.30.123456789 +02:00 in the Europe/Paris time-zone" can be stored in a `ZonedDateTime`.
1741
+ *
1742
+ * This class handles conversion from the local time-line of `LocalDateTime` to the instant
1743
+ * time-line of `Instant`. The difference between the two time-lines is the offset from
1744
+ * UTC/Greenwich, represented by a `ZoneOffset`.
1745
+ *
1746
+ * Converting between the two time-lines involves calculating the offset using the rules accessed
1747
+ * from the `ZoneId`. Obtaining the offset for an instant is simple, as there is exactly one valid
1748
+ * offset for each instant. By contrast, obtaining the offset for a local date-time is not
1749
+ * straightforward. There are three cases:
1750
+ * - Normal, with one valid offset. For the vast majority of the year, the normal case applies,
1751
+ * where there is a single valid offset for the local date-time.
1752
+ * - Gap, with zero valid offsets. This is when clocks jump forward typically due to the spring
1753
+ * daylight savings change from "winter" to "summer". In a gap there are local date-time values
1754
+ * with no valid offset.
1755
+ * - Overlap, with two valid offsets. This is when clocks are set back typically due to the autumn
1756
+ * daylight savings change from "summer" to "winter". In an overlap there are local date-time
1757
+ * values with two valid offsets.
1758
+ *
1759
+ * Any method that converts directly or implicitly from a local date-time to an instant by
1760
+ * obtaining the offset has the potential to be complicated.
1761
+ *
1762
+ * For Gaps, the general strategy is that if the local date-time falls in the middle of a Gap,
1763
+ * then the resulting zoned date-time will have a local date-time shifted forwards by the length
1764
+ * of the Gap, resulting in a date-time in the later offset, typically "summer" time.
1765
+ *
1766
+ * For Overlaps, the general strategy is that if the local date-time falls in the middle of an
1767
+ * Overlap, then the previous offset will be retained. If there is no previous offset, or the
1768
+ * previous offset is invalid, then the earlier offset is used, typically "summer" time. Two
1769
+ * additional methods, `withEarlierOffsetAtOverlap()` and `withLaterOffsetAtOverlap()`, help
1770
+ * manage the case of an overlap.
1771
+ */
1772
+ export class ZonedDateTime extends ChronoZonedDateTime {
1773
+ static FROM: TemporalQuery<ZonedDateTime>;
1774
+
1775
+ static from(temporal: TemporalAccessor): ZonedDateTime;
1776
+ static now(clockOrZone?: Clock | ZoneId): ZonedDateTime;
1777
+ static of(localDateTime: LocalDateTime, zone: ZoneId): ZonedDateTime;
1778
+ static of(date: LocalDate, time: LocalTime, zone: ZoneId): ZonedDateTime;
1779
+ static of(year: number, month: number, dayOfMonth: number, hour: number, minute: number, second: number, nanoOfSecond: number, zone: ZoneId): ZonedDateTime;
1780
+ /**
1781
+ * Obtains an instance of ZonedDateTime from an Instant.
1782
+ *
1783
+ * This creates a zoned date-time with the same instant as that specified. Calling
1784
+ * `ChronoZonedDateTime.toInstant()` will return an instant equal to the one used here.
1785
+ *
1786
+ * Converting an instant to a zoned date-time is simple as there is only one valid offset for
1787
+ * each instant.
1788
+ */
1789
+ static ofInstant(instant: Instant, zone: ZoneId): ZonedDateTime;
1790
+ /**
1791
+ * Obtains an instance of `ZonedDateTime` from the instant formed by combining the local
1792
+ * date-time and offset.
1793
+ *
1794
+ * This creates a zoned date-time by combining the `LocalDateTime` and `ZoneOffset`. This
1795
+ * combination uniquely specifies an instant without ambiguity.
1796
+ *
1797
+ * Converting an instant to a zoned date-time is simple as there is only one valid offset for
1798
+ * each instant. If the valid offset is different to the offset specified, the the date-time
1799
+ * and offset of the zoned date-time will differ from those specified.
1800
+ *
1801
+ * If the `ZoneId` to be used is a `ZoneOffset`, this method is equivalent to
1802
+ * `of(LocalDateTime, ZoneId)`.
1803
+ */
1804
+ static ofInstant(localDateTime: LocalDateTime, offset: ZoneOffset, zone: ZoneId): ZonedDateTime;
1805
+ /**
1806
+ * Obtains an instance of `ZonedDateTime` from a local date-time using the preferred offset
1807
+ * if possible.
1808
+ *
1809
+ * The local date-time is resolved to a single instant on the time-line. This is achieved by
1810
+ * finding a valid offset from UTC/Greenwich for the local date-time as defined by the rules
1811
+ * of the zone ID.
1812
+ *
1813
+ * In most cases, there is only one valid offset for a local date-time. In the case of an
1814
+ * overlap, where clocks are set back, there are two valid offsets. If the preferred offset
1815
+ * is one of the valid offsets then it is used. Otherwise the earlier valid offset is used,
1816
+ * typically corresponding to "summer".
1817
+ *
1818
+ * In the case of a gap, where clocks jump forward, there is no valid offset. Instead, the
1819
+ * local date-time is adjusted to be later by the length of the gap. For a typical one hour
1820
+ * daylight savings change, the local date-time will be moved one hour later into the offset
1821
+ * typically corresponding to "summer".
1822
+ */
1823
+ static ofLocal(localDateTime: LocalDateTime, zone: ZoneId, preferredOffset?: ZoneOffset | null): ZonedDateTime;
1824
+ /**
1825
+ * Obtains an instance of `ZonedDateTime` strictly validating the combination of local
1826
+ * date-time, offset and zone ID.
1827
+ *
1828
+ * This creates a zoned date-time ensuring that the offset is valid for the local date-time
1829
+ * according to the rules of the specified zone. If the offset is invalid, an exception is
1830
+ * thrown.
1831
+ */
1832
+ static ofStrict(localDateTime: LocalDateTime, offset: ZoneOffset, zone: ZoneId): ZonedDateTime;
1833
+ static parse(text: string, formatter?: DateTimeFormatter): ZonedDateTime;
1834
+
1835
+ private constructor();
1836
+
1837
+ dayOfMonth(): number;
1838
+ dayOfWeek(): DayOfWeek;
1839
+ dayOfYear(): number;
1840
+ equals(other: any): boolean;
1841
+ format(formatter: DateTimeFormatter): string;
1842
+ getLong(field: TemporalField): number;
1843
+ hashCode(): number;
1844
+ hour(): number;
1845
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1846
+ minus(amount: TemporalAmount): ZonedDateTime;
1847
+ minus(amountToSubtract: number, unit: TemporalUnit): ZonedDateTime;
1848
+ minusDays(days: number): ZonedDateTime;
1849
+ minusHours(hours: number): ZonedDateTime;
1850
+ minusMinutes(minutes: number): ZonedDateTime;
1851
+ minusMonths(months: number): ZonedDateTime;
1852
+ minusNanos(nanos: number): ZonedDateTime;
1853
+ minusSeconds(seconds: number): ZonedDateTime;
1854
+ minusWeeks(weeks: number): ZonedDateTime;
1855
+ minusYears(years: number): ZonedDateTime;
1856
+ minute(): number;
1857
+ month(): Month;
1858
+ monthValue(): number;
1859
+ nano(): number;
1860
+ offset(): ZoneOffset;
1861
+ plus(amount: TemporalAmount): ZonedDateTime;
1862
+ plus(amountToAdd: number, unit: TemporalUnit): ZonedDateTime;
1863
+ plusDays(days: number): ZonedDateTime;
1864
+ plusHours(hours: number): ZonedDateTime;
1865
+ plusMinutes(minutes: number): ZonedDateTime;
1866
+ plusMonths(months: number): ZonedDateTime;
1867
+ plusNanos(nanos: number): ZonedDateTime;
1868
+ plusSeconds(seconds: number): ZonedDateTime;
1869
+ plusWeeks(weeks: number): ZonedDateTime;
1870
+ plusYears(years: number): ZonedDateTime;
1871
+ range(field: TemporalField): ValueRange;
1872
+ second(): number;
1873
+ toJSON(): string;
1874
+ toLocalDate(): LocalDate;
1875
+ toLocalDateTime(): LocalDateTime;
1876
+ toLocalTime(): LocalTime;
1877
+ toOffsetDateTime(): OffsetDateTime;
1878
+ toString(): string;
1879
+ truncatedTo(unit: TemporalUnit): ZonedDateTime;
1880
+ until(endExclusive: Temporal, unit: TemporalUnit): number;
1881
+ with(adjuster: TemporalAdjuster): ZonedDateTime;
1882
+ with(field: TemporalField, newValue: number): ZonedDateTime;
1883
+ withDayOfMonth(dayOfMonth: number): ZonedDateTime;
1884
+ withDayOfYear(dayOfYear: number): ZonedDateTime;
1885
+ /**
1886
+ * Returns a copy of this date-time changing the zone offset to the earlier of the two valid
1887
+ * offsets at a local time-line overlap.
1888
+ *
1889
+ * This method only has any effect when the local time-line overlaps, such as at an autumn
1890
+ * daylight savings cutover. In this scenario, there are two valid offsets for the local
1891
+ * date-time. Calling this method will return a zoned date-time with the earlier of the two
1892
+ * selected.
1893
+ *
1894
+ * If this method is called when it is not an overlap, `this` is returned.
1895
+ */
1896
+ withEarlierOffsetAtOverlap(): ZonedDateTime;
1897
+ /**
1898
+ * Returns a copy of this date-time with the zone ID set to the offset.
1899
+ *
1900
+ * This returns a zoned date-time where the zone ID is the same as `offset()`. The local
1901
+ * date-time, offset and instant of the result will be the same as in this date-time.
1902
+ *
1903
+ * Setting the date-time to a fixed single offset means that any future calculations, such as
1904
+ * addition or subtraction, have no complex edge cases due to time-zone rules. This might also
1905
+ * be useful when sending a zoned date-time across a network, as most protocols, such as
1906
+ * ISO-8601, only handle offsets, and not region-based zone IDs.
1907
+ */
1908
+ withFixedOffsetZone(): ZonedDateTime;
1909
+ withHour(hour: number): ZonedDateTime;
1910
+ /**
1911
+ * Returns a copy of this date-time changing the zone offset to the later of the two valid
1912
+ * offsets at a local time-line overlap.
1913
+ *
1914
+ * This method only has any effect when the local time-line overlaps, such as at an autumn
1915
+ * daylight savings cutover. In this scenario, there are two valid offsets for the local
1916
+ * date-time. Calling this method will return a zoned date-time with the later of the two
1917
+ * selected.
1918
+ *
1919
+ * If this method is called when it is not an overlap, `this` is returned.
1920
+ */
1921
+ withLaterOffsetAtOverlap(): ZonedDateTime;
1922
+ withMinute(minute: number): ZonedDateTime;
1923
+ withMonth(month: number): ZonedDateTime;
1924
+ withNano(nanoOfSecond: number): ZonedDateTime;
1925
+ withSecond(second: number): ZonedDateTime;
1926
+ withYear(year: number): ZonedDateTime;
1927
+ /**
1928
+ * Returns a copy of this date-time with a different time-zone, retaining the instant.
1929
+ *
1930
+ * This method changes the time-zone and retains the instant. This normally results in a
1931
+ * change to the local date-time.
1932
+ *
1933
+ * This method is based on retaining the same instant, thus gaps and overlaps in the local
1934
+ * time-line have no effect on the result.
1935
+ *
1936
+ * To change the offset while keeping the local time, use `withZoneSameLocal(ZoneId)`.
1937
+ */
1938
+ withZoneSameInstant(zone: ZoneId): ZonedDateTime;
1939
+ /**
1940
+ * Returns a copy of this date-time with a different time-zone, retaining the local date-time
1941
+ * if possible.
1942
+ *
1943
+ * This method changes the time-zone and retains the local date-time. The local date-time is
1944
+ * only changed if it is invalid for the new zone, determined using the same approach as
1945
+ * `ofLocal(LocalDateTime, ZoneId, ZoneOffset)`.
1946
+ *
1947
+ * To change the zone and adjust the local date-time, use `withZoneSameInstant(ZoneId)`.
1948
+ */
1949
+ withZoneSameLocal(zone: ZoneId): ZonedDateTime;
1950
+ year(): number;
1951
+ zone(): ZoneId;
1952
+ }
1590
1953
 
1591
- plusNanos(nanos: number): ZonedDateTime
1954
+ export abstract class ZoneId {
1955
+ static SYSTEM: ZoneId;
1956
+ static UTC: ZoneId;
1592
1957
 
1593
- plusSeconds(seconds: number): ZonedDateTime
1958
+ static systemDefault(): ZoneId;
1959
+ static of(zoneId: string): ZoneId;
1960
+ static ofOffset(prefix: string, offset: ZoneOffset): ZoneId;
1961
+ static from(temporal: TemporalAccessor): ZoneId;
1594
1962
 
1595
- plusTemporalAmount(amount: TemporalAmount): ZonedDateTime
1963
+ static getAvailableZoneIds(): string[];
1596
1964
 
1597
- plusWeeks(weeks: number): any
1965
+ equals(other: any): boolean;
1966
+ hashCode(): number;
1967
+ abstract id(): string;
1968
+ normalized(): ZoneId;
1969
+ abstract rules(): ZoneRules;
1970
+ toJSON(): string;
1971
+ toString(): string;
1972
+ }
1598
1973
 
1599
- plusYears(years: number): ZonedDateTime
1974
+ export class ZoneOffset extends ZoneId implements TemporalAdjuster {
1975
+ static MAX_SECONDS: ZoneOffset;
1976
+ static UTC: ZoneOffset;
1977
+ static MIN: ZoneOffset;
1978
+ static MAX: ZoneOffset;
1979
+
1980
+ static of(offsetId: string): ZoneOffset;
1981
+ static ofHours(hours: number): ZoneOffset;
1982
+ static ofHoursMinutes(hours: number, minutes: number): ZoneOffset;
1983
+ static ofHoursMinutesSeconds(hours: number, minutes: number, seconds: number): ZoneOffset;
1984
+ static ofTotalMinutes(totalMinutes: number): ZoneOffset;
1985
+ static ofTotalSeconds(totalSeconds: number): ZoneOffset;
1986
+
1987
+ private constructor();
1988
+
1989
+ adjustInto(temporal: Temporal): Temporal;
1990
+ compareTo(other: ZoneOffset): number;
1991
+ equals(other: any): boolean;
1992
+ get(field: TemporalField): number;
1993
+ getLong(field: TemporalField): number;
1994
+ hashCode(): number;
1995
+ id(): string;
1996
+ rules(): ZoneRules;
1997
+ toString(): string;
1998
+ totalSeconds(): number;
1999
+ }
1600
2000
 
1601
- query(query: TemporalQuery): any
2001
+ export class ZoneRegion extends ZoneId {
2002
+ static ofId(zoneId: string): ZoneId;
1602
2003
 
1603
- range(field: TemporalField): ValueRange
2004
+ private constructor();
1604
2005
 
1605
- second(): number
2006
+ id(): string;
2007
+ rules(): ZoneRules;
2008
+ }
1606
2009
 
1607
- toJSON(): string
2010
+ export class DayOfWeek extends TemporalAccessor implements TemporalAdjuster {
2011
+ static MONDAY: DayOfWeek;
2012
+ static TUESDAY: DayOfWeek;
2013
+ static WEDNESDAY: DayOfWeek;
2014
+ static THURSDAY: DayOfWeek;
2015
+ static FRIDAY: DayOfWeek;
2016
+ static SATURDAY: DayOfWeek;
2017
+ static SUNDAY: DayOfWeek;
2018
+
2019
+ static FROM: TemporalQuery<DayOfWeek>;
2020
+
2021
+ static from(temporal: TemporalAccessor): DayOfWeek;
2022
+ static of(dayOfWeek: number): DayOfWeek;
2023
+ static valueOf(name: string): DayOfWeek;
2024
+ static values(): DayOfWeek[];
2025
+
2026
+ private constructor();
2027
+
2028
+ adjustInto(temporal: Temporal): Temporal;
2029
+ compareTo(other: DayOfWeek): number;
2030
+ equals(other: any): boolean;
2031
+ displayName(style: TextStyle, locale: Locale): string;
2032
+ getLong(field: TemporalField): number;
2033
+ isSupported(field: TemporalField): boolean;
2034
+ minus(days: number): DayOfWeek;
2035
+ name(): string;
2036
+ ordinal(): number;
2037
+ plus(days: number): DayOfWeek;
2038
+ toJSON(): string;
2039
+ toString(): string;
2040
+ value(): number;
2041
+ }
1608
2042
 
1609
- toLocalDate(): LocalDate
2043
+ export class Month extends TemporalAccessor implements TemporalAdjuster {
2044
+ static JANUARY: Month;
2045
+ static FEBRUARY: Month;
2046
+ static MARCH: Month;
2047
+ static APRIL: Month;
2048
+ static MAY: Month;
2049
+ static JUNE: Month;
2050
+ static JULY: Month;
2051
+ static AUGUST: Month;
2052
+ static SEPTEMBER: Month;
2053
+ static OCTOBER: Month;
2054
+ static NOVEMBER: Month;
2055
+ static DECEMBER: Month;
2056
+
2057
+ static from(temporal: TemporalAccessor): Month;
2058
+ static of(month: number): Month;
2059
+ static valueOf(name: string): Month;
2060
+ static values(): Month[];
2061
+
2062
+ private constructor();
2063
+
2064
+ adjustInto(temporal: Temporal): Temporal;
2065
+ compareTo(other: Month): number;
2066
+ equals(other: any): boolean;
2067
+ firstDayOfYear(leapYear: boolean): number;
2068
+ firstMonthOfQuarter(): Month;
2069
+ displayName(style: TextStyle, locale: Locale): string;
2070
+ getLong(field: TemporalField): number;
2071
+ isSupported(field: TemporalField): boolean;
2072
+ length(leapYear: boolean): number;
2073
+ maxLength(): number;
2074
+ minLength(): number;
2075
+ minus(months: number): Month;
2076
+ name(): string;
2077
+ ordinal(): number;
2078
+ plus(months: number): Month;
2079
+ toJSON(): string;
2080
+ toString(): string;
2081
+ value(): number;
2082
+ }
1610
2083
 
1611
- toLocalDateTime(): LocalDateTime
2084
+ // ----------------------------------------------------------------------------
2085
+ // FORMAT
2086
+ // ----------------------------------------------------------------------------
2087
+
2088
+ export class DateTimeFormatter {
2089
+ static ISO_LOCAL_DATE: DateTimeFormatter;
2090
+ static ISO_LOCAL_TIME: DateTimeFormatter;
2091
+ static ISO_LOCAL_DATE_TIME: DateTimeFormatter;
2092
+ static ISO_INSTANT: DateTimeFormatter;
2093
+ static ISO_OFFSET_DATE_TIME: DateTimeFormatter;
2094
+ static ISO_ZONED_DATE_TIME: DateTimeFormatter;
2095
+
2096
+ static ofPattern(pattern: string): DateTimeFormatter;
2097
+ static parsedExcessDays(): TemporalQuery<Period>;
2098
+ static parsedLeapSecond(): TemporalQuery<boolean>;
2099
+
2100
+ private constructor();
2101
+
2102
+ chronology(): Chronology | null;
2103
+ decimalStyle(): DecimalStyle;
2104
+ format(temporal: TemporalAccessor): string;
2105
+ locale(): any;
2106
+ parse(text: string): TemporalAccessor;
2107
+ parse<T>(text: string, query: TemporalQuery<T>): T;
2108
+ parseUnresolved(text: string, position: ParsePosition): TemporalAccessor;
2109
+ toString(): string;
2110
+ withChronology(chrono: Chronology): DateTimeFormatter;
2111
+ withLocale(locale: Locale): DateTimeFormatter;
2112
+ withResolverStyle(resolverStyle: ResolverStyle): DateTimeFormatter;
2113
+ }
1612
2114
 
1613
- toLocalTime(): LocalTime
2115
+ export class DateTimeFormatterBuilder {
2116
+ constructor();
2117
+
2118
+ append(formatter: DateTimeFormatter): DateTimeFormatterBuilder;
2119
+ appendFraction(field: TemporalField, minWidth: number, maxWidth: number, decimalPoint: boolean): DateTimeFormatterBuilder;
2120
+ appendInstant(fractionalDigits: number): DateTimeFormatterBuilder;
2121
+ appendLiteral(literal: any): DateTimeFormatterBuilder;
2122
+ appendOffset(pattern: string, noOffsetText: string): DateTimeFormatterBuilder;
2123
+ appendOffsetId(): DateTimeFormatterBuilder;
2124
+ appendPattern(pattern: string): DateTimeFormatterBuilder;
2125
+ appendValue(field: TemporalField, width?: number, maxWidth?: number, signStyle?: SignStyle): DateTimeFormatterBuilder;
2126
+ appendValueReduced(field: TemporalField, width: number, maxWidth: number, base: ChronoLocalDate | number): DateTimeFormatterBuilder;
2127
+ appendZoneId(): DateTimeFormatterBuilder;
2128
+ optionalEnd(): DateTimeFormatterBuilder;
2129
+ optionalStart(): DateTimeFormatterBuilder;
2130
+ padNext(): DateTimeFormatterBuilder;
2131
+ parseCaseInsensitive(): DateTimeFormatterBuilder;
2132
+ parseCaseSensitive(): DateTimeFormatterBuilder;
2133
+ parseLenient(): DateTimeFormatterBuilder;
2134
+ parseStrict(): DateTimeFormatterBuilder;
2135
+ toFormatter(resolverStyle?: ResolverStyle): DateTimeFormatter;
2136
+ }
1614
2137
 
1615
- toString(): string
2138
+ export class DecimalStyle {
2139
+ private constructor();
1616
2140
 
1617
- truncatedTo(unit: TemporalUnit): ZonedDateTime
2141
+ decimalSeparator(): string;
2142
+ equals(other: any): boolean;
2143
+ hashCode(): any;
2144
+ negativeSign(): string;
2145
+ positiveSign(): string;
2146
+ toString(): string;
2147
+ zeroDigit(): string;
2148
+ }
1618
2149
 
1619
- until(endExclusive: Temporal, unit: TemporalUnit): number
2150
+ export class ResolverStyle {
2151
+ static STRICT: ResolverStyle;
2152
+ static SMART: ResolverStyle;
2153
+ static LENIENT: ResolverStyle;
1620
2154
 
1621
- with(): any
1622
- with(field: TemporalField, newValue: number): ZonedDateTime
2155
+ private constructor();
1623
2156
 
1624
- withDayOfMonth(dayOfMonth: number): ZonedDateTime
2157
+ equals(other: any): boolean;
2158
+ toJSON(): string;
2159
+ toString(): string;
2160
+ }
1625
2161
 
1626
- withDayOfYear(dayOfYear: number): ZonedDateTime
2162
+ export class SignStyle {
2163
+ static NORMAL: SignStyle;
2164
+ static NEVER: SignStyle;
2165
+ static ALWAYS: SignStyle;
2166
+ static EXCEEDS_PAD: SignStyle;
2167
+ static NOT_NEGATIVE: SignStyle;
1627
2168
 
1628
- withFixedOffsetZone(): ZonedDateTime
2169
+ private constructor();
1629
2170
 
1630
- withHour(hour: number): ZonedDateTime
2171
+ equals(other: any): boolean;
2172
+ toJSON(): string;
2173
+ toString(): string;
2174
+ }
1631
2175
 
1632
- withMinute(minute: number): ZonedDateTime
2176
+ export class TextStyle {
2177
+ static FULL: TextStyle;
2178
+ static FULL_STANDALONE: TextStyle;
2179
+ static SHORT: TextStyle;
2180
+ static SHORT_STANDALONE: TextStyle;
2181
+ static NARROW: TextStyle;
2182
+ static NARROW_STANDALONE: TextStyle;
1633
2183
 
1634
- withMonth(month: number): ZonedDateTime
2184
+ private constructor();
1635
2185
 
1636
- withNano(nanoOfSecond: number): ZonedDateTime
2186
+ asNormal(): TextStyle;
2187
+ asStandalone(): TextStyle;
2188
+ isStandalone(): boolean;
1637
2189
 
1638
- withSecond(second: number): ZonedDateTime
2190
+ equals(other: any): boolean;
2191
+ toJSON(): string;
2192
+ toString(): string;
2193
+ }
1639
2194
 
1640
- withTemporalAdjuster(adjuster: TemporalAdjuster): ZonedDateTime
2195
+ export class ParsePosition {
2196
+ constructor(index: number);
1641
2197
 
1642
- withYear(year: number): ZonedDateTime
2198
+ getIndex(): number;
2199
+ setIndex(index: number): void;
2200
+ getErrorIndex(): number;
2201
+ setErrorIndex(errorIndex: number): void;
2202
+ }
1643
2203
 
1644
- withZoneSameInstant(zone: ZoneId): ZonedDateTime
2204
+ // ----------------------------------------------------------------------------
2205
+ // ZONE
2206
+ // ----------------------------------------------------------------------------
2207
+
2208
+ export class ZoneOffsetTransition {
2209
+ static of(transition: LocalDateTime, offsetBefore: ZoneOffset, offsetAfter: ZoneOffset): ZoneOffsetTransition;
2210
+
2211
+ private constructor();
2212
+
2213
+ compareTo(transition: ZoneOffsetTransition): number;
2214
+ dateTimeAfter(): LocalDateTime;
2215
+ dateTimeBefore(): LocalDateTime;
2216
+ duration(): Duration;
2217
+ durationSeconds(): number;
2218
+ equals(other: any): boolean;
2219
+ hashCode(): number;
2220
+ instant(): Instant;
2221
+ isGap(): boolean;
2222
+ isOverlap(): boolean;
2223
+ isValidOffset(offset: ZoneOffset): boolean;
2224
+ offsetAfter(): ZoneOffset;
2225
+ offsetBefore(): ZoneOffset;
2226
+ toEpochSecond(): number;
2227
+ toString(): string;
2228
+ validOffsets(): ZoneOffset[];
2229
+ }
1645
2230
 
1646
- withZoneSameLocal(zone: ZoneId): ZonedDateTime
2231
+ export interface ZoneOffsetTransitionRule {
2232
+ // TODO: Not implemented yet
2233
+ }
1647
2234
 
1648
- year(): number
2235
+ export abstract class ZoneRules {
2236
+ static of(offest: ZoneOffset): ZoneRules;
2237
+
2238
+ /**
2239
+ * Gets the offset applicable at the specified instant in these rules.
2240
+ *
2241
+ * The mapping from an instant to an offset is simple, there is only one valid offset
2242
+ * for each instant. This method returns that offset.
2243
+ */
2244
+ offset(instant: Instant): ZoneOffset;
2245
+ /**
2246
+ * Gets a suitable offset for the specified local date-time in these rules.
2247
+ *
2248
+ * The mapping from a local date-time to an offset is not straightforward. There are
2249
+ * three cases:
2250
+ * - Normal, with one valid offset. For the vast majority of the year, the normal case
2251
+ * applies, where there is a single valid offset for the local date-time.
2252
+ * - Gap, with zero valid offsets. This is when clocks jump forward typically due to the
2253
+ * spring daylight savings change from "winter" to "summer". In a gap there are local
2254
+ * date-time values with no valid offset.
2255
+ * - Overlap, with two valid offsets. This is when clocks are set back typically due to
2256
+ * the autumn daylight savings change from "summer" to "winter". In an overlap there are
2257
+ * local date-time values with two valid offsets.
2258
+ *
2259
+ * Thus, for any given local date-time there can be zero, one or two valid offsets. This
2260
+ * method returns the single offset in the Normal case, and in the Gap or Overlap case it
2261
+ * returns the offset before the transition.
2262
+ *
2263
+ * Since, in the case of Gap and Overlap, the offset returned is a "best" value, rather
2264
+ * than the "correct" value, it should be treated with care. Applications that care about
2265
+ * the correct offset should use a combination of this method, `getValidOffsets` and
2266
+ * `getTransition`.
2267
+ */
2268
+ offset(localDateTime: LocalDateTime): ZoneOffset;
2269
+ toJSON(): string;
2270
+ abstract daylightSavings(instant: Instant): Duration;
2271
+ abstract isDaylightSavings(instant: Instant): boolean;
2272
+ abstract isFixedOffset(): boolean;
2273
+ /**
2274
+ * Checks if the offset date-time is valid for these rules.
2275
+ *
2276
+ * To be valid, the local date-time must not be in a gap and the offset must match the
2277
+ * valid offsets.
2278
+ */
2279
+ abstract isValidOffset(localDateTime: LocalDateTime, offset: ZoneOffset): boolean;
2280
+ abstract nextTransition(instant: Instant): ZoneOffsetTransition;
2281
+ abstract offsetOfEpochMilli(epochMilli: number): ZoneOffset;
2282
+ abstract offsetOfInstant(instant: Instant): ZoneOffset;
2283
+ abstract offsetOfLocalDateTime(localDateTime: LocalDateTime): ZoneOffset;
2284
+ abstract previousTransition(instant: Instant): ZoneOffsetTransition;
2285
+ abstract standardOffset(instant: Instant): ZoneOffset;
2286
+ abstract toString(): string;
2287
+ /**
2288
+ * Gets the offset transition applicable at the specified local date-time in these rules.
2289
+ *
2290
+ * The mapping from a local date-time to an offset is not straightforward. There are
2291
+ * three cases:
2292
+ * - Normal, with one valid offset. For the vast majority of the year, the normal case
2293
+ * applies, where there is a single valid offset for the local date-time.
2294
+ * - Gap, with zero valid offsets. This is when clocks jump forward typically due to the
2295
+ * spring daylight savings change from "winter" to "summer". In a gap there are local
2296
+ * date-time values with no valid offset.
2297
+ * - Overlap, with two valid offsets. This is when clocks are set back typically due to
2298
+ * the autumn daylight savings change from "summer" to "winter". In an overlap there are
2299
+ * local date-time values with two valid offsets.
2300
+ *
2301
+ * A transition is used to model the cases of a Gap or Overlap. The Normal case will return
2302
+ * `null`.
2303
+ *
2304
+ * There are various ways to handle the conversion from a `LocalDateTime`. One technique,
2305
+ * using this method, would be:
2306
+ * ```
2307
+ * const trans = rules.transition(localDT);
2308
+ * if (trans === null) {
2309
+ * // Gap or Overlap: determine what to do from transition
2310
+ * } else {
2311
+ * // Normal case: only one valid offset
2312
+ * zoneOffset = rules.offset(localDT);
2313
+ * }
2314
+ * ```
2315
+ *
2316
+ * @returns the offset transition, `null` if the local date-time is not in transition.
2317
+ */
2318
+ abstract transition(localDateTime: LocalDateTime): ZoneOffsetTransition;
2319
+ abstract transitionRules(): ZoneOffsetTransitionRule[];
2320
+ abstract transitions(): ZoneOffsetTransition[];
2321
+ /**
2322
+ * Gets the offset applicable at the specified local date-time in these rules.
2323
+ *
2324
+ * The mapping from a local date-time to an offset is not straightforward. There are
2325
+ * three cases:
2326
+ * - Normal, with one valid offset. For the vast majority of the year, the normal case
2327
+ * applies, where there is a single valid offset for the local date-time.
2328
+ * - Gap, with zero valid offsets. This is when clocks jump forward typically due to the
2329
+ * spring daylight savings change from "winter" to "summer". In a gap there are local
2330
+ * date-time values with no valid offset.
2331
+ * - Overlap, with two valid offsets. This is when clocks are set back typically due to
2332
+ * the autumn daylight savings change from "summer" to "winter". In an overlap there are
2333
+ * local date-time values with two valid offsets.
2334
+ *
2335
+ * Thus, for any given local date-time there can be zero, one or two valid offsets. This
2336
+ * method returns that list of valid offsets, which is a list of size 0, 1 or 2. In the
2337
+ * case where there are two offsets, the earlier offset is returned at index 0 and the
2338
+ * later offset at index 1.
2339
+ *
2340
+ * There are various ways to handle the conversion from a `LocalDateTime`. One technique,
2341
+ * using this method, would be:
2342
+ * ```
2343
+ * const validOffsets = rules.getOffset(localDT);
2344
+ * if (validOffsets.length === 1) {
2345
+ * // Normal case: only one valid offset
2346
+ * zoneOffset = validOffsets[0];
2347
+ * } else {
2348
+ * // Gap or Overlap: determine what to do from transition
2349
+ * const trans = rules.transition(localDT);
2350
+ * }
2351
+ * ```
2352
+ *
2353
+ * In theory, it is possible for there to be more than two valid offsets. This would happen
2354
+ * if clocks to be put back more than once in quick succession. This has never happened in
2355
+ * the history of time-zones and thus has no special handling. However, if it were to
2356
+ * happen, then the list would return more than 2 entries.
2357
+ */
2358
+ abstract validOffsets(localDateTime: LocalDateTime): ZoneOffset[];
2359
+ }
1649
2360
 
1650
- zone(): ZoneId
1651
- }
2361
+ export class ZoneRulesProvider {
2362
+ static getRules(zoneId: string): ZoneRules;
2363
+ static getAvailableZoneIds(): string[];
2364
+ }
1652
2365
 
1653
- class TextStyle {
1654
- static FULL: TextStyle
1655
- static FULL_STANDALONE: TextStyle
1656
- static SHORT: TextStyle
1657
- static SHORT_STANDALONE: TextStyle
1658
- static NARROW: TextStyle
1659
- static NARROW_STANDALONE: TextStyle
2366
+ // ----------------------------------------------------------------------------
2367
+ // CHRONO
2368
+ // ----------------------------------------------------------------------------
1660
2369
 
1661
- private constructor()
2370
+ // TODO: js-joda doesn't have Chronology yet. Methods like `LocalDate.chronology()`
2371
+ // actually return an `IsoChronology` so Chronology is an alias type of that class
2372
+ // for now. Change this if Chronology is added.
2373
+ export type Chronology = IsoChronology;
1662
2374
 
1663
- asNormal(): TextStyle
2375
+ export abstract class IsoChronology {
2376
+ static isLeapYear(prolepticYear: number): boolean;
1664
2377
 
1665
- asStandalone(): TextStyle
2378
+ private constructor();
1666
2379
 
1667
- isStandalone(): boolean
1668
- }
2380
+ equals(other: any): boolean;
2381
+ resolveDate(fieldValues: any, resolverStyle: any): any;
2382
+ toString(): string;
2383
+ }
1669
2384
 
1670
- interface Locale {
1671
- // TODO: Not implemented yet
1672
- }
2385
+ export abstract class ChronoLocalDate extends Temporal implements TemporalAdjuster {
2386
+ adjustInto(temporal: Temporal): Temporal;
2387
+ format(formatter: DateTimeFormatter): string;
2388
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
2389
+ }
1673
2390
 
1674
- abstract class IsoChronology {
1675
- static isLeapYear(prolepticYear: number): boolean
2391
+ export abstract class ChronoLocalDateTime extends Temporal implements TemporalAdjuster {
2392
+ adjustInto(temporal: Temporal): Temporal;
2393
+ chronology(): Chronology;
2394
+ toEpochSecond(offset: ZoneOffset): number;
2395
+ toInstant(offset: ZoneOffset): Instant;
2396
+ }
1676
2397
 
1677
- private constructor()
2398
+ export abstract class ChronoZonedDateTime extends Temporal {
2399
+ compareTo(other: ChronoZonedDateTime): number;
2400
+ equals(other: any): boolean;
2401
+ format(formatter: DateTimeFormatter): string;
2402
+ isAfter(other: ChronoZonedDateTime): boolean;
2403
+ isBefore(other: ChronoZonedDateTime): boolean;
2404
+ isEqual(other: ChronoZonedDateTime): boolean;
2405
+ toEpochSecond(): number;
2406
+ toInstant(): Instant;
2407
+ }
1678
2408
 
1679
- resolveDate(fieldValues: any, resolverStyle: any): any
2409
+ // ----------------------------------------------------------------------------
2410
+ // SUPPORT
2411
+ // ----------------------------------------------------------------------------
1680
2412
 
1681
- equals(other: any): boolean
2413
+ export interface Locale {
2414
+ // TODO: Not implemented yet
2415
+ }
1682
2416
 
1683
- toString(): string
1684
- }
2417
+ export function nativeJs(date: Date | any, zone?: ZoneId): TemporalAccessor;
1685
2418
 
1686
- function nativeJs(date: Date|any, zone?: ZoneId): TemporalAccessor;
2419
+ export function convert(
2420
+ temporal: LocalDate | LocalDateTime | ZonedDateTime,
2421
+ zone?: ZoneId,
2422
+ ): {
2423
+ toDate: () => Date;
2424
+ toEpochMilli: () => number;
2425
+ };
1687
2426
 
1688
- function convert(temporal: LocalDate|LocalDateTime|ZonedDateTime, zone?: ZoneId): {
1689
- toDate: () => Date,
1690
- toEpochMilli: () => number
1691
- };
2427
+ export function use(plugin: Function): any;
1692
2428
 
1693
- function use(plugin: Function):any;
2429
+ // ----------------------------------------------------------------------------
2430
+ // EXCEPTIONS
2431
+ // ----------------------------------------------------------------------------
1694
2432
 
1695
- class DateTimeParseException extends Error {
1696
- constructor(message?: string)
1697
- }
2433
+ export class DateTimeException extends Error {
2434
+ constructor(message?: string, cause?: Error);
2435
+ }
1698
2436
 
1699
- class ZoneRulesProvider {
1700
- static getRules(zoneId: string): ZoneRules
2437
+ export class UnsupportedTemporalTypeException extends DateTimeException { }
1701
2438
 
1702
- static getAvailableZoneIds(): string[]
1703
- }
2439
+ export class DateTimeParseException extends Error {
2440
+ constructor(message?: string, text?: string, index?: number, cause?: Error);
1704
2441
 
1705
- class DateTimeException extends Error {
1706
- constructor(message?: string)
1707
- }
2442
+ parsedString(): string;
2443
+ errorIndex(): number;
1708
2444
  }
1709
2445
 
1710
- export = JSJoda;
2446
+ export class ArithmeticException extends Error { }
2447
+ export class IllegalArgumentException extends Error { }
2448
+ export class IllegalStateException extends Error { }
2449
+ export class NullPointerException extends Error { }
2450
+
2451
+ export const __esModule: true;
2452
+ export as namespace JSJoda;