UNPKG

@everwhen/temporal

Version:
38 lines (37 loc) 1.85 kB
import { Temporal } from 'temporal-polyfill'; import { Duration } from './duration.ts'; import { PlainDate } from './plain-date.ts'; import type { MethodParameters } from './type-utils.ts'; export type PlainYearMonthLike = Temporal.PlainYearMonthLike; export declare class PlainYearMonth extends Temporal.PlainYearMonth { static now(): PlainYearMonth; static from(...args: Parameters<typeof Temporal.PlainYearMonth.from>): PlainYearMonth; static max(...dates: PlainYearMonth[]): PlainYearMonth; static min(...dates: PlainYearMonth[]): PlainYearMonth; compare(other: PlainYearMonthLike | string): Temporal.ComparisonResult; /** * Compares two PlainYearMonth objects. * Comparison is based on the first day of the month in the real world, regardless of the calendar. * * @link https://tc39.es/proposal-temporal/docs/plainyearmonth.html#compare */ isBefore(other: PlainYearMonthLike): boolean; /** * Compares two PlainYearMonth objects. * Comparison is based on the first day of the month in the real world, regardless of the calendar. * * @link https://tc39.es/proposal-temporal/docs/plainyearmonth.html#compare */ isAfter(other: PlainYearMonthLike): boolean; add(...args: MethodParameters<Temporal.PlainYearMonth, 'add'>): PlainYearMonth; subtract(...args: MethodParameters<Temporal.PlainYearMonth, 'subtract'>): PlainYearMonth; contains(date: PlainYearMonthLike): boolean; startOfMonth(): PlainDate; endOfMonth(): PlainDate; toPlainDate(day?: { day: number; }): PlainDate; with(...args: MethodParameters<Temporal.PlainYearMonth, 'with'>): PlainYearMonth; until(...args: MethodParameters<Temporal.PlainYearMonth, 'until'>): Duration; since(...args: MethodParameters<Temporal.PlainYearMonth, 'since'>): Duration; }