UNPKG

@everwhen/temporal

Version:
26 lines (25 loc) 1.27 kB
import { Temporal } from 'temporal-polyfill'; import { Duration } from './duration.js'; import { MethodParameters } from './type-utils.js'; export type PlainTimeLike = PlainTime | Temporal.PlainTime | Temporal.PlainTimeLike; export declare class PlainTime extends Temporal.PlainTime { static now(): PlainTime; static from(...args: Parameters<typeof Temporal.PlainTime.from>): PlainTime; compare(other: PlainTimeLike | string): Temporal.ComparisonResult; /** * Check if this time is before another time. * @param other The other PlainTime instance to compare. */ isBefore(other: PlainTime): boolean; /** * Check if this time is after another time. * @param other The other PlainTime instance to compare. */ isAfter(other: PlainTime): boolean; add(...args: MethodParameters<Temporal.PlainTime, 'add'>): PlainTime; subtract(...args: MethodParameters<Temporal.PlainTime, 'subtract'>): PlainTime; round(...args: MethodParameters<Temporal.PlainTime, 'round'>): PlainTime; until(...args: MethodParameters<Temporal.PlainTime, 'until'>): Duration; since(...args: MethodParameters<Temporal.PlainTime, 'since'>): Duration; with(...args: MethodParameters<Temporal.PlainTime, 'with'>): PlainTime; }