@vuetify/v0 0.2.0 → 0.2.1

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 (153) hide show
  1. package/README.md +124 -58
  2. package/dist/{adapter-DIZk5xrU.d.mts → adapter-BZjmDNJF.d.mts} +7 -7
  3. package/dist/{adapter-DXRKF27V.mjs → adapter-CCIeOzqr.mjs} +10 -8
  4. package/dist/{adapter-MT5TiIjj.d.mts → adapter-CcHB7rs3.d.mts} +2 -2
  5. package/dist/adapter-T7AedXkz.d.mts +96 -0
  6. package/dist/adapters-BbNfjyvY.mjs +5 -0
  7. package/dist/adapters-BhNTUuxE.mjs +2 -0
  8. package/dist/adapters-BzRMo72Y.mjs +4 -0
  9. package/dist/adapters-Cd8NDs18.mjs +3 -0
  10. package/dist/adapters-_DyP1X4U.mjs +2 -0
  11. package/dist/browser/index.js +12238 -9321
  12. package/dist/components/index.d.mts +3 -3
  13. package/dist/components/index.mjs +2 -36
  14. package/dist/{components-lme-T9bN.mjs → components-C142GPl_.mjs} +4771 -2631
  15. package/dist/composables/index.d.mts +19 -19
  16. package/dist/composables/index.mjs +26 -34
  17. package/dist/{consola-bPHDMwrK.d.mts → consola-Byg0ybzh.d.mts} +2 -2
  18. package/dist/constants/index.d.mts +1 -1
  19. package/dist/constants/index.mjs +1 -1
  20. package/dist/{createDataTable-DGG3Kgau.mjs → createDataTable-DKE5QsMe.mjs} +7 -4
  21. package/dist/{createGroup-C38Mc-se.mjs → createGroup-CzRZ9COh.mjs} +24 -22
  22. package/dist/{createPagination-CeGMgKCx.mjs → createPagination-Tp4C4He8.mjs} +6 -4
  23. package/dist/{createSelection-GS1yfwki.mjs → createSelection-Dsb3I0zm.mjs} +17 -13
  24. package/dist/{createSingle-Dh2gp4kv.mjs → createSingle-C7IGUjP6.mjs} +11 -9
  25. package/dist/{createTokens-Ckczb95n.mjs → createTokens-CHTawmud.mjs} +9 -8
  26. package/dist/{createTrinity-C_c8eedz.mjs → createTrinity-vvXk0ARD.mjs} +3 -3
  27. package/dist/data-table/adapters/client/index.d.mts +1 -1
  28. package/dist/data-table/adapters/client/index.mjs +1 -6
  29. package/dist/data-table/adapters/index.d.mts +4 -4
  30. package/dist/data-table/adapters/index.mjs +5 -9
  31. package/dist/data-table/adapters/server/index.d.mts +1 -1
  32. package/dist/data-table/adapters/server/index.mjs +1 -4
  33. package/dist/data-table/adapters/virtual/index.d.mts +1 -1
  34. package/dist/data-table/adapters/virtual/index.mjs +1 -6
  35. package/dist/data-table/index.d.mts +5 -5
  36. package/dist/data-table/index.mjs +5 -21
  37. package/dist/date/index.d.mts +2 -1
  38. package/dist/date/index.mjs +31 -6952
  39. package/dist/features/adapters/flagsmith/index.d.mts +1 -13
  40. package/dist/features/adapters/flagsmith/index.mjs +1 -1
  41. package/dist/features/adapters/launchdarkly/index.d.mts +1 -12
  42. package/dist/features/adapters/launchdarkly/index.mjs +1 -1
  43. package/dist/features/adapters/posthog/index.d.mts +1 -12
  44. package/dist/features/adapters/posthog/index.mjs +1 -2
  45. package/dist/features/index.d.mts +2 -2
  46. package/dist/features/index.mjs +1 -12
  47. package/dist/{flagsmith-CrWUeIhT.mjs → flagsmith-DQnnahG5.mjs} +9 -2
  48. package/dist/{globals-B6VQTLVM.mjs → globals-BrRJkuSY.mjs} +1 -1
  49. package/dist/{index-BsNeOyXe.d.mts → index-76fQGkkO.d.mts} +1 -1
  50. package/dist/{index-CuUuJj3-.d.mts → index-BFuSOgUi.d.mts} +7847 -5130
  51. package/dist/{index-Y0Bo7jx-.d.mts → index-BUsrN1vL.d.mts} +29 -29
  52. package/dist/{index-D7Yh-7yN.d.mts → index-B_AlCD7t.d.mts} +1 -1
  53. package/dist/{index-BAix61Ke.d.mts → index-B_XLHftL.d.mts} +3946 -3566
  54. package/dist/{index-pwVD-IDb.d.mts → index-CDcl4wPo.d.mts} +1 -1
  55. package/dist/{index-D5ehwqoP.d.mts → index-DoGxDgdN.d.mts} +3 -3
  56. package/dist/{index-A6Vo3pb6.d.mts → index-Dxx0eMLi.d.mts} +13 -2
  57. package/dist/index-F2Fmxnzi.d.mts +13 -0
  58. package/dist/index-M8EpGjjA.d.mts +13 -0
  59. package/dist/index-PWQavSPf.d.mts +1 -0
  60. package/dist/index-c55Utzva.d.mts +1 -0
  61. package/dist/index-tyzwWFHS.d.mts +14 -0
  62. package/dist/index.d.mts +23 -23
  63. package/dist/index.mjs +29 -36
  64. package/dist/json/attributes.json +678 -34
  65. package/dist/json/importMap.json +166 -2
  66. package/dist/json/tags.json +348 -12
  67. package/dist/json/web-types.json +3074 -1038
  68. package/dist/{launchdarkly-DEqUn7qm.mjs → launchdarkly-2_48EJ1_.mjs} +8 -1
  69. package/dist/locale/adapters/index.d.mts +2 -2
  70. package/dist/locale/adapters/index.mjs +2 -3
  71. package/dist/locale/adapters/v0/index.d.mts +1 -1
  72. package/dist/locale/adapters/v0/index.mjs +1 -2
  73. package/dist/locale/adapters/vue-i18n/index.d.mts +1 -1
  74. package/dist/locale/adapters/vue-i18n/index.mjs +0 -1
  75. package/dist/locale/index.d.mts +3 -3
  76. package/dist/locale/index.mjs +2 -12
  77. package/dist/logger/adapters/consola/index.d.mts +1 -1
  78. package/dist/logger/adapters/index.d.mts +4 -4
  79. package/dist/logger/adapters/index.mjs +3 -4
  80. package/dist/logger/adapters/pino/index.d.mts +2 -2
  81. package/dist/logger/adapters/pino/index.mjs +1 -2
  82. package/dist/logger/adapters/v0/index.d.mts +1 -1
  83. package/dist/logger/adapters/v0/index.mjs +1 -2
  84. package/dist/logger/index.d.mts +5 -5
  85. package/dist/logger/index.mjs +3 -6
  86. package/dist/notifications/index.d.mts +1 -1
  87. package/dist/notifications/index.mjs +1 -1
  88. package/dist/palettes/ant/index.d.mts +1 -1
  89. package/dist/palettes/index.d.mts +3 -3
  90. package/dist/palettes/material/index.d.mts +1 -1
  91. package/dist/palettes/md1/index.d.mts +1 -1
  92. package/dist/palettes/md2/index.d.mts +1 -1
  93. package/dist/palettes/radix/index.d.mts +1 -1
  94. package/dist/palettes/tailwind/index.d.mts +1 -1
  95. package/dist/permissions/adapters/index.d.mts +1 -2
  96. package/dist/permissions/adapters/index.mjs +2 -3
  97. package/dist/permissions/adapters/v0/index.d.mts +1 -1
  98. package/dist/permissions/adapters/v0/index.mjs +1 -2
  99. package/dist/permissions/index.d.mts +1 -1
  100. package/dist/permissions/index.mjs +2 -11
  101. package/dist/{pino-B7tJ3m18.mjs → pino-9L79n6y6.mjs} +0 -7
  102. package/dist/{pino-BUGULcfS.d.mts → pino-BxddSW2l.d.mts} +11 -3
  103. package/dist/{posthog-BUVv9Rky.mjs → posthog-Ccm8FQfD.mjs} +8 -8
  104. package/dist/rules/index.d.mts +1 -1
  105. package/dist/rules/index.mjs +1 -13
  106. package/dist/{server-CYYGvVps.mjs → server-CIftA0pK.mjs} +1 -1
  107. package/dist/{server-Ciw0ZhhL.d.mts → server-DNUTnISs.d.mts} +1 -1
  108. package/dist/storage/adapters/index.d.mts +2 -2
  109. package/dist/storage/adapters/memory/index.d.mts +1 -1
  110. package/dist/storage/index.d.mts +3 -3
  111. package/dist/storage/index.mjs +1 -33
  112. package/dist/theme/adapters/index.d.mts +1 -1
  113. package/dist/theme/adapters/index.mjs +3 -4
  114. package/dist/theme/adapters/unhead/index.d.mts +1 -1
  115. package/dist/theme/adapters/unhead/index.mjs +1 -3
  116. package/dist/theme/adapters/v0/index.d.mts +1 -1
  117. package/dist/theme/adapters/v0/index.mjs +1 -3
  118. package/dist/theme/index.d.mts +1 -1
  119. package/dist/theme/index.mjs +3 -14
  120. package/dist/{toArray-VdROPpy-.mjs → toArray-doLQVI56.mjs} +2 -0
  121. package/dist/types/index.d.mts +1 -1
  122. package/dist/{unhead-CMUN7pv4.mjs → unhead--58lO3Z-.mjs} +4 -3
  123. package/dist/{createCombobox-DgFUWLKw.mjs → useClickOutside-BjO3Nty9.mjs} +6313 -5560
  124. package/dist/{useFeatures-_uwRwuBy.mjs → useFeatures-D9bGOvh4.mjs} +11 -9
  125. package/dist/{useLocale-BNecStw9.mjs → useLocale-BRQTt3Ka.mjs} +10 -9
  126. package/dist/{useLogger-B3ijAgn0.mjs → useLogger-Daz-Zr0z.mjs} +8 -6
  127. package/dist/{usePermissions-5g7JSb3-.mjs → usePermissions-Yp3guoLH.mjs} +6 -5
  128. package/dist/{useRules-BnQZP8n2.mjs → useRules-BFPH7q8w.mjs} +5 -2
  129. package/dist/{useTheme-CKcE6z3t.mjs → useTheme-zRa0Nh_g.mjs} +10 -9
  130. package/dist/utilities/index.d.mts +2 -2
  131. package/dist/utilities/index.mjs +18 -3
  132. package/dist/{v0-B_8xEDpf.d.mts → v0-BAG8p0si.d.mts} +1 -1
  133. package/dist/{v0-C64RQgkl.mjs → v0-Bno8FQ_F.mjs} +1 -1
  134. package/dist/{v0-WOPq3YTM.d.mts → v0-BpgPZ1qB.d.mts} +1 -1
  135. package/dist/{v0-C3cGdshz.d.mts → v0-C2UMaHUa.d.mts} +1 -1
  136. package/dist/{v0-3e8B6fd8.mjs → v0-CcV0VwYd.mjs} +1 -1
  137. package/dist/{v0-Dab-mQua.mjs → v0-D-AEQbvj.mjs} +1 -1
  138. package/dist/{v0-D87sooe0.mjs → v0-DOq_Ia5H.mjs} +2 -2
  139. package/dist/{virtual-By1prSSj.d.mts → virtual-BaQWQ9ji.d.mts} +1 -1
  140. package/dist/{virtual-D75KhU6Q.mjs → virtual-D1HwNBLS.mjs} +2 -2
  141. package/package.json +10 -14
  142. package/dist/adapter-cc0r4Pfu.d.mts +0 -1087
  143. package/dist/adapters-BjeDmKc6.mjs +0 -1
  144. package/dist/adapters-Bv5aRv3l.mjs +0 -1
  145. package/dist/adapters-BvwLemDt.mjs +0 -1
  146. package/dist/adapters-DkVblyML.mjs +0 -1
  147. package/dist/adapters-uJLWGQJl.mjs +0 -1
  148. package/dist/v0-BRnEUnx1.d.mts +0 -10
  149. /package/dist/{adapter-CST7kApg.d.mts → adapter-DNKjooxI.d.mts} +0 -0
  150. /package/dist/{index-BvlxDVXg.d.mts → index-D6mQAEs2.d.mts} +0 -0
  151. /package/dist/{index-C9Wj_it8.d.mts → index-DxruGeVY.d.mts} +0 -0
  152. /package/dist/{memory-CC5pKIAp.d.mts → memory-DUyWthic.d.mts} +0 -0
  153. /package/dist/{v0-B1QQGE4O.mjs → v0-4OQBCeda.mjs} +0 -0
