@nubjs/types 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/common.d.ts +243 -0
- package/index.d.ts +9 -833
- package/package.json +8 -4
- package/ts5.9/index.d.ts +651 -0
package/package.json
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubjs/types",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "TypeScript ambient declarations for code authored against the Nub runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/nubjs/nub",
|
|
7
7
|
"homepage": "https://nubjs.com",
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
|
-
"
|
|
10
|
-
".": {
|
|
11
|
-
"
|
|
9
|
+
"typesVersions": {
|
|
10
|
+
"<=5.9": {
|
|
11
|
+
"*": [
|
|
12
|
+
"ts5.9/index.d.ts"
|
|
13
|
+
]
|
|
12
14
|
}
|
|
13
15
|
},
|
|
14
16
|
"files": [
|
|
15
17
|
"index.d.ts",
|
|
18
|
+
"common.d.ts",
|
|
19
|
+
"ts5.9/index.d.ts",
|
|
16
20
|
"LICENSE"
|
|
17
21
|
],
|
|
18
22
|
"peerDependencies": {
|
package/ts5.9/index.d.ts
ADDED
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
// TypeScript 5.9 fallback entry point for @nubjs/types.
|
|
2
|
+
// Common Nub augmentations stay shared; only Temporal is version-routed because
|
|
3
|
+
// TypeScript 6 added an official lib.esnext.temporal whose type aliases cannot merge.
|
|
4
|
+
/// <reference path="../common.d.ts" />
|
|
5
|
+
/// <reference lib="esnext.iterator" />
|
|
6
|
+
|
|
7
|
+
// ── Temporal (vendored @js-temporal/polyfill@0.5.1; runtime/preload-common.cjs) ──
|
|
8
|
+
// TypeScript <=5.9 has no official Temporal library. The namespace below is
|
|
9
|
+
// inlined from @js-temporal/polyfill@0.5.1's index.d.ts (the version Nub bundles),
|
|
10
|
+
// with `export` markers stripped so it is an ambient global rather than a module
|
|
11
|
+
// export. Keep it in sync with the bundled polyfill version on every bump.
|
|
12
|
+
declare namespace Temporal {
|
|
13
|
+
type ComparisonResult = -1 | 0 | 1;
|
|
14
|
+
type RoundingMode =
|
|
15
|
+
| "ceil"
|
|
16
|
+
| "floor"
|
|
17
|
+
| "expand"
|
|
18
|
+
| "trunc"
|
|
19
|
+
| "halfCeil"
|
|
20
|
+
| "halfFloor"
|
|
21
|
+
| "halfExpand"
|
|
22
|
+
| "halfTrunc"
|
|
23
|
+
| "halfEven";
|
|
24
|
+
|
|
25
|
+
type AssignmentOptions = {
|
|
26
|
+
overflow?: "constrain" | "reject";
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type DurationOptions = {
|
|
30
|
+
overflow?: "constrain" | "balance";
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type ToInstantOptions = {
|
|
34
|
+
disambiguation?: "compatible" | "earlier" | "later" | "reject";
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type OffsetDisambiguationOptions = {
|
|
38
|
+
offset?: "use" | "prefer" | "ignore" | "reject";
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
type ZonedDateTimeAssignmentOptions = Partial<
|
|
42
|
+
AssignmentOptions & ToInstantOptions & OffsetDisambiguationOptions
|
|
43
|
+
>;
|
|
44
|
+
|
|
45
|
+
type ArithmeticOptions = {
|
|
46
|
+
overflow?: "constrain" | "reject";
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
type DateUnit = "year" | "month" | "week" | "day";
|
|
50
|
+
type TimeUnit = "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond";
|
|
51
|
+
type DateTimeUnit = DateUnit | TimeUnit;
|
|
52
|
+
|
|
53
|
+
type PluralUnit<T extends DateTimeUnit> = {
|
|
54
|
+
year: "years";
|
|
55
|
+
month: "months";
|
|
56
|
+
week: "weeks";
|
|
57
|
+
day: "days";
|
|
58
|
+
hour: "hours";
|
|
59
|
+
minute: "minutes";
|
|
60
|
+
second: "seconds";
|
|
61
|
+
millisecond: "milliseconds";
|
|
62
|
+
microsecond: "microseconds";
|
|
63
|
+
nanosecond: "nanoseconds";
|
|
64
|
+
}[T];
|
|
65
|
+
|
|
66
|
+
type LargestUnit<T extends DateTimeUnit> = "auto" | T | PluralUnit<T>;
|
|
67
|
+
type SmallestUnit<T extends DateTimeUnit> = T | PluralUnit<T>;
|
|
68
|
+
type TotalUnit<T extends DateTimeUnit> = T | PluralUnit<T>;
|
|
69
|
+
|
|
70
|
+
type ToStringPrecisionOptions = {
|
|
71
|
+
fractionalSecondDigits?: "auto" | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
72
|
+
smallestUnit?: SmallestUnit<"minute" | "second" | "millisecond" | "microsecond" | "nanosecond">;
|
|
73
|
+
roundingMode?: RoundingMode;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
type ShowCalendarOption = {
|
|
77
|
+
calendarName?: "auto" | "always" | "never" | "critical";
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
type CalendarTypeToStringOptions = Partial<ToStringPrecisionOptions & ShowCalendarOption>;
|
|
81
|
+
|
|
82
|
+
type ZonedDateTimeToStringOptions = Partial<
|
|
83
|
+
CalendarTypeToStringOptions & {
|
|
84
|
+
timeZoneName?: "auto" | "never" | "critical";
|
|
85
|
+
offset?: "auto" | "never";
|
|
86
|
+
}
|
|
87
|
+
>;
|
|
88
|
+
|
|
89
|
+
type InstantToStringOptions = Partial<
|
|
90
|
+
ToStringPrecisionOptions & {
|
|
91
|
+
timeZone: TimeZoneLike;
|
|
92
|
+
}
|
|
93
|
+
>;
|
|
94
|
+
|
|
95
|
+
interface DifferenceOptions<T extends DateTimeUnit> {
|
|
96
|
+
smallestUnit?: SmallestUnit<T>;
|
|
97
|
+
largestUnit?: LargestUnit<T>;
|
|
98
|
+
roundingIncrement?: number;
|
|
99
|
+
roundingMode?: RoundingMode;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
type RoundTo<T extends DateTimeUnit> =
|
|
103
|
+
| SmallestUnit<T>
|
|
104
|
+
| {
|
|
105
|
+
smallestUnit: SmallestUnit<T>;
|
|
106
|
+
roundingIncrement?: number;
|
|
107
|
+
roundingMode?: RoundingMode;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
type DurationRoundTo =
|
|
111
|
+
| SmallestUnit<DateTimeUnit>
|
|
112
|
+
| ((
|
|
113
|
+
| {
|
|
114
|
+
smallestUnit: SmallestUnit<DateTimeUnit>;
|
|
115
|
+
largestUnit?: LargestUnit<DateTimeUnit>;
|
|
116
|
+
}
|
|
117
|
+
| {
|
|
118
|
+
smallestUnit?: SmallestUnit<DateTimeUnit>;
|
|
119
|
+
largestUnit: LargestUnit<DateTimeUnit>;
|
|
120
|
+
}
|
|
121
|
+
) & {
|
|
122
|
+
roundingIncrement?: number;
|
|
123
|
+
roundingMode?: RoundingMode;
|
|
124
|
+
relativeTo?:
|
|
125
|
+
| Temporal.PlainDateTime
|
|
126
|
+
| Temporal.ZonedDateTime
|
|
127
|
+
| PlainDateTimeLike
|
|
128
|
+
| ZonedDateTimeLike
|
|
129
|
+
| string;
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
type DurationTotalOf =
|
|
133
|
+
| TotalUnit<DateTimeUnit>
|
|
134
|
+
| {
|
|
135
|
+
unit: TotalUnit<DateTimeUnit>;
|
|
136
|
+
relativeTo?:
|
|
137
|
+
| Temporal.ZonedDateTime
|
|
138
|
+
| Temporal.PlainDateTime
|
|
139
|
+
| ZonedDateTimeLike
|
|
140
|
+
| PlainDateTimeLike
|
|
141
|
+
| string;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
interface DurationArithmeticOptions {
|
|
145
|
+
relativeTo?:
|
|
146
|
+
| Temporal.ZonedDateTime
|
|
147
|
+
| Temporal.PlainDateTime
|
|
148
|
+
| ZonedDateTimeLike
|
|
149
|
+
| PlainDateTimeLike
|
|
150
|
+
| string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
type TransitionDirection = "next" | "previous" | { direction: "next" | "previous" };
|
|
154
|
+
|
|
155
|
+
type LocalesArgument = ConstructorParameters<typeof Intl.DateTimeFormat>[0];
|
|
156
|
+
type DurationFormatOptions = typeof Intl extends { DurationFormat: any }
|
|
157
|
+
? ConstructorParameters<(typeof Intl)["DurationFormat"]>[1]
|
|
158
|
+
: Record<string, unknown>;
|
|
159
|
+
|
|
160
|
+
type DurationLike = {
|
|
161
|
+
years?: number;
|
|
162
|
+
months?: number;
|
|
163
|
+
weeks?: number;
|
|
164
|
+
days?: number;
|
|
165
|
+
hours?: number;
|
|
166
|
+
minutes?: number;
|
|
167
|
+
seconds?: number;
|
|
168
|
+
milliseconds?: number;
|
|
169
|
+
microseconds?: number;
|
|
170
|
+
nanoseconds?: number;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
class Duration {
|
|
174
|
+
static from(item: Temporal.Duration | DurationLike | string): Temporal.Duration;
|
|
175
|
+
static compare(
|
|
176
|
+
one: Temporal.Duration | DurationLike | string,
|
|
177
|
+
two: Temporal.Duration | DurationLike | string,
|
|
178
|
+
options?: DurationArithmeticOptions
|
|
179
|
+
): ComparisonResult;
|
|
180
|
+
constructor(
|
|
181
|
+
years?: number,
|
|
182
|
+
months?: number,
|
|
183
|
+
weeks?: number,
|
|
184
|
+
days?: number,
|
|
185
|
+
hours?: number,
|
|
186
|
+
minutes?: number,
|
|
187
|
+
seconds?: number,
|
|
188
|
+
milliseconds?: number,
|
|
189
|
+
microseconds?: number,
|
|
190
|
+
nanoseconds?: number
|
|
191
|
+
);
|
|
192
|
+
readonly sign: -1 | 0 | 1;
|
|
193
|
+
readonly blank: boolean;
|
|
194
|
+
readonly years: number;
|
|
195
|
+
readonly months: number;
|
|
196
|
+
readonly weeks: number;
|
|
197
|
+
readonly days: number;
|
|
198
|
+
readonly hours: number;
|
|
199
|
+
readonly minutes: number;
|
|
200
|
+
readonly seconds: number;
|
|
201
|
+
readonly milliseconds: number;
|
|
202
|
+
readonly microseconds: number;
|
|
203
|
+
readonly nanoseconds: number;
|
|
204
|
+
negated(): Temporal.Duration;
|
|
205
|
+
abs(): Temporal.Duration;
|
|
206
|
+
with(durationLike: DurationLike): Temporal.Duration;
|
|
207
|
+
add(other: Temporal.Duration | DurationLike | string): Temporal.Duration;
|
|
208
|
+
subtract(other: Temporal.Duration | DurationLike | string): Temporal.Duration;
|
|
209
|
+
round(roundTo: DurationRoundTo): Temporal.Duration;
|
|
210
|
+
total(totalOf: DurationTotalOf): number;
|
|
211
|
+
toLocaleString(locales?: LocalesArgument, options?: DurationFormatOptions): string;
|
|
212
|
+
toJSON(): string;
|
|
213
|
+
toString(options?: ToStringPrecisionOptions): string;
|
|
214
|
+
valueOf(): never;
|
|
215
|
+
readonly [Symbol.toStringTag]: "Temporal.Duration";
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
class Instant {
|
|
219
|
+
static fromEpochMilliseconds(epochMilliseconds: number): Temporal.Instant;
|
|
220
|
+
static fromEpochNanoseconds(epochNanoseconds: bigint): Temporal.Instant;
|
|
221
|
+
static from(item: Temporal.Instant | string): Temporal.Instant;
|
|
222
|
+
static compare(one: Temporal.Instant | string, two: Temporal.Instant | string): ComparisonResult;
|
|
223
|
+
constructor(epochNanoseconds: bigint);
|
|
224
|
+
readonly epochMilliseconds: number;
|
|
225
|
+
readonly epochNanoseconds: bigint;
|
|
226
|
+
equals(other: Temporal.Instant | string): boolean;
|
|
227
|
+
add(
|
|
228
|
+
durationLike: Omit<Temporal.Duration | DurationLike, "years" | "months" | "weeks" | "days"> | string
|
|
229
|
+
): Temporal.Instant;
|
|
230
|
+
subtract(
|
|
231
|
+
durationLike: Omit<Temporal.Duration | DurationLike, "years" | "months" | "weeks" | "days"> | string
|
|
232
|
+
): Temporal.Instant;
|
|
233
|
+
until(
|
|
234
|
+
other: Temporal.Instant | string,
|
|
235
|
+
options?: DifferenceOptions<"hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">
|
|
236
|
+
): Temporal.Duration;
|
|
237
|
+
since(
|
|
238
|
+
other: Temporal.Instant | string,
|
|
239
|
+
options?: DifferenceOptions<"hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">
|
|
240
|
+
): Temporal.Duration;
|
|
241
|
+
round(
|
|
242
|
+
roundTo: RoundTo<"hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">
|
|
243
|
+
): Temporal.Instant;
|
|
244
|
+
toZonedDateTimeISO(tzLike: TimeZoneLike): Temporal.ZonedDateTime;
|
|
245
|
+
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
246
|
+
toJSON(): string;
|
|
247
|
+
toString(options?: InstantToStringOptions): string;
|
|
248
|
+
valueOf(): never;
|
|
249
|
+
readonly [Symbol.toStringTag]: "Temporal.Instant";
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
type CalendarLike = string | ZonedDateTime | PlainDateTime | PlainDate | PlainYearMonth | PlainMonthDay;
|
|
253
|
+
|
|
254
|
+
type PlainDateLike = {
|
|
255
|
+
era?: string | undefined;
|
|
256
|
+
eraYear?: number | undefined;
|
|
257
|
+
year?: number;
|
|
258
|
+
month?: number;
|
|
259
|
+
monthCode?: string;
|
|
260
|
+
day?: number;
|
|
261
|
+
calendar?: CalendarLike;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
class PlainDate {
|
|
265
|
+
static from(item: Temporal.PlainDate | PlainDateLike | string, options?: AssignmentOptions): Temporal.PlainDate;
|
|
266
|
+
static compare(
|
|
267
|
+
one: Temporal.PlainDate | PlainDateLike | string,
|
|
268
|
+
two: Temporal.PlainDate | PlainDateLike | string
|
|
269
|
+
): ComparisonResult;
|
|
270
|
+
constructor(isoYear: number, isoMonth: number, isoDay: number, calendar?: string);
|
|
271
|
+
readonly era: string | undefined;
|
|
272
|
+
readonly eraYear: number | undefined;
|
|
273
|
+
readonly year: number;
|
|
274
|
+
readonly month: number;
|
|
275
|
+
readonly monthCode: string;
|
|
276
|
+
readonly day: number;
|
|
277
|
+
readonly calendarId: string;
|
|
278
|
+
readonly dayOfWeek: number;
|
|
279
|
+
readonly dayOfYear: number;
|
|
280
|
+
readonly weekOfYear: number | undefined;
|
|
281
|
+
readonly yearOfWeek: number | undefined;
|
|
282
|
+
readonly daysInWeek: number;
|
|
283
|
+
readonly daysInYear: number;
|
|
284
|
+
readonly daysInMonth: number;
|
|
285
|
+
readonly monthsInYear: number;
|
|
286
|
+
readonly inLeapYear: boolean;
|
|
287
|
+
equals(other: Temporal.PlainDate | PlainDateLike | string): boolean;
|
|
288
|
+
with(dateLike: PlainDateLike, options?: AssignmentOptions): Temporal.PlainDate;
|
|
289
|
+
withCalendar(calendar: CalendarLike): Temporal.PlainDate;
|
|
290
|
+
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDate;
|
|
291
|
+
subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDate;
|
|
292
|
+
until(
|
|
293
|
+
other: Temporal.PlainDate | PlainDateLike | string,
|
|
294
|
+
options?: DifferenceOptions<"year" | "month" | "week" | "day">
|
|
295
|
+
): Temporal.Duration;
|
|
296
|
+
since(
|
|
297
|
+
other: Temporal.PlainDate | PlainDateLike | string,
|
|
298
|
+
options?: DifferenceOptions<"year" | "month" | "week" | "day">
|
|
299
|
+
): Temporal.Duration;
|
|
300
|
+
toPlainDateTime(temporalTime?: Temporal.PlainTime | PlainTimeLike | string): Temporal.PlainDateTime;
|
|
301
|
+
toZonedDateTime(
|
|
302
|
+
timeZoneAndTime:
|
|
303
|
+
| string
|
|
304
|
+
| {
|
|
305
|
+
timeZone: TimeZoneLike;
|
|
306
|
+
plainTime?: Temporal.PlainTime | PlainTimeLike | string;
|
|
307
|
+
}
|
|
308
|
+
): Temporal.ZonedDateTime;
|
|
309
|
+
toPlainYearMonth(): Temporal.PlainYearMonth;
|
|
310
|
+
toPlainMonthDay(): Temporal.PlainMonthDay;
|
|
311
|
+
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
312
|
+
toJSON(): string;
|
|
313
|
+
toString(options?: ShowCalendarOption): string;
|
|
314
|
+
valueOf(): never;
|
|
315
|
+
readonly [Symbol.toStringTag]: "Temporal.PlainDate";
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
type PlainDateTimeLike = {
|
|
319
|
+
era?: string | undefined;
|
|
320
|
+
eraYear?: number | undefined;
|
|
321
|
+
year?: number;
|
|
322
|
+
month?: number;
|
|
323
|
+
monthCode?: string;
|
|
324
|
+
day?: number;
|
|
325
|
+
hour?: number;
|
|
326
|
+
minute?: number;
|
|
327
|
+
second?: number;
|
|
328
|
+
millisecond?: number;
|
|
329
|
+
microsecond?: number;
|
|
330
|
+
nanosecond?: number;
|
|
331
|
+
calendar?: CalendarLike;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
class PlainDateTime {
|
|
335
|
+
static from(
|
|
336
|
+
item: Temporal.PlainDateTime | PlainDateTimeLike | string,
|
|
337
|
+
options?: AssignmentOptions
|
|
338
|
+
): Temporal.PlainDateTime;
|
|
339
|
+
static compare(
|
|
340
|
+
one: Temporal.PlainDateTime | PlainDateTimeLike | string,
|
|
341
|
+
two: Temporal.PlainDateTime | PlainDateTimeLike | string
|
|
342
|
+
): ComparisonResult;
|
|
343
|
+
constructor(
|
|
344
|
+
isoYear: number,
|
|
345
|
+
isoMonth: number,
|
|
346
|
+
isoDay: number,
|
|
347
|
+
hour?: number,
|
|
348
|
+
minute?: number,
|
|
349
|
+
second?: number,
|
|
350
|
+
millisecond?: number,
|
|
351
|
+
microsecond?: number,
|
|
352
|
+
nanosecond?: number,
|
|
353
|
+
calendar?: string
|
|
354
|
+
);
|
|
355
|
+
readonly era: string | undefined;
|
|
356
|
+
readonly eraYear: number | undefined;
|
|
357
|
+
readonly year: number;
|
|
358
|
+
readonly month: number;
|
|
359
|
+
readonly monthCode: string;
|
|
360
|
+
readonly day: number;
|
|
361
|
+
readonly hour: number;
|
|
362
|
+
readonly minute: number;
|
|
363
|
+
readonly second: number;
|
|
364
|
+
readonly millisecond: number;
|
|
365
|
+
readonly microsecond: number;
|
|
366
|
+
readonly nanosecond: number;
|
|
367
|
+
readonly calendarId: string;
|
|
368
|
+
readonly dayOfWeek: number;
|
|
369
|
+
readonly dayOfYear: number;
|
|
370
|
+
readonly weekOfYear: number | undefined;
|
|
371
|
+
readonly yearOfWeek: number | undefined;
|
|
372
|
+
readonly daysInWeek: number;
|
|
373
|
+
readonly daysInYear: number;
|
|
374
|
+
readonly daysInMonth: number;
|
|
375
|
+
readonly monthsInYear: number;
|
|
376
|
+
readonly inLeapYear: boolean;
|
|
377
|
+
equals(other: Temporal.PlainDateTime | PlainDateTimeLike | string): boolean;
|
|
378
|
+
with(dateTimeLike: PlainDateTimeLike, options?: AssignmentOptions): Temporal.PlainDateTime;
|
|
379
|
+
withPlainTime(timeLike?: Temporal.PlainTime | PlainTimeLike | string): Temporal.PlainDateTime;
|
|
380
|
+
withCalendar(calendar: CalendarLike): Temporal.PlainDateTime;
|
|
381
|
+
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDateTime;
|
|
382
|
+
subtract(
|
|
383
|
+
durationLike: Temporal.Duration | DurationLike | string,
|
|
384
|
+
options?: ArithmeticOptions
|
|
385
|
+
): Temporal.PlainDateTime;
|
|
386
|
+
until(
|
|
387
|
+
other: Temporal.PlainDateTime | PlainDateTimeLike | string,
|
|
388
|
+
options?: DifferenceOptions<
|
|
389
|
+
"year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond"
|
|
390
|
+
>
|
|
391
|
+
): Temporal.Duration;
|
|
392
|
+
since(
|
|
393
|
+
other: Temporal.PlainDateTime | PlainDateTimeLike | string,
|
|
394
|
+
options?: DifferenceOptions<
|
|
395
|
+
"year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond"
|
|
396
|
+
>
|
|
397
|
+
): Temporal.Duration;
|
|
398
|
+
round(
|
|
399
|
+
roundTo: RoundTo<"day" | "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">
|
|
400
|
+
): Temporal.PlainDateTime;
|
|
401
|
+
toZonedDateTime(tzLike: TimeZoneLike, options?: ToInstantOptions): Temporal.ZonedDateTime;
|
|
402
|
+
toPlainDate(): Temporal.PlainDate;
|
|
403
|
+
toPlainTime(): Temporal.PlainTime;
|
|
404
|
+
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
405
|
+
toJSON(): string;
|
|
406
|
+
toString(options?: CalendarTypeToStringOptions): string;
|
|
407
|
+
valueOf(): never;
|
|
408
|
+
readonly [Symbol.toStringTag]: "Temporal.PlainDateTime";
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
type PlainMonthDayLike = {
|
|
412
|
+
era?: string | undefined;
|
|
413
|
+
eraYear?: number | undefined;
|
|
414
|
+
year?: number;
|
|
415
|
+
month?: number;
|
|
416
|
+
monthCode?: string;
|
|
417
|
+
day?: number;
|
|
418
|
+
calendar?: CalendarLike;
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
class PlainMonthDay {
|
|
422
|
+
static from(
|
|
423
|
+
item: Temporal.PlainMonthDay | PlainMonthDayLike | string,
|
|
424
|
+
options?: AssignmentOptions
|
|
425
|
+
): Temporal.PlainMonthDay;
|
|
426
|
+
constructor(isoMonth: number, isoDay: number, calendar?: string, referenceISOYear?: number);
|
|
427
|
+
readonly monthCode: string;
|
|
428
|
+
readonly day: number;
|
|
429
|
+
readonly calendarId: string;
|
|
430
|
+
equals(other: Temporal.PlainMonthDay | PlainMonthDayLike | string): boolean;
|
|
431
|
+
with(monthDayLike: PlainMonthDayLike, options?: AssignmentOptions): Temporal.PlainMonthDay;
|
|
432
|
+
toPlainDate(year: { year: number }): Temporal.PlainDate;
|
|
433
|
+
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
434
|
+
toJSON(): string;
|
|
435
|
+
toString(options?: ShowCalendarOption): string;
|
|
436
|
+
valueOf(): never;
|
|
437
|
+
readonly [Symbol.toStringTag]: "Temporal.PlainMonthDay";
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
type PlainTimeLike = {
|
|
441
|
+
hour?: number;
|
|
442
|
+
minute?: number;
|
|
443
|
+
second?: number;
|
|
444
|
+
millisecond?: number;
|
|
445
|
+
microsecond?: number;
|
|
446
|
+
nanosecond?: number;
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
class PlainTime {
|
|
450
|
+
static from(item: Temporal.PlainTime | PlainTimeLike | string, options?: AssignmentOptions): Temporal.PlainTime;
|
|
451
|
+
static compare(
|
|
452
|
+
one: Temporal.PlainTime | PlainTimeLike | string,
|
|
453
|
+
two: Temporal.PlainTime | PlainTimeLike | string
|
|
454
|
+
): ComparisonResult;
|
|
455
|
+
constructor(
|
|
456
|
+
hour?: number,
|
|
457
|
+
minute?: number,
|
|
458
|
+
second?: number,
|
|
459
|
+
millisecond?: number,
|
|
460
|
+
microsecond?: number,
|
|
461
|
+
nanosecond?: number
|
|
462
|
+
);
|
|
463
|
+
readonly hour: number;
|
|
464
|
+
readonly minute: number;
|
|
465
|
+
readonly second: number;
|
|
466
|
+
readonly millisecond: number;
|
|
467
|
+
readonly microsecond: number;
|
|
468
|
+
readonly nanosecond: number;
|
|
469
|
+
equals(other: Temporal.PlainTime | PlainTimeLike | string): boolean;
|
|
470
|
+
with(timeLike: Temporal.PlainTime | PlainTimeLike, options?: AssignmentOptions): Temporal.PlainTime;
|
|
471
|
+
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime;
|
|
472
|
+
subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime;
|
|
473
|
+
until(
|
|
474
|
+
other: Temporal.PlainTime | PlainTimeLike | string,
|
|
475
|
+
options?: DifferenceOptions<"hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">
|
|
476
|
+
): Temporal.Duration;
|
|
477
|
+
since(
|
|
478
|
+
other: Temporal.PlainTime | PlainTimeLike | string,
|
|
479
|
+
options?: DifferenceOptions<"hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">
|
|
480
|
+
): Temporal.Duration;
|
|
481
|
+
round(
|
|
482
|
+
roundTo: RoundTo<"hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">
|
|
483
|
+
): Temporal.PlainTime;
|
|
484
|
+
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
485
|
+
toJSON(): string;
|
|
486
|
+
toString(options?: ToStringPrecisionOptions): string;
|
|
487
|
+
valueOf(): never;
|
|
488
|
+
readonly [Symbol.toStringTag]: "Temporal.PlainTime";
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
type TimeZoneLike = string | ZonedDateTime;
|
|
492
|
+
|
|
493
|
+
type PlainYearMonthLike = {
|
|
494
|
+
era?: string | undefined;
|
|
495
|
+
eraYear?: number | undefined;
|
|
496
|
+
year?: number;
|
|
497
|
+
month?: number;
|
|
498
|
+
monthCode?: string;
|
|
499
|
+
calendar?: CalendarLike;
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
class PlainYearMonth {
|
|
503
|
+
static from(
|
|
504
|
+
item: Temporal.PlainYearMonth | PlainYearMonthLike | string,
|
|
505
|
+
options?: AssignmentOptions
|
|
506
|
+
): Temporal.PlainYearMonth;
|
|
507
|
+
static compare(
|
|
508
|
+
one: Temporal.PlainYearMonth | PlainYearMonthLike | string,
|
|
509
|
+
two: Temporal.PlainYearMonth | PlainYearMonthLike | string
|
|
510
|
+
): ComparisonResult;
|
|
511
|
+
constructor(isoYear: number, isoMonth: number, calendar?: string, referenceISODay?: number);
|
|
512
|
+
readonly era: string | undefined;
|
|
513
|
+
readonly eraYear: number | undefined;
|
|
514
|
+
readonly year: number;
|
|
515
|
+
readonly month: number;
|
|
516
|
+
readonly monthCode: string;
|
|
517
|
+
readonly calendarId: string;
|
|
518
|
+
readonly daysInMonth: number;
|
|
519
|
+
readonly daysInYear: number;
|
|
520
|
+
readonly monthsInYear: number;
|
|
521
|
+
readonly inLeapYear: boolean;
|
|
522
|
+
equals(other: Temporal.PlainYearMonth | PlainYearMonthLike | string): boolean;
|
|
523
|
+
with(yearMonthLike: PlainYearMonthLike, options?: AssignmentOptions): Temporal.PlainYearMonth;
|
|
524
|
+
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainYearMonth;
|
|
525
|
+
subtract(
|
|
526
|
+
durationLike: Temporal.Duration | DurationLike | string,
|
|
527
|
+
options?: ArithmeticOptions
|
|
528
|
+
): Temporal.PlainYearMonth;
|
|
529
|
+
until(
|
|
530
|
+
other: Temporal.PlainYearMonth | PlainYearMonthLike | string,
|
|
531
|
+
options?: DifferenceOptions<"year" | "month">
|
|
532
|
+
): Temporal.Duration;
|
|
533
|
+
since(
|
|
534
|
+
other: Temporal.PlainYearMonth | PlainYearMonthLike | string,
|
|
535
|
+
options?: DifferenceOptions<"year" | "month">
|
|
536
|
+
): Temporal.Duration;
|
|
537
|
+
toPlainDate(day: { day: number }): Temporal.PlainDate;
|
|
538
|
+
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
539
|
+
toJSON(): string;
|
|
540
|
+
toString(options?: ShowCalendarOption): string;
|
|
541
|
+
valueOf(): never;
|
|
542
|
+
readonly [Symbol.toStringTag]: "Temporal.PlainYearMonth";
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
type ZonedDateTimeLike = {
|
|
546
|
+
era?: string | undefined;
|
|
547
|
+
eraYear?: number | undefined;
|
|
548
|
+
year?: number;
|
|
549
|
+
month?: number;
|
|
550
|
+
monthCode?: string;
|
|
551
|
+
day?: number;
|
|
552
|
+
hour?: number;
|
|
553
|
+
minute?: number;
|
|
554
|
+
second?: number;
|
|
555
|
+
millisecond?: number;
|
|
556
|
+
microsecond?: number;
|
|
557
|
+
nanosecond?: number;
|
|
558
|
+
offset?: string;
|
|
559
|
+
timeZone?: TimeZoneLike;
|
|
560
|
+
calendar?: CalendarLike;
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
class ZonedDateTime {
|
|
564
|
+
static from(
|
|
565
|
+
item: Temporal.ZonedDateTime | ZonedDateTimeLike | string,
|
|
566
|
+
options?: ZonedDateTimeAssignmentOptions
|
|
567
|
+
): ZonedDateTime;
|
|
568
|
+
static compare(
|
|
569
|
+
one: Temporal.ZonedDateTime | ZonedDateTimeLike | string,
|
|
570
|
+
two: Temporal.ZonedDateTime | ZonedDateTimeLike | string
|
|
571
|
+
): ComparisonResult;
|
|
572
|
+
constructor(epochNanoseconds: bigint, timeZone: string, calendar?: string);
|
|
573
|
+
readonly era: string | undefined;
|
|
574
|
+
readonly eraYear: number | undefined;
|
|
575
|
+
readonly year: number;
|
|
576
|
+
readonly month: number;
|
|
577
|
+
readonly monthCode: string;
|
|
578
|
+
readonly day: number;
|
|
579
|
+
readonly hour: number;
|
|
580
|
+
readonly minute: number;
|
|
581
|
+
readonly second: number;
|
|
582
|
+
readonly millisecond: number;
|
|
583
|
+
readonly microsecond: number;
|
|
584
|
+
readonly nanosecond: number;
|
|
585
|
+
readonly timeZoneId: string;
|
|
586
|
+
readonly calendarId: string;
|
|
587
|
+
readonly dayOfWeek: number;
|
|
588
|
+
readonly dayOfYear: number;
|
|
589
|
+
readonly weekOfYear: number | undefined;
|
|
590
|
+
readonly yearOfWeek: number | undefined;
|
|
591
|
+
readonly hoursInDay: number;
|
|
592
|
+
readonly daysInWeek: number;
|
|
593
|
+
readonly daysInMonth: number;
|
|
594
|
+
readonly daysInYear: number;
|
|
595
|
+
readonly monthsInYear: number;
|
|
596
|
+
readonly inLeapYear: boolean;
|
|
597
|
+
readonly offsetNanoseconds: number;
|
|
598
|
+
readonly offset: string;
|
|
599
|
+
readonly epochMilliseconds: number;
|
|
600
|
+
readonly epochNanoseconds: bigint;
|
|
601
|
+
equals(other: Temporal.ZonedDateTime | ZonedDateTimeLike | string): boolean;
|
|
602
|
+
with(zonedDateTimeLike: ZonedDateTimeLike, options?: ZonedDateTimeAssignmentOptions): Temporal.ZonedDateTime;
|
|
603
|
+
withPlainTime(timeLike?: Temporal.PlainTime | PlainTimeLike | string): Temporal.ZonedDateTime;
|
|
604
|
+
withCalendar(calendar: CalendarLike): Temporal.ZonedDateTime;
|
|
605
|
+
withTimeZone(timeZone: TimeZoneLike): Temporal.ZonedDateTime;
|
|
606
|
+
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.ZonedDateTime;
|
|
607
|
+
subtract(
|
|
608
|
+
durationLike: Temporal.Duration | DurationLike | string,
|
|
609
|
+
options?: ArithmeticOptions
|
|
610
|
+
): Temporal.ZonedDateTime;
|
|
611
|
+
until(
|
|
612
|
+
other: Temporal.ZonedDateTime | ZonedDateTimeLike | string,
|
|
613
|
+
options?: Temporal.DifferenceOptions<
|
|
614
|
+
"year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond"
|
|
615
|
+
>
|
|
616
|
+
): Temporal.Duration;
|
|
617
|
+
since(
|
|
618
|
+
other: Temporal.ZonedDateTime | ZonedDateTimeLike | string,
|
|
619
|
+
options?: Temporal.DifferenceOptions<
|
|
620
|
+
"year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond"
|
|
621
|
+
>
|
|
622
|
+
): Temporal.Duration;
|
|
623
|
+
round(
|
|
624
|
+
roundTo: RoundTo<"day" | "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond">
|
|
625
|
+
): Temporal.ZonedDateTime;
|
|
626
|
+
startOfDay(): Temporal.ZonedDateTime;
|
|
627
|
+
getTimeZoneTransition(direction: TransitionDirection): Temporal.ZonedDateTime | null;
|
|
628
|
+
toInstant(): Temporal.Instant;
|
|
629
|
+
toPlainDateTime(): Temporal.PlainDateTime;
|
|
630
|
+
toPlainDate(): Temporal.PlainDate;
|
|
631
|
+
toPlainTime(): Temporal.PlainTime;
|
|
632
|
+
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
633
|
+
toJSON(): string;
|
|
634
|
+
toString(options?: ZonedDateTimeToStringOptions): string;
|
|
635
|
+
valueOf(): never;
|
|
636
|
+
readonly [Symbol.toStringTag]: "Temporal.ZonedDateTime";
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
const Now: {
|
|
640
|
+
instant: () => Temporal.Instant;
|
|
641
|
+
zonedDateTimeISO: (tzLike?: TimeZoneLike) => Temporal.ZonedDateTime;
|
|
642
|
+
plainDateTimeISO: (tzLike?: TimeZoneLike) => Temporal.PlainDateTime;
|
|
643
|
+
plainDateISO: (tzLike?: TimeZoneLike) => Temporal.PlainDate;
|
|
644
|
+
plainTimeISO: (tzLike?: TimeZoneLike) => Temporal.PlainTime;
|
|
645
|
+
timeZoneId: () => string;
|
|
646
|
+
readonly [Symbol.toStringTag]: "Temporal.Now";
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
// `Temporal` is exposed as an ambient global namespace. It is both a type namespace
|
|
650
|
+
// and a value (its `class` and `const` members make it a runtime value), so no
|
|
651
|
+
// separate `declare var Temporal` is needed — and adding one collides (TS2300).
|