import { Temporal } from 'temporal-polyfill'; import { bbnDtTemporal } from '../vars/types.js'; import bbnDtDuration from './Duration.js'; export declare abstract class bbnDt { #private; abstract readonly kind: bbnDtKind; readonly __bbnNoData = true; readonly __isBbnDt = true; isValid: boolean | undefined; defaultValue: TimeProperties | undefined; constructor(value?: TValue); setValid(isValid: boolean): void; get value(): TValue | undefined; get hasFullDate(): boolean; /** System time zone ID (e.g. "Europe/Rome") */ static readonly systemTimeZoneId: string; /** * Convert this.value (PlainDate, PlainTime, PlainDateTime, YearMonth, * MonthDay, ZonedDateTime) into epoch milliseconds, using the system * time zone when needed. * * Conventions: * - time → today at that time in system tz * - date → that date at 00:00 in system tz * - year-month → first of that month at 00:00 in system tz * - month-day → that month/day in *this year* at 00:00 in system tz */ protected toEpochMs(): number; /** * "Now" value in the same *kind* as this instance. */ protected static nowForKind(kind: bbnDtKind): Temporal.PlainDate | Temporal.PlainTime | Temporal.PlainDateTime | Temporal.PlainYearMonth | Temporal.PlainMonthDay | Temporal.ZonedDateTime; /** * Helper to rebuild the same concrete subclass with a new Temporal value. * Assumes your subclass constructor takes the value as first argument. */ protected withValue(newValue: any): this; static compare(a: any, b: any, unit: string | undefined): -1 | 0 | 1; static parse(input: string, format: string | string[], cls?: bbnDtKindParams, locale?: { monthsLong?: string[]; monthsShort?: string[]; weekdaysLong?: string[]; weekdaysShort?: string[]; }): bbnDt; parse(input: string, format: string, cls?: bbnDtKindParams): bbnDt; compare(other: any, unit?: string): -1 | 0 | 1; add(amount: number | bbnDtDuration | object, unit?: string): undefined | bbnDt; subtract(amount: number | bbnDtDuration | object, unit?: string): undefined | bbnDt; duration(amount: number, unit: string): bbnDtDuration; isBefore(other: any, unit?: string): boolean; isBeforeOrSame(other: any, unit?: string): boolean; isAfter(other: any, unit?: string): boolean; isAfterOrSame(other: any, unit?: string): boolean; isSame(other: any, unit?: string): boolean; equals(other: any): boolean; toJSON(): string; timezone(d: any): string | bbnDt; toString(): string; year(v?: any): undefined | number | bbnDt; month(v?: any): undefined | number | bbnDt; day(v?: any): undefined | number | bbnDt; hour(v?: any): undefined | number | bbnDt; minute(v?: any): undefined | number | bbnDt; second(v?: any): undefined | number | bbnDt; millisecond(v?: any): undefined | number | bbnDt; weekday(v?: any, past?: any): undefined | number | bbnDt; date(v?: any): undefined | string | bbnDt; datetime(v?: any): string | bbnDt; time(v?: any): string | bbnDt; fdate(long?: boolean, withTime?: boolean): string; ftime(withSeconds?: boolean): string; week(): undefined | number; get YYYY(): undefined | string; get YY(): undefined | string; get MMMM(): undefined | string; get MMM(): undefined | string; get MM(): undefined | string; get M(): undefined | string; get EE(): undefined | string; get DD(): undefined | string; get d(): undefined | string; get dddd(): undefined | string; get ddd(): undefined | string; get D(): undefined | string; get HH(): undefined | string; get H(): undefined | string; get II(): undefined | string; get mm(): undefined | string; get I(): undefined | string; get SS(): undefined | string; get SSS(): undefined | string; get S(): undefined | string; get WW(): undefined | string; get W(): undefined | string; get Z(): undefined | string; get ZZ(): undefined | string; unix(ms?: boolean | number): number | bbnDt; format(format?: string): string; calendar(short?: boolean): string; matchFormat(value: any, format: string): boolean; getWeekday(n: number, mode?: string, locale?: string): string | object; getWeekdayIndex: (name: string, locale?: string) => number; /** * Returns a NEW date that is the next (or previous if past=true) * occurrence of the given weekday, starting from this.#value. * * @param {number|string} weekday - Weekday index (0=Sunday…6=Saturday) * or a localized weekday name. * @param {boolean} past - If true → return previous occurrence instead of next. * @param {string} [locale] - Optional locale for weekday names. */ setWeekday(weekday: number | string, past?: boolean, locale?: string): undefined | bbnDt; diff(date: any, unit?: string, abs?: boolean): number; guessUnit(valueInMs: number): string | null; fromNow(unit?: string): string; from(date: bbnDt, unit?: string): string; startOf(unit?: string): bbnDt; endOf(unit?: string): bbnDt; clone(): bbnDt; isLeapYear(): boolean; daysInMonth(): number; valueOf(): number; } export default bbnDt;