@@ -1,1087 +0,0 @@
1
- //#region ../../node_modules/.pnpm/@js-temporal+polyfill@0.5.1/node_modules/@js-temporal/polyfill/index.d.ts
2
- declare namespace Temporal {
3
- export type ComparisonResult = -1 | 0 | 1;
4
- export type RoundingMode = 'ceil' | 'floor' | 'expand' | 'trunc' | 'halfCeil' | 'halfFloor' | 'halfExpand' | 'halfTrunc' | 'halfEven';
5
- /**
6
- * Options for assigning fields using `with()` or entire objects with
7
- * `from()`.
8
- * */
9
- export type AssignmentOptions = {
10
- /**
11
- * How to deal with out-of-range values
12
- *
13
- * - In `'constrain'` mode, out-of-range values are clamped to the nearest
14
- * in-range value.
15
- * - In `'reject'` mode, out-of-range values will cause the function to
16
- * throw a RangeError.
17
- *
18
- * The default is `'constrain'`.
19
- */
20
- overflow?: 'constrain' | 'reject';
21
- };
22
- /**
23
- * Options for assigning fields using `Duration.prototype.with()` or entire
24
- * objects with `Duration.from()`, and for arithmetic with
25
- * `Duration.prototype.add()` and `Duration.prototype.subtract()`.
26
- * */
27
- export type DurationOptions = {
28
- /**
29
- * How to deal with out-of-range values
30
- *
31
- * - In `'constrain'` mode, out-of-range values are clamped to the nearest
32
- * in-range value.
33
- * - In `'balance'` mode, out-of-range values are resolved by balancing them
34
- * with the next highest unit.
35
- *
36
- * The default is `'constrain'`.
37
- */
38
- overflow?: 'constrain' | 'balance';
39
- };
40
- /**
41
- * Options for conversions of `Temporal.PlainDateTime` to `Temporal.Instant`
42
- * */
43
- export type ToInstantOptions = {
44
- /**
45
- * Controls handling of invalid or ambiguous times caused by time zone
46
- * offset changes like Daylight Saving time (DST) transitions.
47
- *
48
- * This option is only relevant if a `DateTime` value does not exist in the
49
- * destination time zone (e.g. near "Spring Forward" DST transitions), or
50
- * exists more than once (e.g. near "Fall Back" DST transitions).
51
- *
52
- * In case of ambiguous or nonexistent times, this option controls what
53
- * exact time to return:
54
- * - `'compatible'`: Equivalent to `'earlier'` for backward transitions like
55
- * the start of DST in the Spring, and `'later'` for forward transitions
56
- * like the end of DST in the Fall. This matches the behavior of legacy
57
- * `Date`, of libraries like moment.js, Luxon, or date-fns, and of
58
- * cross-platform standards like [RFC 5545
59
- * (iCalendar)](https://tools.ietf.org/html/rfc5545).
60
- * - `'earlier'`: The earlier time of two possible times
61
- * - `'later'`: The later of two possible times
62
- * - `'reject'`: Throw a RangeError instead
63
- *
64
- * The default is `'compatible'`.
65
- *
66
- * */
67
- disambiguation?: 'compatible' | 'earlier' | 'later' | 'reject';
68
- };
69
- type OffsetDisambiguationOptions = {
70
- /**
71
- * Time zone definitions can change. If an application stores data about
72
- * events in the future, then stored data about future events may become
73
- * ambiguous, for example if a country permanently abolishes DST. The
74
- * `offset` option controls this unusual case.
75
- *
76
- * - `'use'` always uses the offset (if it's provided) to calculate the
77
- * instant. This ensures that the result will match the instant that was
78
- * originally stored, even if local clock time is different.
79
- * - `'prefer'` uses the offset if it's valid for the date/time in this time
80
- * zone, but if it's not valid then the time zone will be used as a
81
- * fallback to calculate the instant.
82
- * - `'ignore'` will disregard any provided offset. Instead, the time zone
83
- * and date/time value are used to calculate the instant. This will keep
84
- * local clock time unchanged but may result in a different real-world
85
- * instant.
86
- * - `'reject'` acts like `'prefer'`, except it will throw a RangeError if
87
- * the offset is not valid for the given time zone identifier and
88
- * date/time value.
89
- *
90
- * If the ISO string ends in 'Z' then this option is ignored because there
91
- * is no possibility of ambiguity.
92
- *
93
- * If a time zone offset is not present in the input, then this option is
94
- * ignored because the time zone will always be used to calculate the
95
- * offset.
96
- *
97
- * If the offset is not used, and if the date/time and time zone don't
98
- * uniquely identify a single instant, then the `disambiguation` option will
99
- * be used to choose the correct instant. However, if the offset is used
100
- * then the `disambiguation` option will be ignored.
101
- */
102
- offset?: 'use' | 'prefer' | 'ignore' | 'reject';
103
- };
104
- export type ZonedDateTimeAssignmentOptions = Partial<AssignmentOptions & ToInstantOptions & OffsetDisambiguationOptions>;
105
- /**
106
- * Options for arithmetic operations like `add()` and `subtract()`
107
- * */
108
- export type ArithmeticOptions = {
109
- /**
110
- * Controls handling of out-of-range arithmetic results.
111
- *
112
- * If a result is out of range, then `'constrain'` will clamp the result to
113
- * the allowed range, while `'reject'` will throw a RangeError.
114
- *
115
- * The default is `'constrain'`.
116
- */
117
- overflow?: 'constrain' | 'reject';
118
- };
119
- export type DateUnit = 'year' | 'month' | 'week' | 'day';
120
- export type TimeUnit = 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond';
121
- export type DateTimeUnit = DateUnit | TimeUnit;
122
- /**
123
- * When the name of a unit is provided to a Temporal API as a string, it is
124
- * usually singular, e.g. 'day' or 'hour'. But plural unit names like 'days'
125
- * or 'hours' are also accepted.
126
- * */
127
- export type PluralUnit<T extends DateTimeUnit> = {
128
- year: 'years';
129
- month: 'months';
130
- week: 'weeks';
131
- day: 'days';
132
- hour: 'hours';
133
- minute: 'minutes';
134
- second: 'seconds';
135
- millisecond: 'milliseconds';
136
- microsecond: 'microseconds';
137
- nanosecond: 'nanoseconds';
138
- }[T];
139
- export type LargestUnit<T extends DateTimeUnit> = 'auto' | T | PluralUnit<T>;
140
- export type SmallestUnit<T extends DateTimeUnit> = T | PluralUnit<T>;
141
- export type TotalUnit<T extends DateTimeUnit> = T | PluralUnit<T>;
142
- /**
143
- * Options for outputting precision in toString() on types with seconds
144
- */
145
- export type ToStringPrecisionOptions = {
146
- fractionalSecondDigits?: 'auto' | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
147
- smallestUnit?: SmallestUnit<'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>;
148
- /**
149
- * Controls how rounding is performed:
150
- * - `halfExpand`: Round to the nearest of the values allowed by
151
- * `roundingIncrement` and `smallestUnit`. When there is a tie, round up.
152
- * This mode is the default.
153
- * - `ceil`: Always round up, towards the end of time.
154
- * - `trunc`: Always round down, towards the beginning of time.
155
- * - `floor`: Also round down, towards the beginning of time. This mode acts
156
- * the same as `trunc`, but it's included for consistency with
157
- * `Temporal.Duration.round()` where negative values are allowed and
158
- * `trunc` rounds towards zero, unlike `floor` which rounds towards
159
- * negative infinity which is usually unexpected. For this reason, `trunc`
160
- * is recommended for most use cases.
161
- */
162
- roundingMode?: RoundingMode;
163
- };
164
- export type ShowCalendarOption = {
165
- calendarName?: 'auto' | 'always' | 'never' | 'critical';
166
- };
167
- export type CalendarTypeToStringOptions = Partial<ToStringPrecisionOptions & ShowCalendarOption>;
168
- export type ZonedDateTimeToStringOptions = Partial<CalendarTypeToStringOptions & {
169
- timeZoneName?: 'auto' | 'never' | 'critical';
170
- offset?: 'auto' | 'never';
171
- }>;
172
- export type InstantToStringOptions = Partial<ToStringPrecisionOptions & {
173
- timeZone: TimeZoneLike;
174
- }>;
175
- /**
176
- * Options to control the result of `until()` and `since()` methods in
177
- * `Temporal` types.
178
- */
179
- export interface DifferenceOptions<T extends DateTimeUnit> {
180
- /**
181
- * The unit to round to. For example, to round to the nearest minute, use
182
- * `smallestUnit: 'minute'`. This property is optional for `until()` and
183
- * `since()`, because those methods default behavior is not to round.
184
- * However, the same property is required for `round()`.
185
- */
186
- smallestUnit?: SmallestUnit<T>;
187
- /**
188
- * The largest unit to allow in the resulting `Temporal.Duration` object.
189
- *
190
- * Larger units will be "balanced" into smaller units. For example, if
191
- * `largestUnit` is `'minute'` then a two-hour duration will be output as a
192
- * 120-minute duration.
193
- *
194
- * Valid values may include `'year'`, `'month'`, `'week'`, `'day'`,
195
- * `'hour'`, `'minute'`, `'second'`, `'millisecond'`, `'microsecond'`,
196
- * `'nanosecond'` and `'auto'`, although some types may throw an exception
197
- * if a value is used that would produce an invalid result. For example,
198
- * `hours` is not accepted by `Temporal.PlainDate.prototype.since()`.
199
- *
200
- * The default is always `'auto'`, though the meaning of this depends on the
201
- * type being used.
202
- */
203
- largestUnit?: LargestUnit<T>;
204
- /**
205
- * Allows rounding to an integer number of units. For example, to round to
206
- * increments of a half hour, use `{ smallestUnit: 'minute',
207
- * roundingIncrement: 30 }`.
208
- */
209
- roundingIncrement?: number;
210
- /**
211
- * Controls how rounding is performed:
212
- * - `halfExpand`: Round to the nearest of the values allowed by
213
- * `roundingIncrement` and `smallestUnit`. When there is a tie, round away
214
- * from zero like `ceil` for positive durations and like `floor` for
215
- * negative durations.
216
- * - `ceil`: Always round up, towards the end of time.
217
- * - `trunc`: Always round down, towards the beginning of time. This mode is
218
- * the default.
219
- * - `floor`: Also round down, towards the beginning of time. This mode acts
220
- * the same as `trunc`, but it's included for consistency with
221
- * `Temporal.Duration.round()` where negative values are allowed and
222
- * `trunc` rounds towards zero, unlike `floor` which rounds towards
223
- * negative infinity which is usually unexpected. For this reason, `trunc`
224
- * is recommended for most use cases.
225
- */
226
- roundingMode?: RoundingMode;
227
- }
228
- /**
229
- * `round` methods take one required parameter. If a string is provided, the
230
- * resulting `Temporal.Duration` object will be rounded to that unit. If an
231
- * object is provided, its `smallestUnit` property is required while other
232
- * properties are optional. A string is treated the same as an object whose
233
- * `smallestUnit` property value is that string.
234
- */
235
- export type RoundTo<T extends DateTimeUnit> = SmallestUnit<T> | {
236
- /**
237
- * The unit to round to. For example, to round to the nearest minute,
238
- * use `smallestUnit: 'minute'`. This option is required. Note that the
239
- * same-named property is optional when passed to `until` or `since`
240
- * methods, because those methods do no rounding by default.
241
- */
242
- smallestUnit: SmallestUnit<T>;
243
- /**
244
- * Allows rounding to an integer number of units. For example, to round to
245
- * increments of a half hour, use `{ smallestUnit: 'minute',
246
- * roundingIncrement: 30 }`.
247
- */
248
- roundingIncrement?: number;
249
- /**
250
- * Controls how rounding is performed:
251
- * - `halfExpand`: Round to the nearest of the values allowed by
252
- * `roundingIncrement` and `smallestUnit`. When there is a tie, round up.
253
- * This mode is the default.
254
- * - `ceil`: Always round up, towards the end of time.
255
- * - `trunc`: Always round down, towards the beginning of time.
256
- * - `floor`: Also round down, towards the beginning of time. This mode acts
257
- * the same as `trunc`, but it's included for consistency with
258
- * `Temporal.Duration.round()` where negative values are allowed and
259
- * `trunc` rounds towards zero, unlike `floor` which rounds towards
260
- * negative infinity which is usually unexpected. For this reason, `trunc`
261
- * is recommended for most use cases.
262
- */
263
- roundingMode?: RoundingMode;
264
- };
265
- /**
266
- * The `round` method of the `Temporal.Duration` accepts one required
267
- * parameter. If a string is provided, the resulting `Temporal.Duration`
268
- * object will be rounded to that unit. If an object is provided, the
269
- * `smallestUnit` and/or `largestUnit` property is required, while other
270
- * properties are optional. A string parameter is treated the same as an
271
- * object whose `smallestUnit` property value is that string.
272
- */
273
- export type DurationRoundTo = SmallestUnit<DateTimeUnit> | (({
274
- /**
275
- * The unit to round to. For example, to round to the nearest
276
- * minute, use `smallestUnit: 'minute'`. This property is normally
277
- * required, but is optional if `largestUnit` is provided and not
278
- * undefined.
279
- */
280
- smallestUnit: SmallestUnit<DateTimeUnit>;
281
- /**
282
- * The largest unit to allow in the resulting `Temporal.Duration`
283
- * object.
284
- *
285
- * Larger units will be "balanced" into smaller units. For example,
286
- * if `largestUnit` is `'minute'` then a two-hour duration will be
287
- * output as a 120-minute duration.
288
- *
289
- * Valid values include `'year'`, `'month'`, `'week'`, `'day'`,
290
- * `'hour'`, `'minute'`, `'second'`, `'millisecond'`,
291
- * `'microsecond'`, `'nanosecond'` and `'auto'`.
292
- *
293
- * The default is `'auto'`, which means "the largest nonzero unit in
294
- * the input duration". This default prevents expanding durations to
295
- * larger units unless the caller opts into this behavior.
296
- *
297
- * If `smallestUnit` is larger, then `smallestUnit` will be used as
298
- * `largestUnit`, superseding a caller-supplied or default value.
299
- */
300
- largestUnit?: LargestUnit<DateTimeUnit>;
301
- } | {
302
- /**
303
- * The unit to round to. For example, to round to the nearest
304
- * minute, use `smallestUnit: 'minute'`. This property is normally
305
- * required, but is optional if `largestUnit` is provided and not
306
- * undefined.
307
- */
308
- smallestUnit?: SmallestUnit<DateTimeUnit>;
309
- /**
310
- * The largest unit to allow in the resulting `Temporal.Duration`
311
- * object.
312
- *
313
- * Larger units will be "balanced" into smaller units. For example,
314
- * if `largestUnit` is `'minute'` then a two-hour duration will be
315
- * output as a 120-minute duration.
316
- *
317
- * Valid values include `'year'`, `'month'`, `'week'`, `'day'`,
318
- * `'hour'`, `'minute'`, `'second'`, `'millisecond'`,
319
- * `'microsecond'`, `'nanosecond'` and `'auto'`.
320
- *
321
- * The default is `'auto'`, which means "the largest nonzero unit in
322
- * the input duration". This default prevents expanding durations to
323
- * larger units unless the caller opts into this behavior.
324
- *
325
- * If `smallestUnit` is larger, then `smallestUnit` will be used as
326
- * `largestUnit`, superseding a caller-supplied or default value.
327
- */
328
- largestUnit: LargestUnit<DateTimeUnit>;
329
- }) & {
330
- /**
331
- * Allows rounding to an integer number of units. For example, to round
332
- * to increments of a half hour, use `{ smallestUnit: 'minute',
333
- * roundingIncrement: 30 }`.
334
- */
335
- roundingIncrement?: number;
336
- /**
337
- * Controls how rounding is performed:
338
- * - `halfExpand`: Round to the nearest of the values allowed by
339
- * `roundingIncrement` and `smallestUnit`. When there is a tie, round
340
- * away from zero like `ceil` for positive durations and like `floor`
341
- * for negative durations. This mode is the default.
342
- * - `ceil`: Always round towards positive infinity. For negative
343
- * durations this option will decrease the absolute value of the
344
- * duration which may be unexpected. To round away from zero, use
345
- * `ceil` for positive durations and `floor` for negative durations.
346
- * - `trunc`: Always round down towards zero.
347
- * - `floor`: Always round towards negative infinity. This mode acts the
348
- * same as `trunc` for positive durations but for negative durations
349
- * it will increase the absolute value of the result which may be
350
- * unexpected. For this reason, `trunc` is recommended for most "round
351
- * down" use cases.
352
- */
353
- roundingMode?: RoundingMode;
354
- /**
355
- * The starting point to use for rounding and conversions when
356
- * variable-length units (years, months, weeks depending on the
357
- * calendar) are involved. This option is required if any of the
358
- * following are true:
359
- * - `unit` is `'week'` or larger units
360
- * - `this` has a nonzero value for `weeks` or larger units
361
- *
362
- * This value must be either a `Temporal.PlainDateTime`, a
363
- * `Temporal.ZonedDateTime`, or a string or object value that can be
364
- * passed to `from()` of those types. Examples:
365
- * - `'2020-01-01T00:00-08:00[America/Los_Angeles]'`
366
- * - `'2020-01-01'`
367
- * - `Temporal.PlainDate.from('2020-01-01')`
368
- *
369
- * `Temporal.ZonedDateTime` will be tried first because it's more
370
- * specific, with `Temporal.PlainDateTime` as a fallback.
371
- *
372
- * If the value resolves to a `Temporal.ZonedDateTime`, then operation
373
- * will adjust for DST and other time zone transitions. Otherwise
374
- * (including if this option is omitted), then the operation will ignore
375
- * time zone transitions and all days will be assumed to be 24 hours
376
- * long.
377
- */
378
- relativeTo?: Temporal.PlainDateTime | Temporal.ZonedDateTime | PlainDateTimeLike | ZonedDateTimeLike | string;
379
- });
380
- /**
381
- * Options to control behavior of `Duration.prototype.total()`
382
- */
383
- export type DurationTotalOf = TotalUnit<DateTimeUnit> | {
384
- /**
385
- * The unit to convert the duration to. This option is required.
386
- */
387
- unit: TotalUnit<DateTimeUnit>;
388
- /**
389
- * The starting point to use when variable-length units (years, months,
390
- * weeks depending on the calendar) are involved. This option is required if
391
- * any of the following are true:
392
- * - `unit` is `'week'` or larger units
393
- * - `this` has a nonzero value for `weeks` or larger units
394
- *
395
- * This value must be either a `Temporal.PlainDateTime`, a
396
- * `Temporal.ZonedDateTime`, or a string or object value that can be passed
397
- * to `from()` of those types. Examples:
398
- * - `'2020-01-01T00:00-08:00[America/Los_Angeles]'`
399
- * - `'2020-01-01'`
400
- * - `Temporal.PlainDate.from('2020-01-01')`
401
- *
402
- * `Temporal.ZonedDateTime` will be tried first because it's more
403
- * specific, with `Temporal.PlainDateTime` as a fallback.
404
- *
405
- * If the value resolves to a `Temporal.ZonedDateTime`, then operation will
406
- * adjust for DST and other time zone transitions. Otherwise (including if
407
- * this option is omitted), then the operation will ignore time zone
408
- * transitions and all days will be assumed to be 24 hours long.
409
- */
410
- relativeTo?: Temporal.ZonedDateTime | Temporal.PlainDateTime | ZonedDateTimeLike | PlainDateTimeLike | string;
411
- };
412
- /**
413
- * Options to control behavior of `Duration.compare()`
414
- */
415
- export interface DurationArithmeticOptions {
416
- /**
417
- * The starting point to use when variable-length units (years, months,
418
- * weeks depending on the calendar) are involved. This option is required if
419
- * either of the durations has a nonzero value for `weeks` or larger units.
420
- *
421
- * This value must be either a `Temporal.PlainDateTime`, a
422
- * `Temporal.ZonedDateTime`, or a string or object value that can be passed
423
- * to `from()` of those types. Examples:
424
- * - `'2020-01-01T00:00-08:00[America/Los_Angeles]'`
425
- * - `'2020-01-01'`
426
- * - `Temporal.PlainDate.from('2020-01-01')`
427
- *
428
- * `Temporal.ZonedDateTime` will be tried first because it's more
429
- * specific, with `Temporal.PlainDateTime` as a fallback.
430
- *
431
- * If the value resolves to a `Temporal.ZonedDateTime`, then operation will
432
- * adjust for DST and other time zone transitions. Otherwise (including if
433
- * this option is omitted), then the operation will ignore time zone
434
- * transitions and all days will be assumed to be 24 hours long.
435
- */
436
- relativeTo?: Temporal.ZonedDateTime | Temporal.PlainDateTime | ZonedDateTimeLike | PlainDateTimeLike | string;
437
- }
438
- /**
439
- * Options to control behaviour of `ZonedDateTime.prototype.getTimeZoneTransition()`
440
- */
441
- export type TransitionDirection = 'next' | 'previous' | {
442
- direction: 'next' | 'previous';
443
- }; // Handle Intl.LocalesArgument regardless of whether the TS version has it yet
444
- type LocalesArgument = ConstructorParameters<typeof Intl.DateTimeFormat>[0]; // Provide a quick replacement for Intl.DurationFormatOptions if not in TS
445
- type DurationFormatOptions = typeof Intl extends {
446
- DurationFormat: any;
447
- } ? ConstructorParameters<(typeof Intl)['DurationFormat']>[1] : Record<string, unknown>;
448
- export type DurationLike = {
449
- years?: number;
450
- months?: number;
451
- weeks?: number;
452
- days?: number;
453
- hours?: number;
454
- minutes?: number;
455
- seconds?: number;
456
- milliseconds?: number;
457
- microseconds?: number;
458
- nanoseconds?: number;
459
- };
460
- /**
461
- *
462
- * A `Temporal.Duration` represents an immutable duration of time which can be
463
- * used in date/time arithmetic.
464
- *
465
- * See https://tc39.es/proposal-temporal/docs/duration.html for more details.
466
- */
467
- export class Duration {
468
- static from(item: Temporal.Duration | DurationLike | string): Temporal.Duration;
469
- static compare(one: Temporal.Duration | DurationLike | string, two: Temporal.Duration | DurationLike | string, options?: DurationArithmeticOptions): ComparisonResult;
470
- constructor(years?: number, months?: number, weeks?: number, days?: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number, microseconds?: number, nanoseconds?: number);
471
- readonly sign: -1 | 0 | 1;
472
- readonly blank: boolean;
473
- readonly years: number;
474
- readonly months: number;
475
- readonly weeks: number;
476
- readonly days: number;
477
- readonly hours: number;
478
- readonly minutes: number;
479
- readonly seconds: number;
480
- readonly milliseconds: number;
481
- readonly microseconds: number;
482
- readonly nanoseconds: number;
483
- negated(): Temporal.Duration;
484
- abs(): Temporal.Duration;
485
- with(durationLike: DurationLike): Temporal.Duration;
486
- add(other: Temporal.Duration | DurationLike | string): Temporal.Duration;
487
- subtract(other: Temporal.Duration | DurationLike | string): Temporal.Duration;
488
- round(roundTo: DurationRoundTo): Temporal.Duration;
489
- total(totalOf: DurationTotalOf): number;
490
- toLocaleString(locales?: LocalesArgument, options?: DurationFormatOptions): string;
491
- toJSON(): string;
492
- toString(options?: ToStringPrecisionOptions): string;
493
- valueOf(): never;
494
- readonly [Symbol.toStringTag]: 'Temporal.Duration';
495
- }
496
- /**
497
- * A `Temporal.Instant` is an exact point in time, with a precision in
498
- * nanoseconds. No time zone or calendar information is present. Therefore,
499
- * `Temporal.Instant` has no concept of days, months, or even hours.
500
- *
501
- * For convenience of interoperability, it internally uses nanoseconds since
502
- * the {@link https://en.wikipedia.org/wiki/Unix_time|Unix epoch} (midnight
503
- * UTC on January 1, 1970). However, a `Temporal.Instant` can be created from
504
- * any of several expressions that refer to a single point in time, including
505
- * an {@link https://datatracker.ietf.org/doc/html/rfc9557|RFC 9557 string}
506
- * with a time zone offset such as '2020-01-23T17:04:36.491865121-08:00'.
507
- *
508
- * See https://tc39.es/proposal-temporal/docs/instant.html for more details.
509
- */
510
- export class Instant {
511
- static fromEpochMilliseconds(epochMilliseconds: number): Temporal.Instant;
512
- static fromEpochNanoseconds(epochNanoseconds: bigint): Temporal.Instant;
513
- static from(item: Temporal.Instant | string): Temporal.Instant;
514
- static compare(one: Temporal.Instant | string, two: Temporal.Instant | string): ComparisonResult;
515
- constructor(epochNanoseconds: bigint);
516
- readonly epochMilliseconds: number;
517
- readonly epochNanoseconds: bigint;
518
- equals(other: Temporal.Instant | string): boolean;
519
- add(durationLike: Omit<Temporal.Duration | DurationLike, 'years' | 'months' | 'weeks' | 'days'> | string): Temporal.Instant;
520
- subtract(durationLike: Omit<Temporal.Duration | DurationLike, 'years' | 'months' | 'weeks' | 'days'> | string): Temporal.Instant;
521
- until(other: Temporal.Instant | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
522
- since(other: Temporal.Instant | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
523
- round(roundTo: RoundTo<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Instant;
524
- toZonedDateTimeISO(tzLike: TimeZoneLike): Temporal.ZonedDateTime;
525
- toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
526
- toJSON(): string;
527
- toString(options?: InstantToStringOptions): string;
528
- valueOf(): never;
529
- readonly [Symbol.toStringTag]: 'Temporal.Instant';
530
- }
531
- /**
532
- * Any of these types can be passed to Temporal methods instead of a calendar ID.
533
- * */
534
- export type CalendarLike = string | ZonedDateTime | PlainDateTime | PlainDate | PlainYearMonth | PlainMonthDay;
535
- export type PlainDateLike = {
536
- era?: string | undefined;
537
- eraYear?: number | undefined;
538
- year?: number;
539
- month?: number;
540
- monthCode?: string;
541
- day?: number;
542
- calendar?: CalendarLike;
543
- };
544
- /**
545
- * A `Temporal.PlainDate` represents a calendar date. "Calendar date" refers to the
546
- * concept of a date as expressed in everyday usage, independent of any time
547
- * zone. For example, it could be used to represent an event on a calendar
548
- * which happens during the whole day no matter which time zone it's happening
549
- * in.
550
- *
551
- * See https://tc39.es/proposal-temporal/docs/plaindate.html for more details.
552
- */
553
- export class PlainDate {
554
- static from(item: Temporal.PlainDate | PlainDateLike | string, options?: AssignmentOptions): Temporal.PlainDate;
555
- static compare(one: Temporal.PlainDate | PlainDateLike | string, two: Temporal.PlainDate | PlainDateLike | string): ComparisonResult;
556
- constructor(isoYear: number, isoMonth: number, isoDay: number, calendar?: string);
557
- readonly era: string | undefined;
558
- readonly eraYear: number | undefined;
559
- readonly year: number;
560
- readonly month: number;
561
- readonly monthCode: string;
562
- readonly day: number;
563
- readonly calendarId: string;
564
- readonly dayOfWeek: number;
565
- readonly dayOfYear: number;
566
- readonly weekOfYear: number | undefined;
567
- readonly yearOfWeek: number | undefined;
568
- readonly daysInWeek: number;
569
- readonly daysInYear: number;
570
- readonly daysInMonth: number;
571
- readonly monthsInYear: number;
572
- readonly inLeapYear: boolean;
573
- equals(other: Temporal.PlainDate | PlainDateLike | string): boolean;
574
- with(dateLike: PlainDateLike, options?: AssignmentOptions): Temporal.PlainDate;
575
- withCalendar(calendar: CalendarLike): Temporal.PlainDate;
576
- add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDate;
577
- subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDate;
578
- until(other: Temporal.PlainDate | PlainDateLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day'>): Temporal.Duration;
579
- since(other: Temporal.PlainDate | PlainDateLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day'>): Temporal.Duration;
580
- toPlainDateTime(temporalTime?: Temporal.PlainTime | PlainTimeLike | string): Temporal.PlainDateTime;
581
- toZonedDateTime(timeZoneAndTime: string | {
582
- timeZone: TimeZoneLike;
583
- plainTime?: Temporal.PlainTime | PlainTimeLike | string;
584
- }): Temporal.ZonedDateTime;
585
- toPlainYearMonth(): Temporal.PlainYearMonth;
586
- toPlainMonthDay(): Temporal.PlainMonthDay;
587
- toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
588
- toJSON(): string;
589
- toString(options?: ShowCalendarOption): string;
590
- valueOf(): never;
591
- readonly [Symbol.toStringTag]: 'Temporal.PlainDate';
592
- }
593
- export type PlainDateTimeLike = {
594
- era?: string | undefined;
595
- eraYear?: number | undefined;
596
- year?: number;
597
- month?: number;
598
- monthCode?: string;
599
- day?: number;
600
- hour?: number;
601
- minute?: number;
602
- second?: number;
603
- millisecond?: number;
604
- microsecond?: number;
605
- nanosecond?: number;
606
- calendar?: CalendarLike;
607
- };
608
- /**
609
- * A `Temporal.PlainDateTime` represents a calendar date and wall-clock time, with
610
- * a precision in nanoseconds, and without any time zone. Of the Temporal
611
- * classes carrying human-readable time information, it is the most general
612
- * and complete one. `Temporal.PlainDate`, `Temporal.PlainTime`, `Temporal.PlainYearMonth`,
613
- * and `Temporal.PlainMonthDay` all carry less information and should be used when
614
- * complete information is not required.
615
- *
616
- * See https://tc39.es/proposal-temporal/docs/plaindatetime.html for more details.
617
- */
618
- export class PlainDateTime {
619
- static from(item: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: AssignmentOptions): Temporal.PlainDateTime;
620
- static compare(one: Temporal.PlainDateTime | PlainDateTimeLike | string, two: Temporal.PlainDateTime | PlainDateTimeLike | string): ComparisonResult;
621
- constructor(isoYear: number, isoMonth: number, isoDay: number, hour?: number, minute?: number, second?: number, millisecond?: number, microsecond?: number, nanosecond?: number, calendar?: string);
622
- readonly era: string | undefined;
623
- readonly eraYear: number | undefined;
624
- readonly year: number;
625
- readonly month: number;
626
- readonly monthCode: string;
627
- readonly day: number;
628
- readonly hour: number;
629
- readonly minute: number;
630
- readonly second: number;
631
- readonly millisecond: number;
632
- readonly microsecond: number;
633
- readonly nanosecond: number;
634
- readonly calendarId: string;
635
- readonly dayOfWeek: number;
636
- readonly dayOfYear: number;
637
- readonly weekOfYear: number | undefined;
638
- readonly yearOfWeek: number | undefined;
639
- readonly daysInWeek: number;
640
- readonly daysInYear: number;
641
- readonly daysInMonth: number;
642
- readonly monthsInYear: number;
643
- readonly inLeapYear: boolean;
644
- equals(other: Temporal.PlainDateTime | PlainDateTimeLike | string): boolean;
645
- with(dateTimeLike: PlainDateTimeLike, options?: AssignmentOptions): Temporal.PlainDateTime;
646
- withPlainTime(timeLike?: Temporal.PlainTime | PlainTimeLike | string): Temporal.PlainDateTime;
647
- withCalendar(calendar: CalendarLike): Temporal.PlainDateTime;
648
- add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDateTime;
649
- subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDateTime;
650
- until(other: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
651
- since(other: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
652
- round(roundTo: RoundTo<'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.PlainDateTime;
653
- toZonedDateTime(tzLike: TimeZoneLike, options?: ToInstantOptions): Temporal.ZonedDateTime;
654
- toPlainDate(): Temporal.PlainDate;
655
- toPlainTime(): Temporal.PlainTime;
656
- toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
657
- toJSON(): string;
658
- toString(options?: CalendarTypeToStringOptions): string;
659
- valueOf(): never;
660
- readonly [Symbol.toStringTag]: 'Temporal.PlainDateTime';
661
- }
662
- export type PlainMonthDayLike = {
663
- era?: string | undefined;
664
- eraYear?: number | undefined;
665
- year?: number;
666
- month?: number;
667
- monthCode?: string;
668
- day?: number;
669
- calendar?: CalendarLike;
670
- };
671
- /**
672
- * A `Temporal.PlainMonthDay` represents a particular day on the calendar, but
673
- * without a year. For example, it could be used to represent a yearly
674
- * recurring event, like "Bastille Day is on the 14th of July."
675
- *
676
- * See https://tc39.es/proposal-temporal/docs/plainmonthday.html for more details.
677
- */
678
- export class PlainMonthDay {
679
- static from(item: Temporal.PlainMonthDay | PlainMonthDayLike | string, options?: AssignmentOptions): Temporal.PlainMonthDay;
680
- constructor(isoMonth: number, isoDay: number, calendar?: string, referenceISOYear?: number);
681
- readonly monthCode: string;
682
- readonly day: number;
683
- readonly calendarId: string;
684
- equals(other: Temporal.PlainMonthDay | PlainMonthDayLike | string): boolean;
685
- with(monthDayLike: PlainMonthDayLike, options?: AssignmentOptions): Temporal.PlainMonthDay;
686
- toPlainDate(year: {
687
- year: number;
688
- }): Temporal.PlainDate;
689
- toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
690
- toJSON(): string;
691
- toString(options?: ShowCalendarOption): string;
692
- valueOf(): never;
693
- readonly [Symbol.toStringTag]: 'Temporal.PlainMonthDay';
694
- }
695
- export type PlainTimeLike = {
696
- hour?: number;
697
- minute?: number;
698
- second?: number;
699
- millisecond?: number;
700
- microsecond?: number;
701
- nanosecond?: number;
702
- };
703
- /**
704
- * A `Temporal.PlainTime` represents a wall-clock time, with a precision in
705
- * nanoseconds, and without any time zone. "Wall-clock time" refers to the
706
- * concept of a time as expressed in everyday usage — the time that you read
707
- * off the clock on the wall. For example, it could be used to represent an
708
- * event that happens daily at a certain time, no matter what time zone.
709
- *
710
- * `Temporal.PlainTime` refers to a time with no associated calendar date; if you
711
- * need to refer to a specific time on a specific day, use
712
- * `Temporal.PlainDateTime`. A `Temporal.PlainTime` can be converted into a
713
- * `Temporal.PlainDateTime` by combining it with a `Temporal.PlainDate` using the
714
- * `toPlainDateTime()` method.
715
- *
716
- * See https://tc39.es/proposal-temporal/docs/plaintime.html for more details.
717
- */
718
- export class PlainTime {
719
- static from(item: Temporal.PlainTime | PlainTimeLike | string, options?: AssignmentOptions): Temporal.PlainTime;
720
- static compare(one: Temporal.PlainTime | PlainTimeLike | string, two: Temporal.PlainTime | PlainTimeLike | string): ComparisonResult;
721
- constructor(hour?: number, minute?: number, second?: number, millisecond?: number, microsecond?: number, nanosecond?: number);
722
- readonly hour: number;
723
- readonly minute: number;
724
- readonly second: number;
725
- readonly millisecond: number;
726
- readonly microsecond: number;
727
- readonly nanosecond: number;
728
- equals(other: Temporal.PlainTime | PlainTimeLike | string): boolean;
729
- with(timeLike: Temporal.PlainTime | PlainTimeLike, options?: AssignmentOptions): Temporal.PlainTime;
730
- add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime;
731
- subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime;
732
- until(other: Temporal.PlainTime | PlainTimeLike | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
733
- since(other: Temporal.PlainTime | PlainTimeLike | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
734
- round(roundTo: RoundTo<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.PlainTime;
735
- toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
736
- toJSON(): string;
737
- toString(options?: ToStringPrecisionOptions): string;
738
- valueOf(): never;
739
- readonly [Symbol.toStringTag]: 'Temporal.PlainTime';
740
- }
741
- /**
742
- * To provide a time zone to any non-constructor Temporal method, any of the
743
- * following are allowed:
744
- * - An IANA time zone ID string like "Europe/Paris"
745
- * - An RFC 9557 string that includes a time zone annotation like
746
- * "2025-03-13T05:40:57.499+01:00[Europe/Paris]"
747
- * - A `Temporal.ZonedDateTime` object
748
- */
749
- export type TimeZoneLike = string | ZonedDateTime;
750
- export type PlainYearMonthLike = {
751
- era?: string | undefined;
752
- eraYear?: number | undefined;
753
- year?: number;
754
- month?: number;
755
- monthCode?: string;
756
- calendar?: CalendarLike;
757
- };
758
- /**
759
- * A `Temporal.PlainYearMonth` represents a particular month on the calendar. For
760
- * example, it could be used to represent a particular instance of a monthly
761
- * recurring event, like "the June 2019 meeting".
762
- *
763
- * See https://tc39.es/proposal-temporal/docs/plainyearmonth.html for more details.
764
- */
765
- export class PlainYearMonth {
766
- static from(item: Temporal.PlainYearMonth | PlainYearMonthLike | string, options?: AssignmentOptions): Temporal.PlainYearMonth;
767
- static compare(one: Temporal.PlainYearMonth | PlainYearMonthLike | string, two: Temporal.PlainYearMonth | PlainYearMonthLike | string): ComparisonResult;
768
- constructor(isoYear: number, isoMonth: number, calendar?: string, referenceISODay?: number);
769
- readonly era: string | undefined;
770
- readonly eraYear: number | undefined;
771
- readonly year: number;
772
- readonly month: number;
773
- readonly monthCode: string;
774
- readonly calendarId: string;
775
- readonly daysInMonth: number;
776
- readonly daysInYear: number;
777
- readonly monthsInYear: number;
778
- readonly inLeapYear: boolean;
779
- equals(other: Temporal.PlainYearMonth | PlainYearMonthLike | string): boolean;
780
- with(yearMonthLike: PlainYearMonthLike, options?: AssignmentOptions): Temporal.PlainYearMonth;
781
- add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainYearMonth;
782
- subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainYearMonth;
783
- until(other: Temporal.PlainYearMonth | PlainYearMonthLike | string, options?: DifferenceOptions<'year' | 'month'>): Temporal.Duration;
784
- since(other: Temporal.PlainYearMonth | PlainYearMonthLike | string, options?: DifferenceOptions<'year' | 'month'>): Temporal.Duration;
785
- toPlainDate(day: {
786
- day: number;
787
- }): Temporal.PlainDate;
788
- toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
789
- toJSON(): string;
790
- toString(options?: ShowCalendarOption): string;
791
- valueOf(): never;
792
- readonly [Symbol.toStringTag]: 'Temporal.PlainYearMonth';
793
- }
794
- export type ZonedDateTimeLike = {
795
- era?: string | undefined;
796
- eraYear?: number | undefined;
797
- year?: number;
798
- month?: number;
799
- monthCode?: string;
800
- day?: number;
801
- hour?: number;
802
- minute?: number;
803
- second?: number;
804
- millisecond?: number;
805
- microsecond?: number;
806
- nanosecond?: number;
807
- offset?: string;
808
- timeZone?: TimeZoneLike;
809
- calendar?: CalendarLike;
810
- };
811
- export class ZonedDateTime {
812
- static from(item: Temporal.ZonedDateTime | ZonedDateTimeLike | string, options?: ZonedDateTimeAssignmentOptions): ZonedDateTime;
813
- static compare(one: Temporal.ZonedDateTime | ZonedDateTimeLike | string, two: Temporal.ZonedDateTime | ZonedDateTimeLike | string): ComparisonResult;
814
- constructor(epochNanoseconds: bigint, timeZone: string, calendar?: string);
815
- readonly era: string | undefined;
816
- readonly eraYear: number | undefined;
817
- readonly year: number;
818
- readonly month: number;
819
- readonly monthCode: string;
820
- readonly day: number;
821
- readonly hour: number;
822
- readonly minute: number;
823
- readonly second: number;
824
- readonly millisecond: number;
825
- readonly microsecond: number;
826
- readonly nanosecond: number;
827
- readonly timeZoneId: string;
828
- readonly calendarId: string;
829
- readonly dayOfWeek: number;
830
- readonly dayOfYear: number;
831
- readonly weekOfYear: number | undefined;
832
- readonly yearOfWeek: number | undefined;
833
- readonly hoursInDay: number;
834
- readonly daysInWeek: number;
835
- readonly daysInMonth: number;
836
- readonly daysInYear: number;
837
- readonly monthsInYear: number;
838
- readonly inLeapYear: boolean;
839
- readonly offsetNanoseconds: number;
840
- readonly offset: string;
841
- readonly epochMilliseconds: number;
842
- readonly epochNanoseconds: bigint;
843
- equals(other: Temporal.ZonedDateTime | ZonedDateTimeLike | string): boolean;
844
- with(zonedDateTimeLike: ZonedDateTimeLike, options?: ZonedDateTimeAssignmentOptions): Temporal.ZonedDateTime;
845
- withPlainTime(timeLike?: Temporal.PlainTime | PlainTimeLike | string): Temporal.ZonedDateTime;
846
- withCalendar(calendar: CalendarLike): Temporal.ZonedDateTime;
847
- withTimeZone(timeZone: TimeZoneLike): Temporal.ZonedDateTime;
848
- add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.ZonedDateTime;
849
- subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.ZonedDateTime;
850
- until(other: Temporal.ZonedDateTime | ZonedDateTimeLike | string, options?: Temporal.DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
851
- since(other: Temporal.ZonedDateTime | ZonedDateTimeLike | string, options?: Temporal.DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
852
- round(roundTo: RoundTo<'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.ZonedDateTime;
853
- startOfDay(): Temporal.ZonedDateTime;
854
- getTimeZoneTransition(direction: TransitionDirection): Temporal.ZonedDateTime | null;
855
- toInstant(): Temporal.Instant;
856
- toPlainDateTime(): Temporal.PlainDateTime;
857
- toPlainDate(): Temporal.PlainDate;
858
- toPlainTime(): Temporal.PlainTime;
859
- toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
860
- toJSON(): string;
861
- toString(options?: ZonedDateTimeToStringOptions): string;
862
- valueOf(): never;
863
- readonly [Symbol.toStringTag]: 'Temporal.ZonedDateTime';
864
- }
865
- /**
866
- * The `Temporal.Now` object has several methods which give information about
867
- * the current date, time, and time zone.
868
- *
869
- * See https://tc39.es/proposal-temporal/docs/now.html for more details.
870
- */
871
- export const Now: {
872
- /**
873
- * Get the exact system date and time as a `Temporal.Instant`.
874
- *
875
- * This method gets the current exact system time, without regard to
876
- * calendar or time zone. This is a good way to get a timestamp for an
877
- * event, for example. It works like the old-style JavaScript `Date.now()`,
878
- * but with nanosecond precision instead of milliseconds.
879
- *
880
- * Note that a `Temporal.Instant` doesn't know about time zones. For the
881
- * exact time in a specific time zone, use `Temporal.Now.zonedDateTimeISO`
882
- * or `Temporal.Now.zonedDateTime`.
883
- * */
884
- instant: () => Temporal.Instant;
885
- /**
886
- * Get the current calendar date and clock time in a specific time zone,
887
- * using the ISO 8601 calendar.
888
- *
889
- * @param {TimeZoneLike} [tzLike] -
890
- * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|IANA time zone identifier}
891
- * string (e.g. `'Europe/London'`). If omitted, the environment's
892
- * current time zone will be used.
893
- */
894
- zonedDateTimeISO: (tzLike?: TimeZoneLike) => Temporal.ZonedDateTime;
895
- /**
896
- * Get the current date and clock time in a specific time zone, using the
897
- * ISO 8601 calendar.
898
- *
899
- * Note that the `Temporal.PlainDateTime` type does not persist the time zone,
900
- * but retaining the time zone is required for most time-zone-related use
901
- * cases. Therefore, it's usually recommended to use
902
- * `Temporal.Now.zonedDateTimeISO` instead of this function.
903
- *
904
- * @param {TimeZoneLike} [tzLike] -
905
- * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|IANA time zone identifier}
906
- * string (e.g. `'Europe/London'`). If omitted, the environment's
907
- * current time zone will be used.
908
- */
909
- plainDateTimeISO: (tzLike?: TimeZoneLike) => Temporal.PlainDateTime;
910
- /**
911
- * Get the current date in a specific time zone, using the ISO 8601
912
- * calendar.
913
- *
914
- * @param {TimeZoneLike} [tzLike] -
915
- * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|IANA time zone identifier}
916
- * string (e.g. `'Europe/London'`). If omitted, the environment's
917
- * current time zone will be used.
918
- */
919
- plainDateISO: (tzLike?: TimeZoneLike) => Temporal.PlainDate;
920
- /**
921
- * Get the current clock time in a specific time zone, using the ISO 8601 calendar.
922
- *
923
- * @param {TimeZoneLike} [tzLike] -
924
- * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|IANA time zone identifier}
925
- * string (e.g. `'Europe/London'`). If omitted, the environment's
926
- * current time zone will be used.
927
- */
928
- plainTimeISO: (tzLike?: TimeZoneLike) => Temporal.PlainTime;
929
- /**
930
- * Get the identifier of the environment's current time zone.
931
- *
932
- * This method gets the identifier of the current system time zone. This
933
- * will usually be a named
934
- * {@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|IANA time zone}.
935
- */
936
- timeZoneId: () => string;
937
- readonly [Symbol.toStringTag]: 'Temporal.Now';
938
- };
939
- }
940
- declare namespace Intl {
941
- type Formattable = Date | Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate | Temporal.PlainTime | Temporal.PlainDateTime | Temporal.PlainYearMonth | Temporal.PlainMonthDay;
942
- export interface DateTimeFormat extends globalThis.Intl.DateTimeFormat {
943
- /**
944
- * Format a date into a string according to the locale and formatting
945
- * options of this `Intl.DateTimeFormat` object.
946
- *
947
- * @param date The date to format.
948
- */
949
- format(date?: Formattable | number): string;
950
- /**
951
- * Allow locale-aware formatting of strings produced by
952
- * `Intl.DateTimeFormat` formatters.
953
- *
954
- * @param date The date to format.
955
- */
956
- formatToParts(date?: Formattable | number): globalThis.Intl.DateTimeFormatPart[];
957
- /**
958
- * Format a date range in the most concise way based on the locale and
959
- * options provided when instantiating this `Intl.DateTimeFormat` object.
960
- *
961
- * @param startDate The start date of the range to format.
962
- * @param endDate The start date of the range to format. Must be the same
963
- * type as `startRange`.
964
- */
965
- formatRange<T extends Formattable>(startDate: T, endDate: T): string;
966
- formatRange(startDate: Date | number, endDate: Date | number): string;
967
- /**
968
- * Allow locale-aware formatting of tokens representing each part of the
969
- * formatted date range produced by `Intl.DateTimeFormat` formatters.
970
- *
971
- * @param startDate The start date of the range to format.
972
- * @param endDate The start date of the range to format. Must be the same
973
- * type as `startRange`.
974
- */
975
- formatRangeToParts<T extends Formattable>(startDate: T, endDate: T): globalThis.Intl.DateTimeRangeFormatPart[];
976
- formatRangeToParts(startDate: Date | number, endDate: Date | number): globalThis.Intl.DateTimeRangeFormatPart[];
977
- }
978
- export const DateTimeFormat: {
979
- /**
980
- * Creates `Intl.DateTimeFormat` objects that enable language-sensitive
981
- * date and time formatting.
982
- */
983
- new (locales?: string | string[], options?: globalThis.Intl.DateTimeFormatOptions): DateTimeFormat;
984
- (locales?: string | string[], options?: globalThis.Intl.DateTimeFormatOptions): DateTimeFormat;
985
- /**
986
- * Get an array containing those of the provided locales that are supported
987
- * in date and time formatting without having to fall back to the runtime's
988
- * default locale.
989
- */
990
- supportedLocalesOf(locales: string | string[], options?: globalThis.Intl.DateTimeFormatOptions): string[];
991
- };
992
- }
993
- //#endregion
994
- //#region src/composables/useDate/adapters/adapter.d.ts
995
- interface DateAdapter<T = Temporal.PlainDateTime> {
996
- /** Current locale for formatting */
997
- locale?: string;
998
- /** First day of week. 0=Sunday, 1=Monday, ... 6=Saturday. Managed by the plugin. */
999
- firstDayOfWeek?: number;
1000
- /** Create a date from various input types */
1001
- date: (value?: unknown) => T | null;
1002
- /** Convert to JavaScript Date object */
1003
- toJsDate: (value: T) => Date;
1004
- /** Parse ISO 8601 string */
1005
- parseISO: (date: string) => T;
1006
- /** Convert to ISO 8601 string */
1007
- toISO: (date: T) => string;
1008
- /** Parse date string with custom format */
1009
- parse: (value: string, format: string) => T | null;
1010
- /** Check if value is a valid date (type predicate for narrowing) */
1011
- isValid: (date: unknown) => date is T;
1012
- /** Check if value is null (type predicate for narrowing) */
1013
- isNull: (value: T | null) => value is null;
1014
- /** Get current locale code */
1015
- getCurrentLocaleCode: () => string;
1016
- /** Check if current locale uses 12-hour cycle */
1017
- is12HourCycleInCurrentLocale: () => boolean;
1018
- /** Format date using preset format key */
1019
- format: (date: T, formatString: string) => string;
1020
- /** Format date using custom format string */
1021
- formatByString: (date: T, formatString: string) => string;
1022
- /** Get helper text for format string (e.g., "mm/dd/yyyy") */
1023
- getFormatHelperText: (format: string) => string;
1024
- /** Format number according to locale */
1025
- formatNumber: (numberToFormat: string) => string;
1026
- /** Get meridiem text (AM/PM) for locale */
1027
- getMeridiemText: (ampm: 'am' | 'pm') => string;
1028
- startOfDay: (date: T) => T;
1029
- endOfDay: (date: T) => T;
1030
- startOfWeek: (date: T) => T;
1031
- endOfWeek: (date: T) => T;
1032
- startOfMonth: (date: T) => T;
1033
- endOfMonth: (date: T) => T;
1034
- startOfYear: (date: T) => T;
1035
- endOfYear: (date: T) => T;
1036
- addSeconds: (date: T, amount: number) => T;
1037
- addMinutes: (date: T, amount: number) => T;
1038
- addHours: (date: T, amount: number) => T;
1039
- addDays: (date: T, amount: number) => T;
1040
- addWeeks: (date: T, amount: number) => T;
1041
- addMonths: (date: T, amount: number) => T;
1042
- addYears: (date: T, amount: number) => T;
1043
- isAfter: (date: T, comparing: T) => boolean;
1044
- isAfterDay: (date: T, comparing: T) => boolean;
1045
- isAfterMonth: (date: T, comparing: T) => boolean;
1046
- isAfterYear: (date: T, comparing: T) => boolean;
1047
- isBefore: (date: T, comparing: T) => boolean;
1048
- isBeforeDay: (date: T, comparing: T) => boolean;
1049
- isBeforeMonth: (date: T, comparing: T) => boolean;
1050
- isBeforeYear: (date: T, comparing: T) => boolean;
1051
- isEqual: (date: T, comparing: T) => boolean;
1052
- isSameDay: (date: T, comparing: T) => boolean;
1053
- isSameMonth: (date: T, comparing: T) => boolean;
1054
- isSameYear: (date: T, comparing: T) => boolean;
1055
- isSameHour: (date: T, comparing: T) => boolean;
1056
- isWithinRange: (date: T, range: [T, T]) => boolean;
1057
- getYear: (date: T) => number;
1058
- getMonth: (date: T) => number;
1059
- getDate: (date: T) => number;
1060
- getHours: (date: T) => number;
1061
- getMinutes: (date: T) => number;
1062
- getSeconds: (date: T) => number;
1063
- /** @param comparing - Can be T or ISO string */
1064
- getDiff: (date: T, comparing: T | string, unit?: string) => number;
1065
- /** @param minimalDays - Minimum days in first week for it to count as week 1 */
1066
- getWeek: (date: T, minimalDays?: number) => number;
1067
- /** Get number of days in the month */
1068
- getDaysInMonth: (date: T) => number;
1069
- setYear: (date: T, year: number) => T;
1070
- setMonth: (date: T, month: number) => T;
1071
- setDate: (date: T, day: number) => T;
1072
- setHours: (date: T, hours: number) => T;
1073
- setMinutes: (date: T, minutes: number) => T;
1074
- setSeconds: (date: T, seconds: number) => T;
1075
- getWeekdays: (weekdayFormat?: 'long' | 'short' | 'narrow') => string[];
1076
- getWeekArray: (date: T) => T[][];
1077
- /** Get array of months in a year (12 dates, one for each month) */
1078
- getMonthArray: (date: T) => T[];
1079
- /** Get array of years between start and end dates */
1080
- getYearRange: (start: T, end: T) => T[];
1081
- getNextMonth: (date: T) => T;
1082
- getPreviousMonth: (date: T) => T;
1083
- /** Merge date from one value with time from another */
1084
- mergeDateAndTime: (date: T, time: T) => T;
1085
- }
1086
- //#endregion
1087
- export { Temporal as n, DateAdapter as t };