@everwhen/temporal
Version:
19 lines (18 loc) • 999 B
TypeScript
import { Temporal } from 'temporal-polyfill';
import { Duration } from './duration.js';
import { MethodParameters } from './type-utils.js';
import { ZonedDateTime } from './zoned-date-time.js';
export type InstantLike = Instant | Temporal.Instant;
export declare class Instant extends Temporal.Instant {
static now(): Instant;
static from(...args: Parameters<typeof Temporal.Instant.from>): Instant;
compare(other: InstantLike): Temporal.ComparisonResult;
isBefore(other: InstantLike): boolean;
isAfter(other: InstantLike): boolean;
add(...args: MethodParameters<Temporal.Instant, 'add'>): Instant;
subtract(...args: MethodParameters<Temporal.Instant, 'subtract'>): Instant;
round(...args: MethodParameters<Temporal.Instant, 'round'>): Instant;
since(...args: MethodParameters<Temporal.Instant, 'since'>): Duration;
until(...args: MethodParameters<Temporal.Instant, 'until'>): Duration;
toZonedDateTimeISO(tzLike: Temporal.TimeZoneLike): ZonedDateTime;
}