import { ZonedDateTime } from './ZonedDateTime.js'; import { Duration } from './Duration.js'; import { ZoneId, ZoneIdString } from './ZoneId.js'; import { DurationSpec } from './DurationSpec.js'; import { ISOSerializationOptions } from './util/ISOSerializationOptions.js'; import { DayOfMonthNumber, LocalDate, MonthNumber } from './LocalDate'; import { HourNumber, LocalTime, MinuteNumber } from './LocalTime'; declare const BRAND: unique symbol; export declare class Instant { static readonly EPOCH: Instant; private readonly secondsSinceEpoch; private readonly microsInSecond; private [BRAND]; private constructor(); static of(year: number, month: MonthNumber | number, dayOfMonth: DayOfMonthNumber | number, timeZone: ZoneId | ZoneIdString | string, hour?: HourNumber | number, minute?: MinuteNumber | number): Instant; static of(date: LocalDate, timeZone: ZoneId | ZoneIdString | string, time?: LocalTime): Instant; static of(jsDate: Date, timeZone: ZoneId | ZoneIdString | string): Instant; static now(): Instant; static parse(string: PreParseResult): PreParseResult; static parse(string: string, failSilently?: false): Instant; static parse(string: string | PreParseResult, failSilently?: false): Instant | PreParseResult; static parse(string: string, failSilently?: boolean): Instant | undefined; static parse(string: string | PreParseResult, failSilently?: boolean): Instant | PreParseResult | undefined; static from(date: Date): Instant; static ofEpochMilli(epochMilli: number): Instant; static ofEpochSecond(epochSecond: number): Instant; /** * Alias for {@link .plus} */ add(duration: DurationSpec): Instant; add(duration: Duration): Instant; atZone(zoneIdString: ZoneIdString | string): ZonedDateTime; atZone(zoneId: ZoneId): ZonedDateTime; atZone(timeZone: ZoneId | ZoneIdString | string): ZonedDateTime; plus(duration: DurationSpec): Instant; plus(duration: Duration): Instant; plusSeconds(secondsToAdd: number): Instant; plusMillis(secondsToAdd: number): Instant; /** * Alias for {@link .minus} */ subtract(instant: Instant): Duration; subtract(duration: DurationSpec): Instant; subtract(duration: Duration): Instant; subtract(duration: Duration | DurationSpec | Instant): Instant | Duration; minus(instant: Instant): Duration; minus(duration: DurationSpec): Instant; minus(duration: Duration): Instant; minus(duration: Duration | DurationSpec | Instant): Instant | Duration; minusSeconds(secondsToAdd: number): Instant; minusMillis(secondsToAdd: number): Instant; /** * Will return a positive integer if this {@link Instant} is after the {@link Instant} * given as argument, negative if before, and 0 if both {@link Instant}s are at exactly the same time * (millisecond precision); */ compareTo(otherInstant: Instant): number; isAfter(otherInstant: Instant): boolean; isOnOrAfter(otherInstant: Instant): boolean; isBefore(otherInstant: Instant): boolean; isOnOrBefore(otherInstant: Instant): boolean; /** * Returns true if this {@link Instant} occurs at the same time as the {@link Instant} supplied as argument. */ equals(otherInstant: Instant | null | undefined): boolean; /** * Gets the number of seconds from the Java epoch of 1970-01-01T00:00:00Z, rounded down (the milliseconds in the * last second truncated). This returns an integer. */ toEpochSec(): number; /** * Gets the number of milliseconds from the Java epoch of 1970-01-01T00:00:00Z. Microseconds, if present, are * rounded down, so this method returns an integer. */ toEpochMilli(): number; /** * In most cases simply a thousandfold of {@link .toEpochMilli()}, this may return a different value than 1000times * {@link .toEpochMilli()} if this {@link Instant} was instantiated with a timestamp with sub-millisecond precision. */ toEpochMicro(): number; /** * A string representation of this {@link Instant} in ISO-8601 notation. E.g. "2021-05-16T11:21:32.329Z" */ toString(options?: ISOSerializationOptions): string; /** * Gets the number of seconds from the Java epoch of 1970-01-01T00:00:00Z, rounded down (the milliseconds in the * last second truncated). This returns an integer. Alias of {@link toEpochSec}. */ getEpochSecond(): number; toJS(): Date; static isInstance(value: any): value is Instant; } export declare const now: typeof Instant.now; export {};