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

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