js-sys 0.3.62

Bindings for all JS global objects and functions in all JS environments like Node.js and browsers, built on `#[wasm_bindgen]` using the `wasm-bindgen` crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
use super::*;

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen(js_namespace = Temporal, extends = Object)]
    #[derive(Clone, Debug)]
    pub type Instant;

    #[wasm_bindgen(static_method_of = Instant, js_namespace = Temporal)]
    pub fn from(val: &JsValue) -> Instant;

    #[wasm_bindgen(static_method_of = Instant, js_namespace = Temporal)]
    pub fn compare(one: &Instant, two: &Instant) -> i32;

    #[wasm_bindgen(method, getter, structural, js_name = epochSeconds)]
    pub fn epoch_seconds(this: &Instant) -> u64;
    #[wasm_bindgen(method, getter, structural, js_name = epochMilliseconds)]
    pub fn epoch_milliseconds(this: &Instant) -> u64;
    #[wasm_bindgen(method, getter, structural, js_name = epochMicroseconds)]
    pub fn epoch_microseconds(this: &Instant) -> BigInt;
    #[wasm_bindgen(method, getter, structural, js_name = epochNanoseconds)]
    pub fn epoch_nanoseconds(this: &Instant) -> BigInt;

    /// This method adds duration to Instant.
    ///
    /// The years, months, weeks, and days fields of duration must be zero.
    #[wasm_bindgen(method)]
    pub fn add(this: &Instant, duration: &Duration, options: &JsValue) -> Instant;

    /// This method subtracts duration to Instant.
    ///
    /// The years, months, weeks, and days fields of duration must be zero.
    #[wasm_bindgen(method)]
    pub fn subtract(this: &Instant, duration: &Duration, options: &JsValue) -> Instant;

    /// This method computes the difference between the two times represented by zonedDateTime and
    /// other, optionally rounds it, and returns it as a Temporal.Duration object. If other is earlier
    /// than zonedDateTime then the resulting duration will be negative. The returned Temporal.Duration, when
    /// added to zonedDateTime with the same options, will yield other.
    #[wasm_bindgen(method)]
    pub fn until(this: &Instant, other: &Instant, options: &JsValue) -> Duration;

    /// This method computes the difference between the two times represented by zonedDateTime and
    /// other, optionally rounds it, and returns it as a Temporal.Duration object. If other is later
    /// than zonedDateTime then the resulting duration will be negative. The returned Temporal.Duration, when
    /// added to zonedDateTime with the same options, will yield other.    
    #[wasm_bindgen(method)]
    pub fn since(this: &Instant, other: &Instant, options: &JsValue) -> Duration;

    /// Returns a new Temporal.Instant object which is zonedDateTime rounded to `roundTo` (if
    /// a string parameter is used) or `roundingIncrement` of `smallestUnit` (if an object parameter
    /// is used).
    #[wasm_bindgen(method)]
    pub fn round(this: &Instant, round_to: &JsValue) -> Instant;

    #[wasm_bindgen(method)]
    pub fn equals(this: &Instant, other: &Instant) -> bool;

    /// This method overrides the Object.prototype.toString() method and provides a convenient, unambiguous
    /// string representation of date. The string can be passed to Temporal.PlainDate.from() to
    /// create a new Temporal.PlainDate object.
    #[wasm_bindgen(method, js_name = toString)]
    pub fn to_string(this: &Instant) -> JsString;

    /// This method overrides `Object.prototype.toLocaleString()` to provide a human-readable,
    /// language-sensitive representation of duration.
    ///
    /// The locales and options arguments are the same as in the constructor to Intl.DateTimeFormat.
    #[wasm_bindgen(method, js_name = toLocaleString)]
    pub fn to_locale_string(this: &Instant, locales: &JsValue, options: &JsValue) -> JsString;

}

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen(js_namespace = Temporal, extends = Object)]
    #[derive(Clone, Debug)]
    pub type PlainDateTime;

    #[wasm_bindgen(static_method_of = PlainDateTime, js_namespace = Temporal)]
    pub fn from(val: &JsValue) -> PlainDateTime;

    #[wasm_bindgen(static_method_of = PlainDateTime, js_namespace = Temporal)]
    pub fn compare(one: &PlainDateTime, two: &PlainDateTime) -> i32;

    #[wasm_bindgen(method, getter, structural)]
    pub fn year(this: &PlainDateTime) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn month(this: &PlainDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn week(this: &PlainDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn day(this: &PlainDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn hour(this: &PlainDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn minute(this: &PlainDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn second(this: &PlainDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn millisecond(this: &PlainDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn microsecond(this: &PlainDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn nanosecond(this: &PlainDateTime) -> u32;

    /// In calendars that use eras, the era and eraYear read-only properties can be used
    /// together to resolve an era-relative year. Both properties are undefined when using
    /// the ISO 8601 calendar. As inputs to from or with, era and eraYear can be used instead
    /// of year. Unlike year, eraYear may decrease as time proceeds because some
    /// eras (like the BCE era in the Gregorian calendar) count years backwards.
    #[wasm_bindgen(method, getter, structural, js_name = eraYear)]
    pub fn era_year(this: &PlainDateTime) -> JsValue;

    /// In calendars that use eras, the era and eraYear read-only properties can be used
    /// together to resolve an era-relative year. Both properties are undefined when using
    /// the ISO 8601 calendar. As inputs to from or with, era and eraYear can be used instead
    /// of year. Unlike year, eraYear may decrease as time proceeds because some
    /// eras (like the BCE era in the Gregorian calendar) count years backwards.
    #[wasm_bindgen(method, getter, structural)]
    pub fn era(this: &PlainDateTime) -> JsValue;

    /// The dayOfWeek read-only property gives the weekday number that the date falls
    /// on. For the ISO 8601 calendar, the weekday number is defined as in the ISO 8601
    /// standard: a value between 1 and 7, inclusive, with Monday being 1, and Sunday 7.
    #[wasm_bindgen(method, getter, structural, js_name = dayOfWeek)]
    pub fn day_of_week(this: &PlainDateTime) -> u32;

    /// The dayOfYear read-only property gives the ordinal day of the year that the date
    /// falls on. For the ISO 8601 calendar, this is a value between 1 and 365, or 366 in
    /// a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = dayOfYear)]
    pub fn day_of_year(this: &PlainDateTime) -> u32;

    /// The weekOfYear read-only property gives the ISO week number of the date. For the
    /// ISO 8601 calendar, this is normally a value between 1 and 52, but in a few cases it
    /// can be 53 as well. ISO week 1 is the week containing the first Thursday of the year.
    #[wasm_bindgen(method, getter, structural, js_name = weekOfYear)]
    pub fn week_of_year(this: &PlainDateTime) -> u32;

    /// The daysInWeek read-only property gives the number of days in the week that the
    /// date falls in. For the ISO 8601 calendar, this is always 7, but in other calendar
    /// systems it may differ from week to week.
    #[wasm_bindgen(method, getter, structural, js_name = daysInWeek)]
    pub fn days_in_week(this: &PlainDateTime) -> u32;

    /// The daysInMonth read-only property gives the number of days in the month that the
    /// date falls in. For the ISO 8601 calendar, this is 28, 29, 30, or 31, depending
    /// on the month and whether the year is a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = daysInMonth)]
    pub fn days_in_month(this: &PlainDateTime) -> u32;

    /// The daysInYear read-only property gives the number of days in the year that the date
    /// falls in. For the ISO 8601 calendar, this is 365 or 366, depending on whether the year
    /// is a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = daysInYear)]
    pub fn days_in_year(this: &PlainDateTime) -> u32;

    /// The monthsInYear read-only property gives the number of months in the year that the date
    /// falls in. For the ISO 8601 calendar, this is always 12, but in other calendar systems
    /// it may differ from year to year.
    #[wasm_bindgen(method, getter, structural, js_name = monthsInWeek)]
    pub fn months_in_year(this: &PlainDateTime) -> u32;

    /// The inLeapYear read-only property tells whether the year that the date falls in is a
    /// leap year or not. Its value is true if the year is a leap year, and false if not.
    #[wasm_bindgen(method, getter, structural, js_name = inLeapYear)]
    pub fn in_leap_year(this: &PlainDateTime) -> bool;

    /// This method creates a new Temporal.PlainDateTime which is a copy of zonedDateTime, but any
    /// properties present on parameter override the ones already present on zonedDateTime.
    #[wasm_bindgen(method, js_name = withPlainDate)]
    pub fn with(this: &PlainDateTime, parameter: &JsValue, options: &JsValue) -> PlainDateTime;

    /// Returns a new `Temporal.PlainDateTime` object which replaces the calendar date of zonedDateTime
    /// with the calendar date represented by plainDate.
    #[wasm_bindgen(method, js_name = withPlainDate)]
    pub fn with_plain_date(this: &PlainDateTime, date: &PlainDate) -> PlainDateTime;

    /// Returns a new `Temporal.PlainDateTime` object which is the date indicated by date, projected
    /// into calendar.
    #[wasm_bindgen(method, js_name = withCalendar)]
    pub fn with_calendar(this: &PlainDateTime, calendar: &str) -> PlainDateTime;

    /// This method adds duration to zonedDateTime.
    #[wasm_bindgen(method)]
    pub fn add(this: &PlainDateTime, duration: &Duration, options: &JsValue) -> PlainDateTime;

    /// This method subtracts duration to zonedDateTime.
    #[wasm_bindgen(method)]
    pub fn subtract(this: &PlainDateTime, duration: &Duration, options: &JsValue) -> PlainDateTime;

    /// This method computes the difference between the two times represented by zonedDateTime and
    /// other, optionally rounds it, and returns it as a Temporal.Duration object. If other is earlier
    /// than zonedDateTime then the resulting duration will be negative. The returned Temporal.Duration, when
    /// added to zonedDateTime with the same options, will yield other.
    #[wasm_bindgen(method)]
    pub fn until(this: &PlainDateTime, other: &PlainDateTime, options: &JsValue) -> Duration;

    /// This method computes the difference between the two times represented by zonedDateTime and
    /// other, optionally rounds it, and returns it as a Temporal.Duration object. If other is later
    /// than zonedDateTime then the resulting duration will be negative. The returned Temporal.Duration, when
    /// added to zonedDateTime with the same options, will yield other.    
    #[wasm_bindgen(method)]
    pub fn since(this: &PlainDateTime, other: &PlainDateTime, options: &JsValue) -> Duration;

    /// Returns a new Temporal.PlainDateTime object which is zonedDateTime rounded to `roundTo` (if
    /// a string parameter is used) or `roundingIncrement` of `smallestUnit` (if an object parameter
    /// is used).
    #[wasm_bindgen(method)]
    pub fn round(this: &PlainDateTime, round_to: &JsValue) -> PlainDateTime;

    #[wasm_bindgen(method)]
    pub fn equals(this: &PlainDateTime, other: &PlainDateTime) -> bool;

    /// Returns: a plain object with properties expressing zonedDateTime in the ISO 8601 calendar, including
    /// all date/time fields as well as the calendar, timeZone, and offset properties.
    ///
    /// This is an advanced method that's mainly useful if you are implementing a custom calendar. Most
    /// developers will not need to use it.
    #[wasm_bindgen(method, js_name = getISOFields)]
    pub fn get_iso_fields(this: &PlainDateTime) -> JsValue;
}

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen(js_namespace = Temporal, extends = Object)]
    #[derive(Clone, Debug)]
    pub type ZonedDateTime;

    #[wasm_bindgen(static_method_of = ZonedDateTime, js_namespace = Temporal)]
    pub fn from(val: &JsValue) -> ZonedDateTime;

    #[wasm_bindgen(static_method_of = ZonedDateTime, js_namespace = Temporal)]
    pub fn compare(one: &ZonedDateTime, two: &ZonedDateTime) -> i32;

    #[wasm_bindgen(method, getter, structural)]
    pub fn year(this: &ZonedDateTime) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn month(this: &ZonedDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn week(this: &ZonedDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn day(this: &ZonedDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn hour(this: &ZonedDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn minute(this: &ZonedDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn second(this: &ZonedDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn millisecond(this: &ZonedDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn microsecond(this: &ZonedDateTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn nanosecond(this: &ZonedDateTime) -> u32;

    #[wasm_bindgen(method, getter, structural, js_name = epochSeconds)]
    pub fn epoch_seconds(this: &ZonedDateTime) -> u64;
    #[wasm_bindgen(method, getter, structural, js_name = epochMilliseconds)]
    pub fn epoch_milliseconds(this: &ZonedDateTime) -> u64;
    #[wasm_bindgen(method, getter, structural, js_name = epochMicroseconds)]
    pub fn epoch_microseconds(this: &ZonedDateTime) -> BigInt;
    #[wasm_bindgen(method, getter, structural, js_name = epochNanoseconds)]
    pub fn epoch_nanoseconds(this: &ZonedDateTime) -> BigInt;

    /// In calendars that use eras, the era and eraYear read-only properties can be used
    /// together to resolve an era-relative year. Both properties are undefined when using
    /// the ISO 8601 calendar. As inputs to from or with, era and eraYear can be used instead
    /// of year. Unlike year, eraYear may decrease as time proceeds because some
    /// eras (like the BCE era in the Gregorian calendar) count years backwards.
    #[wasm_bindgen(method, getter, structural, js_name = eraYear)]
    pub fn era_year(this: &ZonedDateTime) -> JsValue;

    /// In calendars that use eras, the era and eraYear read-only properties can be used
    /// together to resolve an era-relative year. Both properties are undefined when using
    /// the ISO 8601 calendar. As inputs to from or with, era and eraYear can be used instead
    /// of year. Unlike year, eraYear may decrease as time proceeds because some
    /// eras (like the BCE era in the Gregorian calendar) count years backwards.
    #[wasm_bindgen(method, getter, structural)]
    pub fn era(this: &ZonedDateTime) -> JsValue;

    /// The dayOfWeek read-only property gives the weekday number that the date falls
    /// on. For the ISO 8601 calendar, the weekday number is defined as in the ISO 8601
    /// standard: a value between 1 and 7, inclusive, with Monday being 1, and Sunday 7.
    #[wasm_bindgen(method, getter, structural, js_name = dayOfWeek)]
    pub fn day_of_week(this: &ZonedDateTime) -> u32;

    /// The dayOfYear read-only property gives the ordinal day of the year that the date
    /// falls on. For the ISO 8601 calendar, this is a value between 1 and 365, or 366 in
    /// a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = dayOfYear)]
    pub fn day_of_year(this: &ZonedDateTime) -> u32;

    /// The weekOfYear read-only property gives the ISO week number of the date. For the
    /// ISO 8601 calendar, this is normally a value between 1 and 52, but in a few cases it
    /// can be 53 as well. ISO week 1 is the week containing the first Thursday of the year.
    #[wasm_bindgen(method, getter, structural, js_name = weekOfYear)]
    pub fn week_of_year(this: &ZonedDateTime) -> u32;

    /// The daysInWeek read-only property gives the number of days in the week that the
    /// date falls in. For the ISO 8601 calendar, this is always 7, but in other calendar
    /// systems it may differ from week to week.
    #[wasm_bindgen(method, getter, structural, js_name = daysInWeek)]
    pub fn days_in_week(this: &ZonedDateTime) -> u32;

    /// The daysInMonth read-only property gives the number of days in the month that the
    /// date falls in. For the ISO 8601 calendar, this is 28, 29, 30, or 31, depending
    /// on the month and whether the year is a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = daysInMonth)]
    pub fn days_in_month(this: &ZonedDateTime) -> u32;

    /// The daysInYear read-only property gives the number of days in the year that the date
    /// falls in. For the ISO 8601 calendar, this is 365 or 366, depending on whether the year
    /// is a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = daysInYear)]
    pub fn days_in_year(this: &ZonedDateTime) -> u32;

    /// The monthsInYear read-only property gives the number of months in the year that the date
    /// falls in. For the ISO 8601 calendar, this is always 12, but in other calendar systems
    /// it may differ from year to year.
    #[wasm_bindgen(method, getter, structural, js_name = monthsInWeek)]
    pub fn months_in_year(this: &ZonedDateTime) -> u32;

    /// The inLeapYear read-only property tells whether the year that the date falls in is a
    /// leap year or not. Its value is true if the year is a leap year, and false if not.
    #[wasm_bindgen(method, getter, structural, js_name = inLeapYear)]
    pub fn in_leap_year(this: &ZonedDateTime) -> bool;

    /// The `hoursInDay` read-only property returns the number of real-world hours
    /// between the start of the current day (usually midnight) in zonedDateTime.timeZone to
    /// the start of the next calendar day in the same time zone. Normally days will be 24 hours
    /// long, but on days where there are DST changes or other time zone transitions, this
    /// property may return 23 or 25. In rare cases, other integers or even non-integer
    /// values may be returned, e.g. when time zone definitions change by less than one hour.
    #[wasm_bindgen(method, getter, structural, js_name = inLeapYear)]
    pub fn hours_in_day(this: &ZonedDateTime) -> u32;

    #[wasm_bindgen(method, getter, structural, js_name = startOfDay)]
    pub fn start_of_day(this: &ZonedDateTime) -> ZonedDateTime;

    /// The offset read-only property is the offset (formatted as a string) relative
    /// to UTC of the current time zone and exact instant. Examples: '-08:00' or '+05:30'
    #[wasm_bindgen(method, getter, structural)]
    pub fn offset(this: &ZonedDateTime) -> JsString;

    /// This method creates a new Temporal.ZonedDateTime which is a copy of zonedDateTime, but any
    /// properties present on parameter override the ones already present on zonedDateTime.
    #[wasm_bindgen(method, js_name = withPlainDate)]
    pub fn with(this: &ZonedDateTime, parameter: &JsValue, options: &JsValue) -> ZonedDateTime;

    /// Returns a new `Temporal.ZonedDateTime` object which replaces the calendar date of zonedDateTime
    /// with the calendar date represented by plainDate.
    #[wasm_bindgen(method, js_name = withPlainDate)]
    pub fn with_plain_date(this: &ZonedDateTime, date: &PlainDate) -> ZonedDateTime;

    /// Returns a new `Temporal.ZonedDateTime` object which is the date indicated by date, projected
    /// into calendar.
    #[wasm_bindgen(method, js_name = withCalendar)]
    pub fn with_calendar(this: &ZonedDateTime, calendar: &str) -> ZonedDateTime;

    /// This method adds duration to zonedDateTime.
    #[wasm_bindgen(method)]
    pub fn add(this: &ZonedDateTime, duration: &Duration, options: &JsValue) -> ZonedDateTime;

    /// This method subtracts duration to zonedDateTime.
    #[wasm_bindgen(method)]
    pub fn subtract(this: &ZonedDateTime, duration: &Duration, options: &JsValue) -> ZonedDateTime;

    /// This method computes the difference between the two times represented by zonedDateTime and
    /// other, optionally rounds it, and returns it as a Temporal.Duration object. If other is earlier
    /// than zonedDateTime then the resulting duration will be negative. The returned Temporal.Duration, when
    /// added to zonedDateTime with the same options, will yield other.
    #[wasm_bindgen(method)]
    pub fn until(this: &ZonedDateTime, other: &ZonedDateTime, options: &JsValue) -> Duration;

    /// This method computes the difference between the two times represented by zonedDateTime and
    /// other, optionally rounds it, and returns it as a Temporal.Duration object. If other is later
    /// than zonedDateTime then the resulting duration will be negative. The returned Temporal.Duration, when
    /// added to zonedDateTime with the same options, will yield other.    
    #[wasm_bindgen(method)]
    pub fn since(this: &ZonedDateTime, other: &ZonedDateTime, options: &JsValue) -> Duration;

    /// Returns a new Temporal.ZonedDateTime object which is zonedDateTime rounded to `roundTo` (if
    /// a string parameter is used) or `roundingIncrement` of `smallestUnit` (if an object parameter
    /// is used).
    #[wasm_bindgen(method)]
    pub fn round(this: &ZonedDateTime, round_to: &JsValue) -> ZonedDateTime;

    #[wasm_bindgen(method)]
    pub fn equals(this: &ZonedDateTime, other: &ZonedDateTime) -> bool;

    /// Returns: a plain object with properties expressing zonedDateTime in the ISO 8601 calendar, including
    /// all date/time fields as well as the calendar, timeZone, and offset properties.
    ///
    /// This is an advanced method that's mainly useful if you are implementing a custom calendar. Most
    /// developers will not need to use it.
    #[wasm_bindgen(method, js_name = getISOFields)]
    pub fn get_iso_fields(this: &ZonedDateTime) -> JsValue;
}

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen(js_namespace = Temporal, extends = Object)]
    #[derive(Clone, Debug)]
    pub type Duration;

    #[wasm_bindgen(static_method_of = Duration, js_namespace = Temporal)]
    pub fn from(val: &JsValue) -> Duration;

    #[wasm_bindgen(static_method_of = Duration, js_namespace = Temporal)]
    pub fn compare(one: &Duration, two: &Duration) -> i32;

    #[wasm_bindgen(method, getter, structural)]
    pub fn years(this: &Duration) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn months(this: &Duration) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn weeks(this: &Duration) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn days(this: &Duration) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn hours(this: &Duration) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn minutes(this: &Duration) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn seconds(this: &Duration) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn milliseconds(this: &Duration) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn microseconds(this: &Duration) -> i32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn nanoseconds(this: &Duration) -> i32;

    /// The read-only `sign` property has the value –1, 0, or 1, depending on whether
    /// the duration is negative, zero, or positive.
    #[wasm_bindgen(method, getter, structural)]
    pub fn sign(this: &Duration) -> i32;

    /// The read-only `blank` property is a convenience property that tells whether duration
    /// represents a zero length of time. In other words, `duration.blank === (duration.sign === 0)`.
    #[wasm_bindgen(method, getter, structural)]
    pub fn blank(this: &Duration) -> bool;

    /// In order to be valid, the resulting duration must not have fields with mixed signs, and
    /// so the result is balanced. For usage examples and a more complete explanation of how
    /// balancing works and why it is necessary, see [Duration balancing].
    ///
    /// [Duration balancing]: https://tc39.es/proposal-temporal/docs/balancing.html
    #[wasm_bindgen(method)]
    pub fn add(this: &Duration, other: &Duration, options: &JsValue) -> Duration;

    /// In order to be valid, the resulting duration must not have fields with mixed signs, and
    /// so the result is balanced. For usage examples and a more complete explanation of how
    /// balancing works and why it is necessary, see [Duration balancing].
    ///
    /// [Duration balancing]: https://tc39.es/proposal-temporal/docs/balancing.html
    #[wasm_bindgen(method)]
    pub fn subtract(this: &Duration, other: &Duration, options: &JsValue) -> Duration;

    /// This method gives the absolute value of duration. It returns a newly constructed
    /// `Temporal.Duration` with all the fields having the same magnitude as those of
    /// duration, but positive. If duration is already positive or zero, then the returned
    /// object is a copy of duration.
    #[wasm_bindgen(method)]
    pub fn abs(this: &Duration) -> Duration;

    /// Rounds and/or balances duration to the given largest and smallest units and rounding
    /// increment, and returns the result as a new `Temporal.Duration` object.
    #[wasm_bindgen(method)]
    pub fn round(this: &Duration, round_to: &JsValue) -> Duration;

    /// Calculates the number of units of time that can fit in a particular `Temporal.Duration`.
    /// If the duration IS NOT evenly divisible by the desired unit, then a fractional remainder
    /// will be present in the result. If the duration IS evenly divisible by the desired
    /// unit, then the integer result will be identical
    /// to `duration.round({ smallestUnit: unit, largestUnit: unit, relativeTo })[unit]`
    #[wasm_bindgen(method)]
    pub fn total(this: &Duration, total_of: &JsValue) -> f64;

    /// This method overrides `Object.prototype.toString()` and provides the ISO 8601
    /// description of the duration.
    #[wasm_bindgen(method, js_name = toString)]
    pub fn to_string(this: &Duration, options: &JsValue) -> JsString;

    /// This method is the same as duration.toString(). It is usually not called directly, but
    /// it can be called automatically by JSON.stringify().
    #[wasm_bindgen(method, js_name = toJson)]
    pub fn to_json(this: &Duration) -> JsString;

    /// This method overrides `Object.prototype.toLocaleString()` to provide a human-readable,
    /// language-sensitive representation of duration.
    ///
    /// The locales and options arguments are the same as in the constructor to Intl.DurationFormat.
    #[wasm_bindgen(method, js_name = toLocaleString)]
    pub fn to_locale_string(this: &Duration, locales: &JsValue, options: &JsValue) -> JsString;

}

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen(js_namespace = Temporal, extends = Object)]
    #[derive(Clone, Debug)]
    pub type PlainTime;

    #[wasm_bindgen(static_method_of = PlainTime, js_namespace = Temporal)]
    pub fn from(val: &JsValue) -> PlainTime;

    #[wasm_bindgen(static_method_of = PlainTime, js_namespace = Temporal)]
    pub fn compare(one: &PlainTime, two: &PlainTime) -> i32;

    #[wasm_bindgen(method, getter, structural)]
    pub fn hour(this: &PlainTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn minute(this: &PlainTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn second(this: &PlainTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn millisecond(this: &PlainTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn microsecond(this: &PlainTime) -> u32;
    #[wasm_bindgen(method, getter, structural)]
    pub fn nanosecond(this: &PlainTime) -> u32;

    /// This method adds duration to PlainTime.
    #[wasm_bindgen(method)]
    pub fn add(this: &PlainTime, duration: &Duration, options: &JsValue) -> PlainTime;

    /// This method subtracts duration to PlainTime.
    #[wasm_bindgen(method)]
    pub fn subtract(this: &PlainTime, duration: &Duration, options: &JsValue) -> PlainTime;

    /// This method computes the difference between the two times represented by PlainTime and
    /// other, optionally rounds it, and returns it as a Temporal.Duration object. If other is earlier
    /// than zonedDateTime then the resulting duration will be negative. The returned Temporal.Duration, when
    /// added to zonedDateTime with the same options, will yield other.
    #[wasm_bindgen(method)]
    pub fn until(this: &PlainTime, other: &PlainTime, options: &JsValue) -> Duration;

    /// This method computes the difference between the two times represented by PlainTime and
    /// other, optionally rounds it, and returns it as a Temporal.Duration object. If other is later
    /// than zonedDateTime then the resulting duration will be negative. The returned Temporal.Duration, when
    /// added to zonedDateTime with the same options, will yield other.    
    #[wasm_bindgen(method)]
    pub fn since(this: &PlainTime, other: &PlainTime, options: &JsValue) -> Duration;

    /// Returns a new Temporal.ZonedDateTime object which is PlainTime rounded to `roundTo` (if
    /// a string parameter is used) or `roundingIncrement` of `smallestUnit` (if an object parameter
    /// is used).
    #[wasm_bindgen(method)]
    pub fn round(this: &PlainTime, round_to: &JsValue) -> PlainTime;

    #[wasm_bindgen(method)]
    pub fn equals(this: &PlainTime, other: &PlainTime) -> bool;

    /// This method overrides `Object.prototype.toLocaleString()` to provide a human-readable,
    /// language-sensitive representation of duration.
    ///
    /// The locales and options arguments are the same as in the constructor to Intl.DateTimeFormat.
    #[wasm_bindgen(method, js_name = toLocaleString)]
    pub fn to_locale_string(this: &PlainTime, locales: &JsValue, options: &JsValue) -> JsString;

    /// Returns: a plain object with properties expressing PlainTime in the ISO 8601 calendar, including
    /// all date/time fields as well as the calendar, timeZone, and offset properties.
    ///
    /// This is an advanced method that's mainly useful if you are implementing a custom calendar. Most
    /// developers will not need to use it.
    #[wasm_bindgen(method, js_name = getISOFields)]
    pub fn get_iso_fields(this: &PlainTime) -> JsValue;

}

#[wasm_bindgen]
extern "C" {
    /// A Temporal.PlainYearMonth represents a particular month on the calendar. For example, it
    /// could be used to represent a particular instance of a monthly recurring event, like "the
    /// June 2019 meeting".
    #[wasm_bindgen(js_namespace = Temporal, extends = Object)]
    #[derive(Clone, Debug)]
    pub type PlainYearMonth;

    #[wasm_bindgen(static_method_of = PlainYearMonth, js_namespace = Temporal)]
    pub fn from(val: &JsValue) -> PlainYearMonth;

    #[wasm_bindgen(static_method_of = PlainYearMonth, js_namespace = Temporal)]
    pub fn compare(one: &PlainYearMonth, two: &PlainYearMonth) -> i32;

    /// `year` is a signed integer representing the number of years relative to a
    /// calendar-specific epoch. For calendars that use eras, the anchor is usually
    /// aligned with the latest era so that eraYear === year for all dates in that
    /// era. However, some calendars like Japanese may use a different anchor.
    #[wasm_bindgen(method, getter, structural)]
    pub fn year(this: &PlainYearMonth) -> i32;

    /// `month` is a positive integer representing the ordinal index of the month in
    /// the current year. For calendars like Hebrew or Chinese that use leap
    /// months, the same-named month may have a different month value depending on
    /// the year. The first month in every year has month equal to 1. The last month
    /// of every year has month equal to the monthsInYear property. month values
    /// start at 1, which is different from legacy Date where months are represented
    /// by zero-based indices (0 to 11).
    #[wasm_bindgen(method, getter, structural)]
    pub fn month(this: &PlainYearMonth) -> u32;

    /// `monthCode` is a calendar-specific string that identifies the month in
    /// a year-independent way. For common (non-leap) months, monthCode should
    /// be `M${month}`, where month is zero padded up to two digits. For uncommon
    /// (leap) months in lunisolar calendars like Hebrew or Chinese, the month code
    /// is the previous month's code with with an "L" suffix appended.
    /// Examples:
    /// * 'M02' => February;
    /// * 'M08L' => repeated 8th month in the Chinese calendar;
    /// * 'M05L' => Adar I in the Hebrew calendar.
    #[wasm_bindgen(method, getter, structural, js_name = monthCode)]
    pub fn month_code(this: &PlainYearMonth) -> JsString;

    /// In calendars that use eras, the era and eraYear read-only properties can be used
    /// together to resolve an era-relative year. Both properties are undefined when using
    /// the ISO 8601 calendar. As inputs to from or with, era and eraYear can be used instead
    /// of year. Unlike year, eraYear may decrease as time proceeds because some
    /// eras (like the BCE era in the Gregorian calendar) count years backwards.
    #[wasm_bindgen(method, getter, structural, js_name = eraYear)]
    pub fn era_year(this: &PlainYearMonth) -> JsValue;

    /// In calendars that use eras, the era and eraYear read-only properties can be used
    /// together to resolve an era-relative year. Both properties are undefined when using
    /// the ISO 8601 calendar. As inputs to from or with, era and eraYear can be used instead
    /// of year. Unlike year, eraYear may decrease as time proceeds because some
    /// eras (like the BCE era in the Gregorian calendar) count years backwards.
    #[wasm_bindgen(method, getter, structural)]
    pub fn era(this: &PlainYearMonth) -> JsValue;

    /// The daysInMonth read-only property gives the number of days in the month that the
    /// date falls in. For the ISO 8601 calendar, this is 28, 29, 30, or 31, depending
    /// on the month and whether the year is a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = daysInMonth)]
    pub fn days_in_month(this: &PlainYearMonth) -> u32;

    /// The daysInYear read-only property gives the number of days in the year that the date
    /// falls in. For the ISO 8601 calendar, this is 365 or 366, depending on whether the year
    /// is a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = daysInYear)]
    pub fn days_in_year(this: &PlainYearMonth) -> u32;

    /// The monthsInYear read-only property gives the number of months in the year that the date
    /// falls in. For the ISO 8601 calendar, this is always 12, but in other calendar systems
    /// it may differ from year to year.
    #[wasm_bindgen(method, getter, structural, js_name = monthsInWeek)]
    pub fn months_in_year(this: &PlainYearMonth) -> u32;

    /// The inLeapYear read-only property tells whether the year that the date falls in is a
    /// leap year or not. Its value is true if the year is a leap year, and false if not.
    #[wasm_bindgen(method, getter, structural, js_name = inLeapYear)]
    pub fn in_leap_year(this: &PlainYearMonth) -> bool;

    /// **Parameters:**
    ///
    ///- `duration` (`Temporal.Duration` or value convertible to one): The duration to add.
    ///- `options` (optional object): An object with properties representing options for the addition.
    ///The following options are recognized:
    ///- `overflow` (optional string): How to deal with additions that result in out-of-range values.
    ///    Allowed values are `constrain` and `reject`.
    ///    The default is `constrain`.
    ///
    ///**Returns:** a new `Temporal.PlainYearMonth` object which is the date indicated by `date` plus `duration`.
    ///
    ///This method adds `duration` to `date`, returning a date that is in the future relative to `date`.
    ///
    ///The `duration` argument is an object with properties denoting a duration, such as `{ days: 5 }`, or a string such as `P5D`, or a `Temporal.Duration` object.
    ///If `duration` is not a `Temporal.Duration` object, then it will be converted to one as if it were passed to `Temporal.Duration.from()`.
    ///
    ///Some additions may be ambiguous, because months have different lengths.
    ///For example, adding one month to August 31 would result in September 31, which doesn't exist.
    ///For these cases, the `overflow` option tells what to do:
    ///
    ///- In `constrain` mode (the default), out-of-range values are clamped to the nearest in-range value.
    ///- In `reject` mode, an addition that would result in an out-of-range value fails, and a `RangeError` is thrown.
    ///
    ///Additionally, if the result is earlier or later than the range of dates that `Temporal.PlainYearMonth` can represent (approximately half a million years centered on the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time)), then this method will throw a `RangeError` regardless of `overflow`.
    ///
    ///Adding a negative duration is equivalent to subtracting the absolute value of that duration.
    #[wasm_bindgen(method)]
    pub fn add(this: &PlainYearMonth, duration: &Duration, options: &JsValue) -> PlainYearMonth;

    /// **Parameters:**
    ///- `duration` (`Temporal.Duration` or value convertible to one): The duration to subtract.
    ///- `options` (optional object): An object with properties representing options for the subtraction.
    ///The following options are recognized:
    ///- `overflow` (string): How to deal with subtractions that result in out-of-range values.
    ///    Allowed values are `constrain` and `reject`.
    ///    The default is `constrain`.
    ///
    ///**Returns:** a new `Temporal.PlainYearMonth` object which is the date indicated by `date` minus `duration`.
    ///
    ///This method subtracts `duration` from `date`, returning a date that is in the past relative to `date`.
    ///
    ///The `duration` argument is an object with properties denoting a duration, such as `{ days: 5 }`, or a string such as `P5D`, or a `Temporal.Duration` object.
    ///If `duration` is not a `Temporal.Duration` object, then it will be converted to one as if it were passed to `Temporal.Duration.from()`.
    ///
    ///Some subtractions may be ambiguous, because months have different lengths.
    ///For example, subtracting one month from July 31 would result in June 31, which doesn't exist.
    ///For these cases, the `overflow` option tells what to do:
    ///
    ///- In `constrain` mode (the default), out-of-range values are clamped to the nearest in-range value.
    ///- In `reject` mode, an addition that would result in an out-of-range value fails, and a `RangeError` is thrown.
    ///
    ///Additionally, if the result is earlier or later than the range of dates that `Temporal.PlainDate` can represent (approximately half a million years centered on the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time)), then this method will throw a `RangeError` regardless of `overflow`.
    ///
    ///Subtracting a negative duration is equivalent to adding the absolute value of that duration.
    ///
    #[wasm_bindgen(method)]
    pub fn subtract(
        this: &PlainYearMonth,
        duration: &Duration,
        options: &JsValue,
    ) -> PlainYearMonth;

    /// This function exists because it's not possible to compare using date == other
    /// or date === other, due to ambiguity in the primitive representation and between
    /// Temporal types.
    ///
    /// If you don't need to know the order in which the two dates occur, then this function
    /// may be less typing and more efficient than Temporal.PlainDate.compare.
    #[wasm_bindgen(method)]
    pub fn equals(this: &PlainYearMonth, other: &PlainYearMonth) -> bool;

    /// This method overrides the Object.prototype.toString() method and provides a convenient, unambiguous
    /// string representation of date. The string can be passed to Temporal.PlainYearMonth.from() to
    /// create a new Temporal.PlainDate object.
    #[wasm_bindgen(method, js_name = toString)]
    pub fn to_string(this: &PlainYearMonth) -> JsString;

    /// This method overrides `Object.prototype.toLocaleString()` to provide a human-readable,
    /// language-sensitive representation of duration.
    ///
    /// The locales and options arguments are the same as in the constructor to Intl.DateTimeFormat.
    #[wasm_bindgen(method, js_name = toLocaleString)]
    pub fn to_locale_string(
        this: &PlainYearMonth,
        locales: &JsValue,
        options: &JsValue,
    ) -> JsString;

    /// Returns: a plain object with properties expressing date in the ISO 8601
    /// calendar, as well as the value of date.calendar.
    ///
    /// This method is mainly useful if you are implementing a custom calendar. Most
    /// code will not need to use it.
    #[wasm_bindgen(method, js_name = getISOFields)]
    pub fn get_iso_fields(this: &PlainYearMonth) -> JsValue;

}

#[wasm_bindgen]
extern "C" {
    /// A date without a year component. This is useful to express
    /// things like "Bastille Day is on the 14th of July".
    #[wasm_bindgen(js_namespace = Temporal, extends = Object)]
    #[derive(Clone, Debug)]
    pub type PlainMonthDay;

    #[wasm_bindgen(static_method_of = PlainMonthDay, js_namespace = Temporal)]
    pub fn from(val: &JsValue) -> PlainMonthDay;

    #[wasm_bindgen(static_method_of = PlainMonthDay, js_namespace = Temporal)]
    pub fn compare(one: &PlainMonthDay, two: &PlainMonthDay) -> i32;

    /// `monthCode` is a calendar-specific string that identifies the month in
    /// a year-independent way. For common (non-leap) months, monthCode should
    /// be `M${month}`, where month is zero padded up to two digits. For uncommon
    /// (leap) months in lunisolar calendars like Hebrew or Chinese, the month code
    /// is the previous month's code with with an "L" suffix appended.
    /// Examples:
    /// * 'M02' => February;
    /// * 'M08L' => repeated 8th month in the Chinese calendar;
    /// * 'M05L' => Adar I in the Hebrew calendar.
    ///
    /// Note that this type has no month property, because month is ambiguous for some
    /// calendars without knowing the year. Instead, the monthCode property is used which
    /// is year-independent in all calendars.
    #[wasm_bindgen(method, getter, structural, js_name = monthCode)]
    pub fn month_code(this: &PlainMonthDay) -> JsString;

    /// day is a positive integer representing the day of the month.
    #[wasm_bindgen(method, getter, structural)]
    pub fn day(this: &PlainMonthDay) -> u32;

    /// This function exists because it's not possible to compare using date == other
    /// or date === other, due to ambiguity in the primitive representation and between
    /// Temporal types.
    ///
    /// If you don't need to know the order in which the two dates occur, then this function
    /// may be less typing and more efficient than Temporal.PlainMonthDay.compare.
    ///
    /// Note that this function will return false if the two objects have different calendar
    /// properties, even if the actual dates are equal.
    #[wasm_bindgen(method)]
    pub fn equals(this: &PlainMonthDay, other: &PlainMonthDay) -> bool;

    /// This method overrides the Object.prototype.toString() method and provides a convenient, unambiguous
    /// string representation of date. The string can be passed to Temporal.PlainMonthDay.from() to
    /// create a new Temporal.PlainMonthDay object.
    #[wasm_bindgen(method, js_name = toString)]
    pub fn to_string(this: &PlainMonthDay) -> JsString;

    /// This method overrides `Object.prototype.toLocaleString()` to provide a human-readable,
    /// language-sensitive representation of duration.
    ///
    /// The locales and options arguments are the same as in the constructor to Intl.DateTimeFormat.
    #[wasm_bindgen(method, js_name = toLocaleString)]
    pub fn to_locale_string(this: &PlainMonthDay, locales: &JsValue, options: &JsValue)
        -> JsString;

    /// Returns: a plain object with properties expressing date in the ISO 8601
    /// calendar, as well as the value of date.calendar.
    ///
    /// This method is mainly useful if you are implementing a custom calendar. Most
    /// code will not need to use it.
    #[wasm_bindgen(method, js_name = getISOFields)]
    pub fn get_iso_fields(this: &PlainMonthDay) -> JsValue;

}

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen(js_namespace = Temporal, extends = Object)]
    #[derive(Clone, Debug)]
    pub type PlainDate;

    #[wasm_bindgen(js_namespace = Temporal, constructor)]
    pub fn new(year: i32, month: u32, day: u32) -> PlainDate;

    #[wasm_bindgen(static_method_of = PlainDate, js_namespace = Temporal)]
    pub fn from(val: &JsValue) -> PlainDate;

    #[wasm_bindgen(static_method_of = PlainDate, js_namespace = Temporal)]
    pub fn compare(one: &PlainDate, two: &PlainDate) -> i32;

    /// `year` is a signed integer representing the number of years relative to a
    /// calendar-specific epoch. For calendars that use eras, the anchor is usually
    /// aligned with the latest era so that eraYear === year for all dates in that
    /// era. However, some calendars like Japanese may use a different anchor.
    #[wasm_bindgen(method, getter, structural)]
    pub fn year(this: &PlainDate) -> i32;

    /// `month` is a positive integer representing the ordinal index of the month in
    /// the current year. For calendars like Hebrew or Chinese that use leap
    /// months, the same-named month may have a different month value depending on
    /// the year. The first month in every year has month equal to 1. The last month
    /// of every year has month equal to the monthsInYear property. month values
    /// start at 1, which is different from legacy Date where months are represented
    /// by zero-based indices (0 to 11).
    #[wasm_bindgen(method, getter, structural)]
    pub fn month(this: &PlainDate) -> u32;

    /// `monthCode` is a calendar-specific string that identifies the month in
    /// a year-independent way. For common (non-leap) months, monthCode should
    /// be `M${month}`, where month is zero padded up to two digits. For uncommon
    /// (leap) months in lunisolar calendars like Hebrew or Chinese, the month code
    /// is the previous month's code with with an "L" suffix appended.
    /// Examples:
    /// * 'M02' => February;
    /// * 'M08L' => repeated 8th month in the Chinese calendar;
    /// * 'M05L' => Adar I in the Hebrew calendar.
    #[wasm_bindgen(method, getter, structural, js_name = monthCode)]
    pub fn month_code(this: &PlainDate) -> JsString;

    /// day is a positive integer representing the day of the month.
    #[wasm_bindgen(method, getter, structural)]
    pub fn day(this: &PlainDate) -> u32;

    /// In calendars that use eras, the era and eraYear read-only properties can be used
    /// together to resolve an era-relative year. Both properties are undefined when using
    /// the ISO 8601 calendar. As inputs to from or with, era and eraYear can be used instead
    /// of year. Unlike year, eraYear may decrease as time proceeds because some
    /// eras (like the BCE era in the Gregorian calendar) count years backwards.
    #[wasm_bindgen(method, getter, structural, js_name = eraYear)]
    pub fn era_year(this: &PlainDate) -> JsValue;

    /// In calendars that use eras, the era and eraYear read-only properties can be used
    /// together to resolve an era-relative year. Both properties are undefined when using
    /// the ISO 8601 calendar. As inputs to from or with, era and eraYear can be used instead
    /// of year. Unlike year, eraYear may decrease as time proceeds because some
    /// eras (like the BCE era in the Gregorian calendar) count years backwards.
    #[wasm_bindgen(method, getter, structural)]
    pub fn era(this: &PlainDate) -> JsValue;

    /// The dayOfWeek read-only property gives the weekday number that the date falls
    /// on. For the ISO 8601 calendar, the weekday number is defined as in the ISO 8601
    /// standard: a value between 1 and 7, inclusive, with Monday being 1, and Sunday 7.
    #[wasm_bindgen(method, getter, structural, js_name = dayOfWeek)]
    pub fn day_of_week(this: &PlainDate) -> u32;

    /// The dayOfYear read-only property gives the ordinal day of the year that the date
    /// falls on. For the ISO 8601 calendar, this is a value between 1 and 365, or 366 in
    /// a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = dayOfYear)]
    pub fn day_of_year(this: &PlainDate) -> u32;

    /// The weekOfYear read-only property gives the ISO week number of the date. For the
    /// ISO 8601 calendar, this is normally a value between 1 and 52, but in a few cases it
    /// can be 53 as well. ISO week 1 is the week containing the first Thursday of the year.
    #[wasm_bindgen(method, getter, structural, js_name = weekOfYear)]
    pub fn week_of_year(this: &PlainDate) -> u32;

    /// The daysInWeek read-only property gives the number of days in the week that the
    /// date falls in. For the ISO 8601 calendar, this is always 7, but in other calendar
    /// systems it may differ from week to week.
    #[wasm_bindgen(method, getter, structural, js_name = daysInWeek)]
    pub fn days_in_week(this: &PlainDate) -> u32;

    /// The daysInMonth read-only property gives the number of days in the month that the
    /// date falls in. For the ISO 8601 calendar, this is 28, 29, 30, or 31, depending
    /// on the month and whether the year is a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = daysInMonth)]
    pub fn days_in_month(this: &PlainDate) -> u32;

    /// The daysInYear read-only property gives the number of days in the year that the date
    /// falls in. For the ISO 8601 calendar, this is 365 or 366, depending on whether the year
    /// is a leap year.
    #[wasm_bindgen(method, getter, structural, js_name = daysInYear)]
    pub fn days_in_year(this: &PlainDate) -> u32;

    /// The monthsInYear read-only property gives the number of months in the year that the date
    /// falls in. For the ISO 8601 calendar, this is always 12, but in other calendar systems
    /// it may differ from year to year.
    #[wasm_bindgen(method, getter, structural, js_name = monthsInWeek)]
    pub fn months_in_year(this: &PlainDate) -> u32;

    /// The inLeapYear read-only property tells whether the year that the date falls in is a
    /// leap year or not. Its value is true if the year is a leap year, and false if not.
    #[wasm_bindgen(method, getter, structural, js_name = inLeapYear)]
    pub fn in_leap_year(this: &PlainDate) -> bool;

    /// Returns a new `Temporal.PlainDate` object which is the date indicated by date, projected
    /// into calendar.
    #[wasm_bindgen(method, js_name = withCalendar)]
    pub fn with_calendar(this: &PlainDate, calendar: &str) -> PlainDate;

    /// **Parameters:**
    ///
    ///- `duration` (`Temporal.Duration` or value convertible to one): The duration to add.
    ///- `options` (optional object): An object with properties representing options for the addition.
    ///The following options are recognized:
    ///- `overflow` (optional string): How to deal with additions that result in out-of-range values.
    ///    Allowed values are `constrain` and `reject`.
    ///    The default is `constrain`.
    ///
    ///**Returns:** a new `Temporal.PlainDate` object which is the date indicated by `date` plus `duration`.
    ///
    ///This method adds `duration` to `date`, returning a date that is in the future relative to `date`.
    ///
    ///The `duration` argument is an object with properties denoting a duration, such as `{ days: 5 }`, or a string such as `P5D`, or a `Temporal.Duration` object.
    ///If `duration` is not a `Temporal.Duration` object, then it will be converted to one as if it were passed to `Temporal.Duration.from()`.
    ///
    ///Some additions may be ambiguous, because months have different lengths.
    ///For example, adding one month to August 31 would result in September 31, which doesn't exist.
    ///For these cases, the `overflow` option tells what to do:
    ///
    ///- In `constrain` mode (the default), out-of-range values are clamped to the nearest in-range value.
    ///- In `reject` mode, an addition that would result in an out-of-range value fails, and a `RangeError` is thrown.
    ///
    ///Additionally, if the result is earlier or later than the range of dates that `Temporal.PlainDate` can represent (approximately half a million years centered on the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time)), then this method will throw a `RangeError` regardless of `overflow`.
    ///
    ///Adding a negative duration is equivalent to subtracting the absolute value of that duration.
    #[wasm_bindgen(method)]
    pub fn add(this: &PlainDate, duration: &Duration, options: &JsValue) -> PlainDate;

    /// **Parameters:**
    ///- `duration` (`Temporal.Duration` or value convertible to one): The duration to subtract.
    ///- `options` (optional object): An object with properties representing options for the subtraction.
    ///The following options are recognized:
    ///- `overflow` (string): How to deal with subtractions that result in out-of-range values.
    ///    Allowed values are `constrain` and `reject`.
    ///    The default is `constrain`.
    ///
    ///**Returns:** a new `Temporal.PlainDate` object which is the date indicated by `date` minus `duration`.
    ///
    ///This method subtracts `duration` from `date`, returning a date that is in the past relative to `date`.
    ///
    ///The `duration` argument is an object with properties denoting a duration, such as `{ days: 5 }`, or a string such as `P5D`, or a `Temporal.Duration` object.
    ///If `duration` is not a `Temporal.Duration` object, then it will be converted to one as if it were passed to `Temporal.Duration.from()`.
    ///
    ///Some subtractions may be ambiguous, because months have different lengths.
    ///For example, subtracting one month from July 31 would result in June 31, which doesn't exist.
    ///For these cases, the `overflow` option tells what to do:
    ///
    ///- In `constrain` mode (the default), out-of-range values are clamped to the nearest in-range value.
    ///- In `reject` mode, an addition that would result in an out-of-range value fails, and a `RangeError` is thrown.
    ///
    ///Additionally, if the result is earlier or later than the range of dates that `Temporal.PlainDate` can represent (approximately half a million years centered on the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time)), then this method will throw a `RangeError` regardless of `overflow`.
    ///
    ///Subtracting a negative duration is equivalent to adding the absolute value of that duration.
    ///
    #[wasm_bindgen(method)]
    pub fn subtract(this: &PlainDate, duration: &Duration, options: &JsValue) -> PlainDate;

    /// This function exists because it's not possible to compare using date == other
    /// or date === other, due to ambiguity in the primitive representation and between
    /// Temporal types.
    ///
    /// If you don't need to know the order in which the two dates occur, then this function
    /// may be less typing and more efficient than Temporal.PlainDate.compare.
    ///
    /// Note that this function will return false if the two objects have different calendar
    /// properties, even if the actual dates are equal.
    #[wasm_bindgen(method)]
    pub fn equals(this: &PlainDate, other: &PlainDate) -> bool;

    /// This method overrides the Object.prototype.toString() method and provides a convenient, unambiguous
    /// string representation of date. The string can be passed to Temporal.PlainDate.from() to
    /// create a new Temporal.PlainDate object.
    #[wasm_bindgen(method, js_name = toString)]
    pub fn to_string(this: &PlainDate) -> JsString;

    /// This method overrides `Object.prototype.toLocaleString()` to provide a human-readable,
    /// language-sensitive representation of duration.
    ///
    /// The locales and options arguments are the same as in the constructor to Intl.DateTimeFormat.
    #[wasm_bindgen(method, js_name = toLocaleString)]
    pub fn to_locale_string(this: &PlainDate, locales: &JsValue, options: &JsValue) -> JsString;

    /// Returns: a plain object with properties expressing date in the ISO 8601
    /// calendar, as well as the value of date.calendar.
    ///
    /// This method is mainly useful if you are implementing a custom calendar. Most
    /// code will not need to use it.
    #[wasm_bindgen(method, js_name = getISOFields)]
    pub fn get_iso_fields(this: &PlainDate) -> JsValue;

}

pub mod Now {
    use super::*;

    #[wasm_bindgen]
    extern "C" {
        #[wasm_bindgen(js_namespace = ["Temporal", "Now"])]
        pub fn instant() -> Instant;

        #[wasm_bindgen(js_namespace = ["Temporal", "Now"], js_name = zonedDateTime)]
        pub fn zoned_date_time(calendar: &str) -> ZonedDateTime;

        #[wasm_bindgen(js_namespace = ["Temporal", "Now"], js_name = zonedDateTimeISO)]
        pub fn zoned_date_time_iso() -> ZonedDateTime;

        #[wasm_bindgen(js_namespace = ["Temporal", "Now"], js_name = plainDate)]
        pub fn plain_date(calendar: &str) -> PlainDate;

        #[wasm_bindgen(js_namespace = ["Temporal", "Now"], js_name = plainDateISO)]
        pub fn plain_date_iso() -> PlainDate;

        #[wasm_bindgen(js_namespace = ["Temporal", "Now"], js_name = plainTimeISO)]
        pub fn plain_time_iso() -> PlainTime;

    }
}