@math.gl/earth 0.0.0-stage → 5.0.0-alpha.20

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.
Files changed (271) hide show
  1. package/LICENSE +1015 -0
  2. package/README.md +19 -2
  3. package/THIRD-PARTY-NOTICES.md +25 -0
  4. package/dist/geoid/create-geoid-from-grid.d.ts +15 -0
  5. package/dist/geoid/create-geoid-from-grid.d.ts.map +1 -0
  6. package/dist/geoid/create-geoid-from-grid.js +38 -0
  7. package/dist/geoid/create-geoid-from-grid.js.map +1 -0
  8. package/dist/geoid/geoid.d.ts +60 -0
  9. package/dist/geoid/geoid.d.ts.map +1 -0
  10. package/dist/geoid/geoid.js +261 -0
  11. package/dist/geoid/geoid.js.map +1 -0
  12. package/dist/geoid/index.cjs +727 -0
  13. package/dist/geoid/index.cjs.map +6 -0
  14. package/dist/geoid/index.d.ts +5 -0
  15. package/dist/geoid/index.d.ts.map +1 -0
  16. package/dist/geoid/index.js +7 -0
  17. package/dist/geoid/index.js.map +1 -0
  18. package/dist/geoid/parse-pgm.d.ts +12 -0
  19. package/dist/geoid/parse-pgm.d.ts.map +1 -0
  20. package/dist/geoid/parse-pgm.js +183 -0
  21. package/dist/geoid/parse-pgm.js.map +1 -0
  22. package/dist/index.cjs +2646 -0
  23. package/dist/index.cjs.map +6 -0
  24. package/dist/index.d.ts +4 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +7 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/sun/astronomy.cjs +1729 -0
  29. package/dist/sun/astronomy.cjs.map +6 -0
  30. package/dist/sun/astronomy.d.ts +359 -0
  31. package/dist/sun/astronomy.d.ts.map +1 -0
  32. package/dist/sun/astronomy.js +181 -0
  33. package/dist/sun/astronomy.js.map +1 -0
  34. package/dist/sun/celestial.d.ts +4 -0
  35. package/dist/sun/celestial.d.ts.map +1 -0
  36. package/dist/sun/celestial.js +18 -0
  37. package/dist/sun/celestial.js.map +1 -0
  38. package/dist/sun/cloud-lighting.d.ts +49 -0
  39. package/dist/sun/cloud-lighting.d.ts.map +1 -0
  40. package/dist/sun/cloud-lighting.js +121 -0
  41. package/dist/sun/cloud-lighting.js.map +1 -0
  42. package/dist/sun/cloud-spectral.d.ts +3 -0
  43. package/dist/sun/cloud-spectral.d.ts.map +1 -0
  44. package/dist/sun/cloud-spectral.js +45 -0
  45. package/dist/sun/cloud-spectral.js.map +1 -0
  46. package/dist/sun/data/bright-stars.d.ts +3 -0
  47. package/dist/sun/data/bright-stars.d.ts.map +1 -0
  48. package/dist/sun/data/bright-stars.js +7015 -0
  49. package/dist/sun/data/bright-stars.js.map +1 -0
  50. package/dist/sun/data/sunlight.d.ts +2 -0
  51. package/dist/sun/data/sunlight.d.ts.map +1 -0
  52. package/dist/sun/data/sunlight.js +970 -0
  53. package/dist/sun/data/sunlight.js.map +1 -0
  54. package/dist/sun/index.cjs +1744 -0
  55. package/dist/sun/index.cjs.map +6 -0
  56. package/dist/sun/index.d.ts +23 -0
  57. package/dist/sun/index.d.ts.map +1 -0
  58. package/dist/sun/index.js +17 -0
  59. package/dist/sun/index.js.map +1 -0
  60. package/dist/sun/moon-appearance.d.ts +25 -0
  61. package/dist/sun/moon-appearance.d.ts.map +1 -0
  62. package/dist/sun/moon-appearance.js +50 -0
  63. package/dist/sun/moon-appearance.js.map +1 -0
  64. package/dist/sun/moon-sky-brightness.d.ts +7 -0
  65. package/dist/sun/moon-sky-brightness.d.ts.map +1 -0
  66. package/dist/sun/moon-sky-brightness.js +50 -0
  67. package/dist/sun/moon-sky-brightness.js.map +1 -0
  68. package/dist/sun/moon.d.ts +26 -0
  69. package/dist/sun/moon.d.ts.map +1 -0
  70. package/dist/sun/moon.js +74 -0
  71. package/dist/sun/moon.js.map +1 -0
  72. package/dist/sun/moonlight.d.ts +23 -0
  73. package/dist/sun/moonlight.d.ts.map +1 -0
  74. package/dist/sun/moonlight.js +48 -0
  75. package/dist/sun/moonlight.js.map +1 -0
  76. package/dist/sun/planet-position.d.ts +63 -0
  77. package/dist/sun/planet-position.d.ts.map +1 -0
  78. package/dist/sun/planet-position.js +189 -0
  79. package/dist/sun/planet-position.js.map +1 -0
  80. package/dist/sun/planet-times.d.ts +41 -0
  81. package/dist/sun/planet-times.d.ts.map +1 -0
  82. package/dist/sun/planet-times.js +86 -0
  83. package/dist/sun/planet-times.js.map +1 -0
  84. package/dist/sun/planet-visibility.d.ts +39 -0
  85. package/dist/sun/planet-visibility.d.ts.map +1 -0
  86. package/dist/sun/planet-visibility.js +82 -0
  87. package/dist/sun/planet-visibility.js.map +1 -0
  88. package/dist/sun/planets.cjs +411 -0
  89. package/dist/sun/planets.cjs.map +6 -0
  90. package/dist/sun/planets.d.ts +7 -0
  91. package/dist/sun/planets.d.ts.map +1 -0
  92. package/dist/sun/planets.js +7 -0
  93. package/dist/sun/planets.js.map +1 -0
  94. package/dist/sun/sky-brightness.d.ts +32 -0
  95. package/dist/sun/sky-brightness.d.ts.map +1 -0
  96. package/dist/sun/sky-brightness.js +108 -0
  97. package/dist/sun/sky-brightness.js.map +1 -0
  98. package/dist/sun/sky-events.d.ts +16 -0
  99. package/dist/sun/sky-events.d.ts.map +1 -0
  100. package/dist/sun/sky-events.js +60 -0
  101. package/dist/sun/sky-events.js.map +1 -0
  102. package/dist/sun/sky-globe.d.ts +15 -0
  103. package/dist/sun/sky-globe.d.ts.map +1 -0
  104. package/dist/sun/sky-globe.js +51 -0
  105. package/dist/sun/sky-globe.js.map +1 -0
  106. package/dist/sun/sky-lighting.d.ts +27 -0
  107. package/dist/sun/sky-lighting.d.ts.map +1 -0
  108. package/dist/sun/sky-lighting.js +88 -0
  109. package/dist/sun/sky-lighting.js.map +1 -0
  110. package/dist/sun/sky-observer.d.ts +22 -0
  111. package/dist/sun/sky-observer.d.ts.map +1 -0
  112. package/dist/sun/sky-observer.js +57 -0
  113. package/dist/sun/sky-observer.js.map +1 -0
  114. package/dist/sun/sky-time.d.ts +9 -0
  115. package/dist/sun/sky-time.d.ts.map +1 -0
  116. package/dist/sun/sky-time.js +38 -0
  117. package/dist/sun/sky-time.js.map +1 -0
  118. package/dist/sun/star-galactic.d.ts +15 -0
  119. package/dist/sun/star-galactic.d.ts.map +1 -0
  120. package/dist/sun/star-galactic.js +98 -0
  121. package/dist/sun/star-galactic.js.map +1 -0
  122. package/dist/sun/star-milky-way.d.ts +14 -0
  123. package/dist/sun/star-milky-way.d.ts.map +1 -0
  124. package/dist/sun/star-milky-way.js +32 -0
  125. package/dist/sun/star-milky-way.js.map +1 -0
  126. package/dist/sun/star-render.d.ts +38 -0
  127. package/dist/sun/star-render.d.ts.map +1 -0
  128. package/dist/sun/star-render.js +98 -0
  129. package/dist/sun/star-render.js.map +1 -0
  130. package/dist/sun/star-types.d.ts +60 -0
  131. package/dist/sun/star-types.d.ts.map +1 -0
  132. package/dist/sun/star-types.js +5 -0
  133. package/dist/sun/star-types.js.map +1 -0
  134. package/dist/sun/starfield.d.ts +13 -0
  135. package/dist/sun/starfield.d.ts.map +1 -0
  136. package/dist/sun/starfield.js +86 -0
  137. package/dist/sun/starfield.js.map +1 -0
  138. package/dist/sun/stars.cjs +7519 -0
  139. package/dist/sun/stars.cjs.map +6 -0
  140. package/dist/sun/stars.d.ts +26 -0
  141. package/dist/sun/stars.d.ts.map +1 -0
  142. package/dist/sun/stars.js +188 -0
  143. package/dist/sun/stars.js.map +1 -0
  144. package/dist/sun/suncalc.d.ts +26 -0
  145. package/dist/sun/suncalc.d.ts.map +1 -0
  146. package/dist/sun/suncalc.js +94 -0
  147. package/dist/sun/suncalc.js.map +1 -0
  148. package/dist/sun/sunlight.d.ts +25 -0
  149. package/dist/sun/sunlight.d.ts.map +1 -0
  150. package/dist/sun/sunlight.js +76 -0
  151. package/dist/sun/sunlight.js.map +1 -0
  152. package/dist/timezone/index.cjs +205 -0
  153. package/dist/timezone/index.cjs.map +6 -0
  154. package/dist/timezone/index.d.ts +6 -0
  155. package/dist/timezone/index.d.ts.map +1 -0
  156. package/dist/timezone/index.js +8 -0
  157. package/dist/timezone/index.js.map +1 -0
  158. package/dist/timezone/instant.d.ts +4 -0
  159. package/dist/timezone/instant.d.ts.map +1 -0
  160. package/dist/timezone/instant.js +20 -0
  161. package/dist/timezone/instant.js.map +1 -0
  162. package/dist/timezone/local-date-time.d.ts +4 -0
  163. package/dist/timezone/local-date-time.d.ts.map +1 -0
  164. package/dist/timezone/local-date-time.js +34 -0
  165. package/dist/timezone/local-date-time.js.map +1 -0
  166. package/dist/timezone/lookup-async.d.ts +3 -0
  167. package/dist/timezone/lookup-async.d.ts.map +1 -0
  168. package/dist/timezone/lookup-async.js +14 -0
  169. package/dist/timezone/lookup-async.js.map +1 -0
  170. package/dist/timezone/lookup.cjs +83 -0
  171. package/dist/timezone/lookup.cjs.map +6 -0
  172. package/dist/timezone/lookup.d.ts +3 -0
  173. package/dist/timezone/lookup.d.ts.map +1 -0
  174. package/dist/timezone/lookup.js +18 -0
  175. package/dist/timezone/lookup.js.map +1 -0
  176. package/dist/timezone/temporal.cjs +5696 -0
  177. package/dist/timezone/temporal.cjs.map +6 -0
  178. package/dist/timezone/temporal.d.ts +9 -0
  179. package/dist/timezone/temporal.d.ts.map +1 -0
  180. package/dist/timezone/temporal.js +60 -0
  181. package/dist/timezone/temporal.js.map +1 -0
  182. package/dist/timezone/timezone-label.d.ts +5 -0
  183. package/dist/timezone/timezone-label.d.ts.map +1 -0
  184. package/dist/timezone/timezone-label.js +27 -0
  185. package/dist/timezone/timezone-label.js.map +1 -0
  186. package/dist/timezone/timezone-offset.d.ts +3 -0
  187. package/dist/timezone/timezone-offset.d.ts.map +1 -0
  188. package/dist/timezone/timezone-offset.js +22 -0
  189. package/dist/timezone/timezone-offset.js.map +1 -0
  190. package/dist/timezone/types.d.ts +23 -0
  191. package/dist/timezone/types.d.ts.map +1 -0
  192. package/dist/timezone/types.js +5 -0
  193. package/dist/timezone/types.js.map +1 -0
  194. package/dist/timezone/vendor/temporal/runtime.d.ts +3 -0
  195. package/dist/timezone/vendor/temporal/runtime.d.ts.map +1 -0
  196. package/dist/timezone/vendor/temporal/runtime.js +5649 -0
  197. package/dist/timezone/vendor/temporal/runtime.js.map +1 -0
  198. package/dist/timezone/vendor/temporal/types.d.ts +939 -0
  199. package/dist/timezone/vendor/temporal/types.d.ts.map +1 -0
  200. package/dist/timezone/vendor/temporal/types.js +4 -0
  201. package/dist/timezone/vendor/temporal/types.js.map +1 -0
  202. package/dist/timezone/vendor/tz-lookup/runtime.d.ts +3 -0
  203. package/dist/timezone/vendor/tz-lookup/runtime.d.ts.map +1 -0
  204. package/dist/timezone/vendor/tz-lookup/runtime.js +53 -0
  205. package/dist/timezone/vendor/tz-lookup/runtime.js.map +1 -0
  206. package/geoid/data/README.md +28 -0
  207. package/geoid/data/geoid-egm96-hi.pgm +0 -0
  208. package/geoid/data/geoid-egm96-low.pgm +0 -0
  209. package/geoid/data/geoid-manifest.json +22 -0
  210. package/package.json +102 -4
  211. package/src/geoid/create-geoid-from-grid.ts +51 -0
  212. package/src/geoid/geoid.ts +297 -0
  213. package/src/geoid/index.ts +8 -0
  214. package/src/geoid/parse-pgm.ts +189 -0
  215. package/src/index.ts +7 -0
  216. package/src/sun/astronomy.ts +272 -0
  217. package/src/sun/celestial.ts +22 -0
  218. package/src/sun/cloud-lighting.ts +198 -0
  219. package/src/sun/cloud-spectral.ts +54 -0
  220. package/src/sun/data/bright-stars.ts +7024 -0
  221. package/src/sun/data/sunlight.ts +969 -0
  222. package/src/sun/index.ts +43 -0
  223. package/src/sun/moon-appearance.ts +81 -0
  224. package/src/sun/moon-sky-brightness.ts +64 -0
  225. package/src/sun/moon.ts +122 -0
  226. package/src/sun/moonlight.ts +88 -0
  227. package/src/sun/planet-position.ts +305 -0
  228. package/src/sun/planet-times.ts +142 -0
  229. package/src/sun/planet-visibility.ts +143 -0
  230. package/src/sun/planets.ts +18 -0
  231. package/src/sun/sky-brightness.ts +148 -0
  232. package/src/sun/sky-events.ts +66 -0
  233. package/src/sun/sky-globe.ts +72 -0
  234. package/src/sun/sky-lighting.ts +118 -0
  235. package/src/sun/sky-observer.ts +66 -0
  236. package/src/sun/sky-time.ts +42 -0
  237. package/src/sun/star-galactic.ts +111 -0
  238. package/src/sun/star-milky-way.ts +61 -0
  239. package/src/sun/star-render.ts +149 -0
  240. package/src/sun/star-types.ts +66 -0
  241. package/src/sun/starfield.ts +100 -0
  242. package/src/sun/stars.ts +260 -0
  243. package/src/sun/suncalc.ts +141 -0
  244. package/src/sun/sunlight.ts +112 -0
  245. package/src/timezone/index.ts +9 -0
  246. package/src/timezone/instant.ts +21 -0
  247. package/src/timezone/local-date-time.ts +40 -0
  248. package/src/timezone/lookup-async.ts +15 -0
  249. package/src/timezone/lookup.ts +21 -0
  250. package/src/timezone/temporal.ts +81 -0
  251. package/src/timezone/timezone-label.ts +30 -0
  252. package/src/timezone/timezone-offset.ts +21 -0
  253. package/src/timezone/types.ts +30 -0
  254. package/src/timezone/vendor/temporal/JSBI-LICENSE.txt +179 -0
  255. package/src/timezone/vendor/temporal/LICENSE.txt +16 -0
  256. package/src/timezone/vendor/temporal/README.md +23 -0
  257. package/src/timezone/vendor/temporal/runtime.ts +5070 -0
  258. package/src/timezone/vendor/temporal/types.ts +1146 -0
  259. package/src/timezone/vendor/tz-lookup/LICENSE.txt +119 -0
  260. package/src/timezone/vendor/tz-lookup/README.md +22 -0
  261. package/src/timezone/vendor/tz-lookup/runtime.ts +53 -0
  262. package/sun/LICENSE-BRIGHT-STARS +21 -0
  263. package/sun/LICENSE-HOSEK-WILKIE +30 -0
  264. package/sun/LICENSE-SUNCALC +24 -0
  265. package/timezone/data/LICENSE-ODbL.txt +538 -0
  266. package/timezone/data/README.md +50 -0
  267. package/timezone/data/manifest.json +37 -0
  268. package/timezone/data/timezone-geometry-hi.json +1 -0
  269. package/timezone/data/timezone-geometry-hi.parquet +0 -0
  270. package/timezone/data/timezone-geometry-low.json +1 -0
  271. package/timezone/data/timezone-geometry-low.parquet +0 -0
