import { type CalendarDate } from './calendarDate.js'; /** * Adds `n` days to a calendar date. Negative `n` subtracts days. * Handles month and year rollovers correctly in both directions. * * @example * ```ts * import { Calendar } from 'foldkit' * import { pipe } from 'effect' * * Calendar.addDays(Calendar.make(2026, 4, 13), 5) * // { year: 2026, month: 4, day: 18 } * * pipe(Calendar.make(2026, 4, 30), Calendar.addDays(1)) * // { year: 2026, month: 5, day: 1 } * ``` */ export declare const addDays: { (n: number): (self: CalendarDate) => CalendarDate; (self: CalendarDate, n: number): CalendarDate; }; /** * Subtracts `n` days from a calendar date. Equivalent to `addDays(self, -n)`. * * @example * ```ts * import { Calendar } from 'foldkit' * import { pipe } from 'effect' * * Calendar.subtractDays(Calendar.make(2026, 5, 1), 1) * // { year: 2026, month: 4, day: 30 } * * pipe(Calendar.make(2026, 1, 1), Calendar.subtractDays(1)) * // { year: 2025, month: 12, day: 31 } * ``` */ export declare const subtractDays: { (n: number): (self: CalendarDate) => CalendarDate; (self: CalendarDate, n: number): CalendarDate; }; /** * Adds `n` months to a calendar date. Negative `n` subtracts months. * * Clamps the day to the last valid day of the resulting month when the * original day would exceed it. So `addMonths(make(2026, 1, 31), 1)` returns * February 28, 2026 (not March 3). * * @example * ```ts * import { Calendar } from 'foldkit' * import { pipe } from 'effect' * * Calendar.addMonths(Calendar.make(2026, 4, 13), 3) * // { year: 2026, month: 7, day: 13 } * * pipe(Calendar.make(2026, 1, 31), Calendar.addMonths(1)) * // { year: 2026, month: 2, day: 28 } — clamped from 31 * ``` */ export declare const addMonths: { (n: number): (self: CalendarDate) => CalendarDate; (self: CalendarDate, n: number): CalendarDate; }; /** * Subtracts `n` months from a calendar date. Equivalent to `addMonths(self, -n)`. */ export declare const subtractMonths: { (n: number): (self: CalendarDate) => CalendarDate; (self: CalendarDate, n: number): CalendarDate; }; /** * Adds `n` years to a calendar date. Handles leap-year edge cases by clamping * day-of-month when the target year's month is shorter (February 29 in a * leap year + 1 year = February 28). * * @example * ```ts * import { Calendar } from 'foldkit' * import { pipe } from 'effect' * * Calendar.addYears(Calendar.make(2024, 2, 29), 1) * // { year: 2025, month: 2, day: 28 } — clamped * * pipe(Calendar.make(2026, 4, 13), Calendar.addYears(5)) * // { year: 2031, month: 4, day: 13 } * ``` */ export declare const addYears: { (n: number): (self: CalendarDate) => CalendarDate; (self: CalendarDate, n: number): CalendarDate; }; /** * Subtracts `n` years from a calendar date. Equivalent to `addYears(self, -n)`. */ export declare const subtractYears: { (n: number): (self: CalendarDate) => CalendarDate; (self: CalendarDate, n: number): CalendarDate; }; /** * Returns the number of days from `self` until `end`, positive when `end` is * after `self`, negative when before, zero when equal. Matches `Temporal.PlainDate.until`. * * @example * ```ts * import { Calendar } from 'foldkit' * import { pipe } from 'effect' * * const today = Calendar.make(2026, 4, 13) * const birthday = Calendar.make(2026, 7, 15) * * Calendar.daysUntil(today, birthday) // 93 * pipe(today, Calendar.daysUntil(birthday)) // 93 * ``` */ export declare const daysUntil: { (end: CalendarDate): (self: CalendarDate) => number; (self: CalendarDate, end: CalendarDate): number; }; /** * Returns the number of days from `start` until `self`, positive when `self` * is after `start`, negative when before, zero when equal. Matches * `Temporal.PlainDate.since`. * * @example * ```ts * import { Calendar } from 'foldkit' * import { pipe } from 'effect' * * const today = Calendar.make(2026, 4, 13) * const startOfYear = Calendar.make(2026, 1, 1) * * Calendar.daysSince(today, startOfYear) // 102 * pipe(today, Calendar.daysSince(startOfYear)) // 102 * ``` */ export declare const daysSince: { (start: CalendarDate): (self: CalendarDate) => number; (self: CalendarDate, start: CalendarDate): number; }; //# sourceMappingURL=arithmetic.d.ts.map