@everwhen/temporal
Version:
36 lines (35 loc) • 1.76 kB
TypeScript
import { Temporal } from 'temporal-polyfill';
import { Duration } from './duration.js';
import { PlainDate } from './plain-date.js';
import { MethodParameters } from './type-utils.js';
export type PlainYearMonthLike = PlainYearMonth | Temporal.PlainYearMonth | Temporal.PlainYearMonthLike;
export declare class PlainYearMonth extends Temporal.PlainYearMonth {
static now(): PlainYearMonth;
static from(...args: Parameters<typeof Temporal.PlainYearMonth.from>): 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;
}