@@ -0,0 +1,939 @@
1
+ export declare namespace Temporal {
2
+ type ComparisonResult = -1 | 0 | 1;
3
+ type RoundingMode = 'ceil' | 'floor' | 'expand' | 'trunc' | 'halfCeil' | 'halfFloor' | 'halfExpand' | 'halfTrunc' | 'halfEven';
4
+ /**
5
+ * Options for assigning fields using `with()` or entire objects with
6
+ * `from()`.
7
+ * */
8
+ type AssignmentOptions = {
9
+ /**
10
+ * How to deal with out-of-range values
11
+ *
12
+ * - In `'constrain'` mode, out-of-range values are clamped to the nearest
13
+ * in-range value.
14
+ * - In `'reject'` mode, out-of-range values will cause the function to
15
+ * throw a RangeError.
16
+ *
17
+ * The default is `'constrain'`.
18
+ */
19
+ overflow?: 'constrain' | 'reject';
20
+ };
21
+ /**
22
+ * Options for assigning fields using `Duration.prototype.with()` or entire
23
+ * objects with `Duration.from()`, and for arithmetic with
24
+ * `Duration.prototype.add()` and `Duration.prototype.subtract()`.
25
+ * */
26
+ type DurationOptions = {
27
+ /**
28
+ * How to deal with out-of-range values
29
+ *
30
+ * - In `'constrain'` mode, out-of-range values are clamped to the nearest
31
+ * in-range value.
32
+ * - In `'balance'` mode, out-of-range values are resolved by balancing them
33
+ * with the next highest unit.
34
+ *
35
+ * The default is `'constrain'`.
36
+ */
37
+ overflow?: 'constrain' | 'balance';
38
+ };
39
+ /**
40
+ * Options for conversions of `Temporal.PlainDateTime` to `Temporal.Instant`
41
+ * */
42
+ type ToInstantOptions = {
43
+ /**
44
+ * Controls handling of invalid or ambiguous times caused by time zone
45
+ * offset changes like Daylight Saving time (DST) transitions.
46
+ *
47
+ * This option is only relevant if a `DateTime` value does not exist in the
48
+ * destination time zone (e.g. near "Spring Forward" DST transitions), or
49
+ * exists more than once (e.g. near "Fall Back" DST transitions).
50
+ *
51
+ * In case of ambiguous or nonexistent times, this option controls what
52
+ * exact time to return:
53
+ * - `'compatible'`: Equivalent to `'earlier'` for backward transitions like
54
+ * the start of DST in the Spring, and `'later'` for forward transitions
55
+ * like the end of DST in the Fall. This matches the behavior of legacy
56
+ * `Date`, of libraries like moment.js, Luxon, or date-fns, and of
57
+ * cross-platform standards like [RFC 5545
58
+ * (iCalendar)](https://tools.ietf.org/html/rfc5545).
59
+ * - `'earlier'`: The earlier time of two possible times
60
+ * - `'later'`: The later of two possible times
61
+ * - `'reject'`: Throw a RangeError instead
62
+ *
63
+ * The default is `'compatible'`.
64
+ *
65
+ * */
66
+ disambiguation?: 'compatible' | 'earlier' | 'later' | 'reject';
67
+ };
68
+ type OffsetDisambiguationOptions = {
69
+ /**
70
+ * Time zone definitions can change. If an application stores data about
71
+ * events in the future, then stored data about future events may become
72
+ * ambiguous, for example if a country permanently abolishes DST. The
73
+ * `offset` option controls this unusual case.
74
+ *
75
+ * - `'use'` always uses the offset (if it's provided) to calculate the
76
+ * instant. This ensures that the result will match the instant that was
77
+ * originally stored, even if local clock time is different.
78
+ * - `'prefer'` uses the offset if it's valid for the date/time in this time
79
+ * zone, but if it's not valid then the time zone will be used as a
80
+ * fallback to calculate the instant.
81
+ * - `'ignore'` will disregard any provided offset. Instead, the time zone
82
+ * and date/time value are used to calculate the instant. This will keep
83
+ * local clock time unchanged but may result in a different real-world
84
+ * instant.
85
+ * - `'reject'` acts like `'prefer'`, except it will throw a RangeError if
86
+ * the offset is not valid for the given time zone identifier and
87
+ * date/time value.
88
+ *
89
+ * If the ISO string ends in 'Z' then this option is ignored because there
90
+ * is no possibility of ambiguity.
91
+ *
92
+ * If a time zone offset is not present in the input, then this option is
93
+ * ignored because the time zone will always be used to calculate the
94
+ * offset.
95
+ *
96
+ * If the offset is not used, and if the date/time and time zone don't
97
+ * uniquely identify a single instant, then the `disambiguation` option will
98
+ * be used to choose the correct instant. However, if the offset is used
99
+ * then the `disambiguation` option will be ignored.
100
+ */
101
+ offset?: 'use' | 'prefer' | 'ignore' | 'reject';
102
+ };
103
+ type ZonedDateTimeAssignmentOptions = Partial<AssignmentOptions & ToInstantOptions & OffsetDisambiguationOptions>;
104
+ /**
105
+ * Options for arithmetic operations like `add()` and `subtract()`
106
+ * */
107
+ type ArithmeticOptions = {
108
+ /**
109
+ * Controls handling of out-of-range arithmetic results.
110
+ *
111
+ * If a result is out of range, then `'constrain'` will clamp the result to
112
+ * the allowed range, while `'reject'` will throw a RangeError.
113
+ *
114
+ * The default is `'constrain'`.
115
+ */
116
+ overflow?: 'constrain' | 'reject';
117
+ };
118
+ type DateUnit = 'year' | 'month' | 'week' | 'day';
119
+ type TimeUnit = 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond';
120
+ type DateTimeUnit = DateUnit | TimeUnit;
121
+ /**
122
+ * When the name of a unit is provided to a Temporal API as a string, it is
123
+ * usually singular, e.g. 'day' or 'hour'. But plural unit names like 'days'
124
+ * or 'hours' are also accepted.
125
+ * */
126
+ type PluralUnit<T extends DateTimeUnit> = {
127
+ year: 'years';
128
+ month: 'months';
129
+ week: 'weeks';
130
+ day: 'days';
131
+ hour: 'hours';
132
+ minute: 'minutes';
133
+ second: 'seconds';
134
+ millisecond: 'milliseconds';
135
+ microsecond: 'microseconds';
136
+ nanosecond: 'nanoseconds';
137
+ }[T];
138
+ type LargestUnit<T extends DateTimeUnit> = 'auto' | T | PluralUnit<T>;
139
+ type SmallestUnit<T extends DateTimeUnit> = T | PluralUnit<T>;
140
+ type TotalUnit<T extends DateTimeUnit> = T | PluralUnit<T>;
141
+ /**
142
+ * Options for outputting precision in toString() on types with seconds
143
+ */
144
+ type ToStringPrecisionOptions = {
145
+ fractionalSecondDigits?: 'auto' | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
146
+ smallestUnit?: SmallestUnit<'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>;
147
+ /**
148
+ * Controls how rounding is performed:
149
+ * - `halfExpand`: Round to the nearest of the values allowed by
150
+ * `roundingIncrement` and `smallestUnit`. When there is a tie, round up.
151
+ * This mode is the default.
152
+ * - `ceil`: Always round up, towards the end of time.
153
+ * - `trunc`: Always round down, towards the beginning of time.
154
+ * - `floor`: Also round down, towards the beginning of time. This mode acts
155
+ * the same as `trunc`, but it's included for consistency with
156
+ * `Temporal.Duration.round()` where negative values are allowed and
157
+ * `trunc` rounds towards zero, unlike `floor` which rounds towards
158
+ * negative infinity which is usually unexpected. For this reason, `trunc`
159
+ * is recommended for most use cases.
160
+ */
161
+ roundingMode?: RoundingMode;
162
+ };
163
+ type ShowCalendarOption = {
164
+ calendarName?: 'auto' | 'always' | 'never' | 'critical';
165
+ };
166
+ type CalendarTypeToStringOptions = Partial<ToStringPrecisionOptions & ShowCalendarOption>;
167
+ type ZonedDateTimeToStringOptions = Partial<CalendarTypeToStringOptions & {
168
+ timeZoneName?: 'auto' | 'never' | 'critical';
169
+ offset?: 'auto' | 'never';
170
+ }>;
171
+ type InstantToStringOptions = Partial<ToStringPrecisionOptions & {
172
+ timeZone: TimeZoneLike;
173
+ }>;
174
+ /**
175
+ * Options to control the result of `until()` and `since()` methods in
176
+ * `Temporal` types.
177
+ */
178
+ interface DifferenceOptions<T extends DateTimeUnit> {
179
+ /**
180
+ * The unit to round to. For example, to round to the nearest minute, use
181
+ * `smallestUnit: 'minute'`. This property is optional for `until()` and
182
+ * `since()`, because those methods default behavior is not to round.
183
+ * However, the same property is required for `round()`.
184
+ */
185
+ smallestUnit?: SmallestUnit<T>;
186
+ /**
187
+ * The largest unit to allow in the resulting `Temporal.Duration` object.
188
+ *
189
+ * Larger units will be "balanced" into smaller units. For example, if
190
+ * `largestUnit` is `'minute'` then a two-hour duration will be output as a
191
+ * 120-minute duration.
192
+ *
193
+ * Valid values may include `'year'`, `'month'`, `'week'`, `'day'`,
194
+ * `'hour'`, `'minute'`, `'second'`, `'millisecond'`, `'microsecond'`,
195
+ * `'nanosecond'` and `'auto'`, although some types may throw an exception
196
+ * if a value is used that would produce an invalid result. For example,
197
+ * `hours` is not accepted by `Temporal.PlainDate.prototype.since()`.
198
+ *
199
+ * The default is always `'auto'`, though the meaning of this depends on the
200
+ * type being used.
201
+ */
202
+ largestUnit?: LargestUnit<T>;
203
+ /**
204
+ * Allows rounding to an integer number of units. For example, to round to
205
+ * increments of a half hour, use `{ smallestUnit: 'minute',
206
+ * roundingIncrement: 30 }`.
207
+ */
208
+ roundingIncrement?: number;
209
+ /**
210
+ * Controls how rounding is performed:
211
+ * - `halfExpand`: Round to the nearest of the values allowed by
212
+ * `roundingIncrement` and `smallestUnit`. When there is a tie, round away
213
+ * from zero like `ceil` for positive durations and like `floor` for
214
+ * negative durations.
215
+ * - `ceil`: Always round up, towards the end of time.
216
+ * - `trunc`: Always round down, towards the beginning of time. This mode is
217
+ * the default.
218
+ * - `floor`: Also round down, towards the beginning of time. This mode acts
219
+ * the same as `trunc`, but it's included for consistency with
220
+ * `Temporal.Duration.round()` where negative values are allowed and
221
+ * `trunc` rounds towards zero, unlike `floor` which rounds towards
222
+ * negative infinity which is usually unexpected. For this reason, `trunc`
223
+ * is recommended for most use cases.
224
+ */
225
+ roundingMode?: RoundingMode;
226
+ }
227
+ /**
228
+ * `round` methods take one required parameter. If a string is provided, the
229
+ * resulting `Temporal.Duration` object will be rounded to that unit. If an
230
+ * object is provided, its `smallestUnit` property is required while other
231
+ * properties are optional. A string is treated the same as an object whose
232
+ * `smallestUnit` property value is that string.
233
+ */
234
+ type RoundTo<T extends DateTimeUnit> = SmallestUnit<T> | {
235
+ /**
236
+ * The unit to round to. For example, to round to the nearest minute,
237
+ * use `smallestUnit: 'minute'`. This option is required. Note that the
238
+ * same-named property is optional when passed to `until` or `since`
239
+ * methods, because those methods do no rounding by default.
240
+ */
241
+ smallestUnit: SmallestUnit<T>;
242
+ /**
243
+ * Allows rounding to an integer number of units. For example, to round to
244
+ * increments of a half hour, use `{ smallestUnit: 'minute',
245
+ * roundingIncrement: 30 }`.
246
+ */
247
+ roundingIncrement?: number;
248
+ /**
249
+ * Controls how rounding is performed:
250
+ * - `halfExpand`: Round to the nearest of the values allowed by
251
+ * `roundingIncrement` and `smallestUnit`. When there is a tie, round up.
252
+ * This mode is the default.
253
+ * - `ceil`: Always round up, towards the end of time.
254
+ * - `trunc`: Always round down, towards the beginning of time.
255
+ * - `floor`: Also round down, towards the beginning of time. This mode acts
256
+ * the same as `trunc`, but it's included for consistency with
257
+ * `Temporal.Duration.round()` where negative values are allowed and
258
+ * `trunc` rounds towards zero, unlike `floor` which rounds towards
259
+ * negative infinity which is usually unexpected. For this reason, `trunc`
260
+ * is recommended for most use cases.
261
+ */
262
+ roundingMode?: RoundingMode;
263
+ };
264
+ /**
265
+ * The `round` method of the `Temporal.Duration` accepts one required
266
+ * parameter. If a string is provided, the resulting `Temporal.Duration`
267
+ * object will be rounded to that unit. If an object is provided, the
268
+ * `smallestUnit` and/or `largestUnit` property is required, while other
269
+ * properties are optional. A string parameter is treated the same as an
270
+ * object whose `smallestUnit` property value is that string.
271
+ */
272
+ type DurationRoundTo = SmallestUnit<DateTimeUnit> | (({
273
+ /**
274
+ * The unit to round to. For example, to round to the nearest
275
+ * minute, use `smallestUnit: 'minute'`. This property is normally
276
+ * required, but is optional if `largestUnit` is provided and not
277
+ * undefined.
278
+ */
279
+ smallestUnit: SmallestUnit<DateTimeUnit>;
280
+ /**
281
+ * The largest unit to allow in the resulting `Temporal.Duration`
282
+ * object.
283
+ *
284
+ * Larger units will be "balanced" into smaller units. For example,
285
+ * if `largestUnit` is `'minute'` then a two-hour duration will be
286
+ * output as a 120-minute duration.
287
+ *
288
+ * Valid values include `'year'`, `'month'`, `'week'`, `'day'`,
289
+ * `'hour'`, `'minute'`, `'second'`, `'millisecond'`,
290
+ * `'microsecond'`, `'nanosecond'` and `'auto'`.
291
+ *
292
+ * The default is `'auto'`, which means "the largest nonzero unit in
293
+ * the input duration". This default prevents expanding durations to
294
+ * larger units unless the caller opts into this behavior.
295
+ *
296
+ * If `smallestUnit` is larger, then `smallestUnit` will be used as
297
+ * `largestUnit`, superseding a caller-supplied or default value.
298
+ */
299
+ largestUnit?: LargestUnit<DateTimeUnit>;
300
+ } | {
301
+ /**
302
+ * The unit to round to. For example, to round to the nearest
303
+ * minute, use `smallestUnit: 'minute'`. This property is normally
304
+ * required, but is optional if `largestUnit` is provided and not
305
+ * undefined.
306
+ */
307
+ smallestUnit?: SmallestUnit<DateTimeUnit>;
308
+ /**
309
+ * The largest unit to allow in the resulting `Temporal.Duration`
310
+ * object.
311
+ *
312
+ * Larger units will be "balanced" into smaller units. For example,
313
+ * if `largestUnit` is `'minute'` then a two-hour duration will be
314
+ * output as a 120-minute duration.
315
+ *
316
+ * Valid values include `'year'`, `'month'`, `'week'`, `'day'`,
317
+ * `'hour'`, `'minute'`, `'second'`, `'millisecond'`,
318
+ * `'microsecond'`, `'nanosecond'` and `'auto'`.
319
+ *
320
+ * The default is `'auto'`, which means "the largest nonzero unit in
321
+ * the input duration". This default prevents expanding durations to
322
+ * larger units unless the caller opts into this behavior.
323
+ *
324
+ * If `smallestUnit` is larger, then `smallestUnit` will be used as
325
+ * `largestUnit`, superseding a caller-supplied or default value.
326
+ */
327
+ largestUnit: LargestUnit<DateTimeUnit>;
328
+ }) & {
329
+ /**
330
+ * Allows rounding to an integer number of units. For example, to round
331
+ * to increments of a half hour, use `{ smallestUnit: 'minute',
332
+ * roundingIncrement: 30 }`.
333
+ */
334
+ roundingIncrement?: number;
335
+ /**
336
+ * Controls how rounding is performed:
337
+ * - `halfExpand`: Round to the nearest of the values allowed by
338
+ * `roundingIncrement` and `smallestUnit`. When there is a tie, round
339
+ * away from zero like `ceil` for positive durations and like `floor`
340
+ * for negative durations. This mode is the default.
341
+ * - `ceil`: Always round towards positive infinity. For negative
342
+ * durations this option will decrease the absolute value of the
343
+ * duration which may be unexpected. To round away from zero, use
344
+ * `ceil` for positive durations and `floor` for negative durations.
345
+ * - `trunc`: Always round down towards zero.
346
+ * - `floor`: Always round towards negative infinity. This mode acts the
347
+ * same as `trunc` for positive durations but for negative durations
348
+ * it will increase the absolute value of the result which may be
349
+ * unexpected. For this reason, `trunc` is recommended for most "round
350
+ * down" use cases.
351
+ */
352
+ roundingMode?: RoundingMode;
353
+ /**
354
+ * The starting point to use for rounding and conversions when
355
+ * variable-length units (years, months, weeks depending on the
356
+ * calendar) are involved. This option is required if any of the
357
+ * following are true:
358
+ * - `unit` is `'week'` or larger units
359
+ * - `this` has a nonzero value for `weeks` or larger units
360
+ *
361
+ * This value must be either a `Temporal.PlainDateTime`, a
362
+ * `Temporal.ZonedDateTime`, or a string or object value that can be
363
+ * passed to `from()` of those types. Examples:
364
+ * - `'2020-01-01T00:00-08:00[America/Los_Angeles]'`
365
+ * - `'2020-01-01'`
366
+ * - `Temporal.PlainDate.from('2020-01-01')`
367
+ *
368
+ * `Temporal.ZonedDateTime` will be tried first because it's more
369
+ * specific, with `Temporal.PlainDateTime` as a fallback.
370
+ *
371
+ * If the value resolves to a `Temporal.ZonedDateTime`, then operation
372
+ * will adjust for DST and other time zone transitions. Otherwise
373
+ * (including if this option is omitted), then the operation will ignore
374
+ * time zone transitions and all days will be assumed to be 24 hours
375
+ * long.
376
+ */
377
+ relativeTo?: Temporal.PlainDateTime | Temporal.ZonedDateTime | PlainDateTimeLike | ZonedDateTimeLike | string;
378
+ });
379
+ /**
380
+ * Options to control behavior of `Duration.prototype.total()`
381
+ */
382
+ type DurationTotalOf = TotalUnit<DateTimeUnit> | {
383
+ /**
384
+ * The unit to convert the duration to. This option is required.
385
+ */
386
+ unit: TotalUnit<DateTimeUnit>;
387
+ /**
388
+ * The starting point to use when variable-length units (years, months,
389
+ * weeks depending on the calendar) are involved. This option is required if
390
+ * any of the following are true:
391
+ * - `unit` is `'week'` or larger units
392
+ * - `this` has a nonzero value for `weeks` or larger units
393
+ *
394
+ * This value must be either a `Temporal.PlainDateTime`, a
395
+ * `Temporal.ZonedDateTime`, or a string or object value that can be passed
396
+ * to `from()` of those types. Examples:
397
+ * - `'2020-01-01T00:00-08:00[America/Los_Angeles]'`
398
+ * - `'2020-01-01'`
399
+ * - `Temporal.PlainDate.from('2020-01-01')`
400
+ *
401
+ * `Temporal.ZonedDateTime` will be tried first because it's more
402
+ * specific, with `Temporal.PlainDateTime` as a fallback.
403
+ *
404
+ * If the value resolves to a `Temporal.ZonedDateTime`, then operation will
405
+ * adjust for DST and other time zone transitions. Otherwise (including if
406
+ * this option is omitted), then the operation will ignore time zone
407
+ * transitions and all days will be assumed to be 24 hours long.
408
+ */
409
+ relativeTo?: Temporal.ZonedDateTime | Temporal.PlainDateTime | ZonedDateTimeLike | PlainDateTimeLike | string;
410
+ };
411
+ /**
412
+ * Options to control behavior of `Duration.compare()`
413
+ */
414
+ interface DurationArithmeticOptions {
415
+ /**
416
+ * The starting point to use when variable-length units (years, months,
417
+ * weeks depending on the calendar) are involved. This option is required if
418
+ * either of the durations has a nonzero value for `weeks` or larger units.
419
+ *
420
+ * This value must be either a `Temporal.PlainDateTime`, a
421
+ * `Temporal.ZonedDateTime`, or a string or object value that can be passed
422
+ * to `from()` of those types. Examples:
423
+ * - `'2020-01-01T00:00-08:00[America/Los_Angeles]'`
424
+ * - `'2020-01-01'`
425
+ * - `Temporal.PlainDate.from('2020-01-01')`
426
+ *
427
+ * `Temporal.ZonedDateTime` will be tried first because it's more
428
+ * specific, with `Temporal.PlainDateTime` as a fallback.
429
+ *
430
+ * If the value resolves to a `Temporal.ZonedDateTime`, then operation will
431
+ * adjust for DST and other time zone transitions. Otherwise (including if
432
+ * this option is omitted), then the operation will ignore time zone
433
+ * transitions and all days will be assumed to be 24 hours long.
434
+ */
435
+ relativeTo?: Temporal.ZonedDateTime | Temporal.PlainDateTime | ZonedDateTimeLike | PlainDateTimeLike | string;
436
+ }
437
+ /**
438
+ * Options to control behaviour of `ZonedDateTime.prototype.getTimeZoneTransition()`
439
+ */
440
+ type TransitionDirection = 'next' | 'previous' | {
441
+ direction: 'next' | 'previous';
442
+ };
443
+ type LocalesArgument = ConstructorParameters<typeof Intl.DateTimeFormat>[0];
444
+ type DurationFormatOptions = typeof Intl extends {
445
+ DurationFormat: any;
446
+ } ? ConstructorParameters<(typeof Intl)['DurationFormat']>[1] : Record<string, unknown>;
447
+ type DurationLike = {
448
+ years?: number;
449
+ months?: number;
450
+ weeks?: number;
451
+ days?: number;
452
+ hours?: number;
453
+ minutes?: number;
454
+ seconds?: number;
455
+ milliseconds?: number;
456
+ microseconds?: number;
457
+ nanoseconds?: number;
458
+ };
459
+ /**
460
+ *
461
+ * A `Temporal.Duration` represents an immutable duration of time which can be
462
+ * used in date/time arithmetic.
463
+ *
464
+ * See https://tc39.es/proposal-temporal/docs/duration.html for more details.
465
+ */
466
+ class Duration {
467
+ static from(item: Temporal.Duration | DurationLike | string): Temporal.Duration;
468
+ static compare(one: Temporal.Duration | DurationLike | string, two: Temporal.Duration | DurationLike | string, options?: DurationArithmeticOptions): ComparisonResult;
469
+ constructor(years?: number, months?: number, weeks?: number, days?: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number, microseconds?: number, nanoseconds?: number);
470
+ readonly sign: -1 | 0 | 1;
471
+ readonly blank: boolean;
472
+ readonly years: number;
473
+ readonly months: number;
474
+ readonly weeks: number;
475
+ readonly days: number;
476
+ readonly hours: number;
477
+ readonly minutes: number;
478
+ readonly seconds: number;
479
+ readonly milliseconds: number;
480
+ readonly microseconds: number;
481
+ readonly nanoseconds: number;
482
+ negated(): Temporal.Duration;
483
+ abs(): Temporal.Duration;
484
+ with(durationLike: DurationLike): Temporal.Duration;
485
+ add(other: Temporal.Duration | DurationLike | string): Temporal.Duration;
486
+ subtract(other: Temporal.Duration | DurationLike | string): Temporal.Duration;
487
+ round(roundTo: DurationRoundTo): Temporal.Duration;
488
+ total(totalOf: DurationTotalOf): number;
489
+ toLocaleString(locales?: LocalesArgument, options?: DurationFormatOptions): string;
490
+ toJSON(): string;
491
+ toString(options?: ToStringPrecisionOptions): string;
492
+ valueOf(): never;
493
+ readonly [Symbol.toStringTag]: 'Temporal.Duration';
494
+ }
495
+ /**
496
+ * A `Temporal.Instant` is an exact point in time, with a precision in
497
+ * nanoseconds. No time zone or calendar information is present. Therefore,
498
+ * `Temporal.Instant` has no concept of days, months, or even hours.
499
+ *
500
+ * For convenience of interoperability, it internally uses nanoseconds since
501
+ * the {@link https://en.wikipedia.org/wiki/Unix_time|Unix epoch} (midnight
502
+ * UTC on January 1, 1970). However, a `Temporal.Instant` can be created from
503
+ * any of several expressions that refer to a single point in time, including
504
+ * an {@link https://datatracker.ietf.org/doc/html/rfc9557|RFC 9557 string}
505
+ * with a time zone offset such as '2020-01-23T17:04:36.491865121-08:00'.
506
+ *
507
+ * See https://tc39.es/proposal-temporal/docs/instant.html for more details.
508
+ */
509
+ class Instant {
510
+ static fromEpochMilliseconds(epochMilliseconds: number): Temporal.Instant;
511
+ static fromEpochNanoseconds(epochNanoseconds: bigint): Temporal.Instant;
512
+ static from(item: Temporal.Instant | string): Temporal.Instant;
513
+ static compare(one: Temporal.Instant | string, two: Temporal.Instant | string): ComparisonResult;
514
+ constructor(epochNanoseconds: bigint);
515
+ readonly epochMilliseconds: number;
516
+ readonly epochNanoseconds: bigint;
517
+ equals(other: Temporal.Instant | string): boolean;
518
+ add(durationLike: Omit<Temporal.Duration | DurationLike, 'years' | 'months' | 'weeks' | 'days'> | string): Temporal.Instant;
519
+ subtract(durationLike: Omit<Temporal.Duration | DurationLike, 'years' | 'months' | 'weeks' | 'days'> | string): Temporal.Instant;
520
+ until(other: Temporal.Instant | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
521
+ since(other: Temporal.Instant | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
522
+ round(roundTo: RoundTo<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Instant;
523
+ toZonedDateTimeISO(tzLike: TimeZoneLike): Temporal.ZonedDateTime;
524
+ toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
525
+ toJSON(): string;
526
+ toString(options?: InstantToStringOptions): string;
527
+ valueOf(): never;
528
+ readonly [Symbol.toStringTag]: 'Temporal.Instant';
529
+ }
530
+ /**
531
+ * Any of these types can be passed to Temporal methods instead of a calendar ID.
532
+ * */
533
+ type CalendarLike = string | ZonedDateTime | PlainDateTime | PlainDate | PlainYearMonth | PlainMonthDay;
534
+ type PlainDateLike = {
535
+ era?: string | undefined;
536
+ eraYear?: number | undefined;
537
+ year?: number;
538
+ month?: number;
539
+ monthCode?: string;
540
+ day?: number;
541
+ calendar?: CalendarLike;
542
+ };
543
+ /**
544
+ * A `Temporal.PlainDate` represents a calendar date. "Calendar date" refers to the
545
+ * concept of a date as expressed in everyday usage, independent of any time
546
+ * zone. For example, it could be used to represent an event on a calendar
547
+ * which happens during the whole day no matter which time zone it's happening
548
+ * in.
549
+ *
550
+ * See https://tc39.es/proposal-temporal/docs/plaindate.html for more details.
551
+ */
552
+ class PlainDate {
553
+ static from(item: Temporal.PlainDate | PlainDateLike | string, options?: AssignmentOptions): Temporal.PlainDate;
554
+ static compare(one: Temporal.PlainDate | PlainDateLike | string, two: Temporal.PlainDate | PlainDateLike | string): ComparisonResult;
555
+ constructor(isoYear: number, isoMonth: number, isoDay: number, calendar?: string);
556
+ readonly era: string | undefined;
557
+ readonly eraYear: number | undefined;
558
+ readonly year: number;
559
+ readonly month: number;
560
+ readonly monthCode: string;
561
+ readonly day: number;
562
+ readonly calendarId: string;
563
+ readonly dayOfWeek: number;
564
+ readonly dayOfYear: number;
565
+ readonly weekOfYear: number | undefined;
566
+ readonly yearOfWeek: number | undefined;
567
+ readonly daysInWeek: number;
568
+ readonly daysInYear: number;
569
+ readonly daysInMonth: number;
570
+ readonly monthsInYear: number;
571
+ readonly inLeapYear: boolean;
572
+ equals(other: Temporal.PlainDate | PlainDateLike | string): boolean;
573
+ with(dateLike: PlainDateLike, options?: AssignmentOptions): Temporal.PlainDate;
574
+ withCalendar(calendar: CalendarLike): Temporal.PlainDate;
575
+ add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDate;
576
+ subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDate;
577
+ until(other: Temporal.PlainDate | PlainDateLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day'>): Temporal.Duration;
578
+ since(other: Temporal.PlainDate | PlainDateLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day'>): Temporal.Duration;
579
+ toPlainDateTime(temporalTime?: Temporal.PlainTime | PlainTimeLike | string): Temporal.PlainDateTime;
580
+ toZonedDateTime(timeZoneAndTime: string | {
581
+ timeZone: TimeZoneLike;
582
+ plainTime?: Temporal.PlainTime | PlainTimeLike | string;
583
+ }): Temporal.ZonedDateTime;
584
+ toPlainYearMonth(): Temporal.PlainYearMonth;
585
+ toPlainMonthDay(): Temporal.PlainMonthDay;
586
+ toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
587
+ toJSON(): string;
588
+ toString(options?: ShowCalendarOption): string;
589
+ valueOf(): never;
590
+ readonly [Symbol.toStringTag]: 'Temporal.PlainDate';
591
+ }
592
+ type PlainDateTimeLike = {
593
+ era?: string | undefined;
594
+ eraYear?: number | undefined;
595
+ year?: number;
596
+ month?: number;
597
+ monthCode?: string;
598
+ day?: number;
599
+ hour?: number;
600
+ minute?: number;
601
+ second?: number;
602
+ millisecond?: number;
603
+ microsecond?: number;
604
+ nanosecond?: number;
605
+ calendar?: CalendarLike;
606
+ };
607
+ /**
608
+ * A `Temporal.PlainDateTime` represents a calendar date and wall-clock time, with
609
+ * a precision in nanoseconds, and without any time zone. Of the Temporal
610
+ * classes carrying human-readable time information, it is the most general
611
+ * and complete one. `Temporal.PlainDate`, `Temporal.PlainTime`, `Temporal.PlainYearMonth`,
612
+ * and `Temporal.PlainMonthDay` all carry less information and should be used when
613
+ * complete information is not required.
614
+ *
615
+ * See https://tc39.es/proposal-temporal/docs/plaindatetime.html for more details.
616
+ */
617
+ class PlainDateTime {
618
+ static from(item: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: AssignmentOptions): Temporal.PlainDateTime;
619
+ static compare(one: Temporal.PlainDateTime | PlainDateTimeLike | string, two: Temporal.PlainDateTime | PlainDateTimeLike | string): ComparisonResult;
620
+ constructor(isoYear: number, isoMonth: number, isoDay: number, hour?: number, minute?: number, second?: number, millisecond?: number, microsecond?: number, nanosecond?: number, calendar?: string);
621
+ readonly era: string | undefined;
622
+ readonly eraYear: number | undefined;
623
+ readonly year: number;
624
+ readonly month: number;
625
+ readonly monthCode: string;
626
+ readonly day: number;
627
+ readonly hour: number;
628
+ readonly minute: number;
629
+ readonly second: number;
630
+ readonly millisecond: number;
631
+ readonly microsecond: number;
632
+ readonly nanosecond: number;
633
+ readonly calendarId: string;
634
+ readonly dayOfWeek: number;
635
+ readonly dayOfYear: number;
636
+ readonly weekOfYear: number | undefined;
637
+ readonly yearOfWeek: number | undefined;
638
+ readonly daysInWeek: number;
639
+ readonly daysInYear: number;
640
+ readonly daysInMonth: number;
641
+ readonly monthsInYear: number;
642
+ readonly inLeapYear: boolean;
643
+ equals(other: Temporal.PlainDateTime | PlainDateTimeLike | string): boolean;
644
+ with(dateTimeLike: PlainDateTimeLike, options?: AssignmentOptions): Temporal.PlainDateTime;
645
+ withPlainTime(timeLike?: Temporal.PlainTime | PlainTimeLike | string): Temporal.PlainDateTime;
646
+ withCalendar(calendar: CalendarLike): Temporal.PlainDateTime;
647
+ add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDateTime;
648
+ subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDateTime;
649
+ until(other: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
650
+ since(other: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
651
+ round(roundTo: RoundTo<'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.PlainDateTime;
652
+ toZonedDateTime(tzLike: TimeZoneLike, options?: ToInstantOptions): Temporal.ZonedDateTime;
653
+ toPlainDate(): Temporal.PlainDate;
654
+ toPlainTime(): Temporal.PlainTime;
655
+ toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
656
+ toJSON(): string;
657
+ toString(options?: CalendarTypeToStringOptions): string;
658
+ valueOf(): never;
659
+ readonly [Symbol.toStringTag]: 'Temporal.PlainDateTime';
660
+ }
661
+ type PlainMonthDayLike = {
662
+ era?: string | undefined;
663
+ eraYear?: number | undefined;
664
+ year?: number;
665
+ month?: number;
666
+ monthCode?: string;
667
+ day?: number;
668
+ calendar?: CalendarLike;
669
+ };
670
+ /**
671
+ * A `Temporal.PlainMonthDay` represents a particular day on the calendar, but
672
+ * without a year. For example, it could be used to represent a yearly
673
+ * recurring event, like "Bastille Day is on the 14th of July."
674
+ *
675
+ * See https://tc39.es/proposal-temporal/docs/plainmonthday.html for more details.
676
+ */
677
+ class PlainMonthDay {
678
+ static from(item: Temporal.PlainMonthDay | PlainMonthDayLike | string, options?: AssignmentOptions): Temporal.PlainMonthDay;
679
+ constructor(isoMonth: number, isoDay: number, calendar?: string, referenceISOYear?: number);
680
+ readonly monthCode: string;
681
+ readonly day: number;
682
+ readonly calendarId: string;
683
+ equals(other: Temporal.PlainMonthDay | PlainMonthDayLike | string): boolean;
684
+ with(monthDayLike: PlainMonthDayLike, options?: AssignmentOptions): Temporal.PlainMonthDay;
685
+ toPlainDate(year: {
686
+ year: number;
687
+ }): Temporal.PlainDate;
688
+ toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
689
+ toJSON(): string;
690
+ toString(options?: ShowCalendarOption): string;
691
+ valueOf(): never;
692
+ readonly [Symbol.toStringTag]: 'Temporal.PlainMonthDay';
693
+ }
694
+ type PlainTimeLike = {
695
+ hour?: number;
696
+ minute?: number;
697
+ second?: number;
698
+ millisecond?: number;
699
+ microsecond?: number;
700
+ nanosecond?: number;
701
+ };
702
+ /**
703
+ * A `Temporal.PlainTime` represents a wall-clock time, with a precision in
704
+ * nanoseconds, and without any time zone. "Wall-clock time" refers to the
705
+ * concept of a time as expressed in everyday usage — the time that you read
706
+ * off the clock on the wall. For example, it could be used to represent an
707
+ * event that happens daily at a certain time, no matter what time zone.
708
+ *
709
+ * `Temporal.PlainTime` refers to a time with no associated calendar date; if you
710
+ * need to refer to a specific time on a specific day, use
711
+ * `Temporal.PlainDateTime`. A `Temporal.PlainTime` can be converted into a
712
+ * `Temporal.PlainDateTime` by combining it with a `Temporal.PlainDate` using the
713
+ * `toPlainDateTime()` method.
714
+ *
715
+ * See https://tc39.es/proposal-temporal/docs/plaintime.html for more details.
716
+ */
717
+ class PlainTime {
718
+ static from(item: Temporal.PlainTime | PlainTimeLike | string, options?: AssignmentOptions): Temporal.PlainTime;
719
+ static compare(one: Temporal.PlainTime | PlainTimeLike | string, two: Temporal.PlainTime | PlainTimeLike | string): ComparisonResult;
720
+ constructor(hour?: number, minute?: number, second?: number, millisecond?: number, microsecond?: number, nanosecond?: number);
721
+ readonly hour: number;
722
+ readonly minute: number;
723
+ readonly second: number;
724
+ readonly millisecond: number;
725
+ readonly microsecond: number;
726
+ readonly nanosecond: number;
727
+ equals(other: Temporal.PlainTime | PlainTimeLike | string): boolean;
728
+ with(timeLike: Temporal.PlainTime | PlainTimeLike, options?: AssignmentOptions): Temporal.PlainTime;
729
+ add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime;
730
+ subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime;
731
+ until(other: Temporal.PlainTime | PlainTimeLike | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
732
+ since(other: Temporal.PlainTime | PlainTimeLike | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
733
+ round(roundTo: RoundTo<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.PlainTime;
734
+ toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
735
+ toJSON(): string;
736
+ toString(options?: ToStringPrecisionOptions): string;
737
+ valueOf(): never;
738
+ readonly [Symbol.toStringTag]: 'Temporal.PlainTime';
739
+ }
740
+ /**
741
+ * To provide a time zone to any non-constructor Temporal method, any of the
742
+ * following are allowed:
743
+ * - An IANA time zone ID string like "Europe/Paris"
744
+ * - An RFC 9557 string that includes a time zone annotation like
745
+ * "2025-03-13T05:40:57.499+01:00[Europe/Paris]"
746
+ * - A `Temporal.ZonedDateTime` object
747
+ */
748
+ type TimeZoneLike = string | ZonedDateTime;
749
+ type PlainYearMonthLike = {
750
+ era?: string | undefined;
751
+ eraYear?: number | undefined;
752
+ year?: number;
753
+ month?: number;
754
+ monthCode?: string;
755
+ calendar?: CalendarLike;
756
+ };
757
+ /**
758
+ * A `Temporal.PlainYearMonth` represents a particular month on the calendar. For
759
+ * example, it could be used to represent a particular instance of a monthly
760
+ * recurring event, like "the June 2019 meeting".
761
+ *
762
+ * See https://tc39.es/proposal-temporal/docs/plainyearmonth.html for more details.
763
+ */
764
+ class PlainYearMonth {
765
+ static from(item: Temporal.PlainYearMonth | PlainYearMonthLike | string, options?: AssignmentOptions): Temporal.PlainYearMonth;
766
+ static compare(one: Temporal.PlainYearMonth | PlainYearMonthLike | string, two: Temporal.PlainYearMonth | PlainYearMonthLike | string): ComparisonResult;
767
+ constructor(isoYear: number, isoMonth: number, calendar?: string, referenceISODay?: number);
768
+ readonly era: string | undefined;
769
+ readonly eraYear: number | undefined;
770
+ readonly year: number;
771
+ readonly month: number;
772
+ readonly monthCode: string;
773
+ readonly calendarId: string;
774
+ readonly daysInMonth: number;
775
+ readonly daysInYear: number;
776
+ readonly monthsInYear: number;
777
+ readonly inLeapYear: boolean;
778
+ equals(other: Temporal.PlainYearMonth | PlainYearMonthLike | string): boolean;
779
+ with(yearMonthLike: PlainYearMonthLike, options?: AssignmentOptions): Temporal.PlainYearMonth;
780
+ add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainYearMonth;
781
+ subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainYearMonth;
782
+ until(other: Temporal.PlainYearMonth | PlainYearMonthLike | string, options?: DifferenceOptions<'year' | 'month'>): Temporal.Duration;
783
+ since(other: Temporal.PlainYearMonth | PlainYearMonthLike | string, options?: DifferenceOptions<'year' | 'month'>): Temporal.Duration;
784
+ toPlainDate(day: {
785
+ day: number;
786
+ }): Temporal.PlainDate;
787
+ toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
788
+ toJSON(): string;
789
+ toString(options?: ShowCalendarOption): string;
790
+ valueOf(): never;
791
+ readonly [Symbol.toStringTag]: 'Temporal.PlainYearMonth';
792
+ }
793
+ type ZonedDateTimeLike = {
794
+ era?: string | undefined;
795
+ eraYear?: number | undefined;
796
+ year?: number;
797
+ month?: number;
798
+ monthCode?: string;
799
+ day?: number;
800
+ hour?: number;
801
+ minute?: number;
802
+ second?: number;
803
+ millisecond?: number;
804
+ microsecond?: number;
805
+ nanosecond?: number;
806
+ offset?: string;
807
+ timeZone?: TimeZoneLike;
808
+ calendar?: CalendarLike;
809
+ };
810
+ class ZonedDateTime {
811
+ static from(item: Temporal.ZonedDateTime | ZonedDateTimeLike | string, options?: ZonedDateTimeAssignmentOptions): ZonedDateTime;
812
+ static compare(one: Temporal.ZonedDateTime | ZonedDateTimeLike | string, two: Temporal.ZonedDateTime | ZonedDateTimeLike | string): ComparisonResult;
813
+ constructor(epochNanoseconds: bigint, timeZone: string, calendar?: string);
814
+ readonly era: string | undefined;
815
+ readonly eraYear: number | undefined;
816
+ readonly year: number;
817
+ readonly month: number;
818
+ readonly monthCode: string;
819
+ readonly day: number;
820
+ readonly hour: number;
821
+ readonly minute: number;
822
+ readonly second: number;
823
+ readonly millisecond: number;
824
+ readonly microsecond: number;
825
+ readonly nanosecond: number;
826
+ readonly timeZoneId: string;
827
+ readonly calendarId: string;
828
+ readonly dayOfWeek: number;
829
+ readonly dayOfYear: number;
830
+ readonly weekOfYear: number | undefined;
831
+ readonly yearOfWeek: number | undefined;
832
+ readonly hoursInDay: number;
833
+ readonly daysInWeek: number;
834
+ readonly daysInMonth: number;
835
+ readonly daysInYear: number;
836
+ readonly monthsInYear: number;
837
+ readonly inLeapYear: boolean;
838
+ readonly offsetNanoseconds: number;
839
+ readonly offset: string;
840
+ readonly epochMilliseconds: number;
841
+ readonly epochNanoseconds: bigint;
842
+ equals(other: Temporal.ZonedDateTime | ZonedDateTimeLike | string): boolean;
843
+ with(zonedDateTimeLike: ZonedDateTimeLike, options?: ZonedDateTimeAssignmentOptions): Temporal.ZonedDateTime;
844
+ withPlainTime(timeLike?: Temporal.PlainTime | PlainTimeLike | string): Temporal.ZonedDateTime;
845
+ withCalendar(calendar: CalendarLike): Temporal.ZonedDateTime;
846
+ withTimeZone(timeZone: TimeZoneLike): Temporal.ZonedDateTime;
847
+ add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.ZonedDateTime;
848
+ subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.ZonedDateTime;
849
+ until(other: Temporal.ZonedDateTime | ZonedDateTimeLike | string, options?: Temporal.DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
850
+ since(other: Temporal.ZonedDateTime | ZonedDateTimeLike | string, options?: Temporal.DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
851
+ round(roundTo: RoundTo<'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.ZonedDateTime;
852
+ startOfDay(): Temporal.ZonedDateTime;
853
+ getTimeZoneTransition(direction: TransitionDirection): Temporal.ZonedDateTime | null;
854
+ toInstant(): Temporal.Instant;
855
+ toPlainDateTime(): Temporal.PlainDateTime;
856
+ toPlainDate(): Temporal.PlainDate;
857
+ toPlainTime(): Temporal.PlainTime;
858
+ toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
859
+ toJSON(): string;
860
+ toString(options?: ZonedDateTimeToStringOptions): string;
861
+ valueOf(): never;
862
+ readonly [Symbol.toStringTag]: 'Temporal.ZonedDateTime';
863
+ }
864
+ /**
865
+ * The `Temporal.Now` object has several methods which give information about
866
+ * the current date, time, and time zone.
867
+ *
868
+ * See https://tc39.es/proposal-temporal/docs/now.html for more details.
869
+ */
870
+ const Now: {
871
+ /**
872
+ * Get the exact system date and time as a `Temporal.Instant`.
873
+ *
874
+ * This method gets the current exact system time, without regard to
875
+ * calendar or time zone. This is a good way to get a timestamp for an
876
+ * event, for example. It works like the old-style JavaScript `Date.now()`,
877
+ * but with nanosecond precision instead of milliseconds.
878
+ *
879
+ * Note that a `Temporal.Instant` doesn't know about time zones. For the
880
+ * exact time in a specific time zone, use `Temporal.Now.zonedDateTimeISO`
881
+ * or `Temporal.Now.zonedDateTime`.
882
+ * */
883
+ instant: () => Temporal.Instant;
884
+ /**
885
+ * Get the current calendar date and clock time in a specific time zone,
886
+ * using the ISO 8601 calendar.
887
+ *
888
+ * @param {TimeZoneLike} [tzLike] -
889
+ * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|IANA time zone identifier}
890
+ * string (e.g. `'Europe/London'`). If omitted, the environment's
891
+ * current time zone will be used.
892
+ */
893
+ zonedDateTimeISO: (tzLike?: TimeZoneLike) => Temporal.ZonedDateTime;
894
+ /**
895
+ * Get the current date and clock time in a specific time zone, using the
896
+ * ISO 8601 calendar.
897
+ *
898
+ * Note that the `Temporal.PlainDateTime` type does not persist the time zone,
899
+ * but retaining the time zone is required for most time-zone-related use
900
+ * cases. Therefore, it's usually recommended to use
901
+ * `Temporal.Now.zonedDateTimeISO` instead of this function.
902
+ *
903
+ * @param {TimeZoneLike} [tzLike] -
904
+ * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|IANA time zone identifier}
905
+ * string (e.g. `'Europe/London'`). If omitted, the environment's
906
+ * current time zone will be used.
907
+ */
908
+ plainDateTimeISO: (tzLike?: TimeZoneLike) => Temporal.PlainDateTime;
909
+ /**
910
+ * Get the current date in a specific time zone, using the ISO 8601
911
+ * calendar.
912
+ *
913
+ * @param {TimeZoneLike} [tzLike] -
914
+ * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|IANA time zone identifier}
915
+ * string (e.g. `'Europe/London'`). If omitted, the environment's
916
+ * current time zone will be used.
917
+ */
918
+ plainDateISO: (tzLike?: TimeZoneLike) => Temporal.PlainDate;
919
+ /**
920
+ * Get the current clock time in a specific time zone, using the ISO 8601 calendar.
921
+ *
922
+ * @param {TimeZoneLike} [tzLike] -
923
+ * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|IANA time zone identifier}
924
+ * string (e.g. `'Europe/London'`). If omitted, the environment's
925
+ * current time zone will be used.
926
+ */
927
+ plainTimeISO: (tzLike?: TimeZoneLike) => Temporal.PlainTime;
928
+ /**
929
+ * Get the identifier of the environment's current time zone.
930
+ *
931
+ * This method gets the identifier of the current system time zone. This
932
+ * will usually be a named
933
+ * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|IANA time zone}.
934
+ */
935
+ timeZoneId: () => string;
936
+ readonly [Symbol.toStringTag]: 'Temporal.Now';
937
+ };
938
+ }
939
+ //# sourceMappingURL=types.d.ts.map