forked from tc39/proposal-temporal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZonedDateTime.nocomments.d.ts
96 lines (96 loc) · 3.27 KB
/
ZonedDateTime.nocomments.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import { Temporal } from '../../poc';
export declare type ZonedDateTimeLike = Temporal.DateTimeLike & {
timeZone?: Temporal.TimeZone | string;
offset?: string;
};
declare type ZonedDateTimeFields = ReturnType<Temporal.DateTime['getFields']> & {
timeZone: Temporal.TimeZone;
offset: string;
};
declare type ZonedDateTimeISOFields = ReturnType<Temporal.DateTime['getISOFields']> & {
timeZone: Temporal.TimeZone;
offset: string;
};
export interface offsetDisambiguationOptions {
offset: 'use' | 'prefer' | 'ignore' | 'reject';
}
export declare type ZonedDateTimeAssignmentOptions = Partial<
Temporal.AssignmentOptions & Temporal.ToInstantOptions & offsetDisambiguationOptions
>;
export declare class ZonedDateTime {
private _abs;
private _tz;
private _dt;
constructor(epochNanoseconds: bigint, timeZone: Temporal.TimeZoneProtocol, calendar?: Temporal.CalendarProtocol);
static from(
item: ZonedDateTimeLike | string | Record<string, unknown>,
options?: ZonedDateTimeAssignmentOptions
): ZonedDateTime;
with(zonedDateTimeLike: ZonedDateTimeLike, options?: ZonedDateTimeAssignmentOptions): ZonedDateTime;
withCalendar(calendar: Temporal.CalendarProtocol): ZonedDateTime;
withTimeZone(timeZone: Temporal.TimeZoneProtocol | string): ZonedDateTime;
toInstant(): Temporal.Instant;
get timeZone(): Temporal.TimeZone;
get calendar(): Temporal.CalendarProtocol;
toDateTime(): Temporal.DateTime;
get hoursInDay(): number;
get startOfDay(): ZonedDateTime;
get isOffsetTransition(): boolean;
get offsetNanoseconds(): number;
get offset(): string;
getFields(): ZonedDateTimeFields;
getISOFields(): ZonedDateTimeISOFields;
static compare(one: ZonedDateTime, two: ZonedDateTime): Temporal.ComparisonResult;
equals(other: ZonedDateTime): boolean;
add(durationLike: Temporal.DurationLike, options?: Temporal.ArithmeticOptions): ZonedDateTime;
subtract(durationLike: Temporal.DurationLike, options?: Temporal.ArithmeticOptions): ZonedDateTime;
difference(
other: ZonedDateTime,
options?: Temporal.DifferenceOptions<
| 'years'
| 'months'
| 'weeks'
| 'days'
| 'hours'
| 'minutes'
| 'seconds'
| 'milliseconds'
| 'microseconds'
| 'nanoseconds'
>
): Temporal.Duration;
round(
options: Temporal.RoundOptions<'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>
): ZonedDateTime;
toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
toJSON(): string;
toString(): string;
get era(): string | undefined;
get year(): number;
get month(): number;
get day(): number;
get hour(): number;
get minute(): number;
get second(): number;
get millisecond(): number;
get microsecond(): number;
get nanosecond(): number;
get dayOfWeek(): number;
get dayOfYear(): number;
get weekOfYear(): number;
get daysInYear(): number;
get daysInMonth(): number;
get daysInWeek(): number;
get monthsInYear(): number;
get isLeapYear(): boolean;
toDate(): Temporal.Date;
toYearMonth(): Temporal.YearMonth;
toMonthDay(): Temporal.MonthDay;
toTime(): Temporal.Time;
valueOf(): never;
get epochSeconds(): number;
get epochMilliseconds(): number;
get epochMicroseconds(): bigint;
get epochNanoseconds(): bigint;
}
export {};