import { TZDate } from "@date-fns/tz"; import { AdapterDateFns } from "../date-fns-adapter"; import type { Timezone } from "../types"; /** * Adapter for date-fns library, implementing the SaltDateAdapter interface. * Provides methods for date manipulation and formatting using date-fns, without timezone support. */ export declare class AdapterDateFnsTZ extends AdapterDateFns { private hasExplicitOffset; /** * Creates a Date object from a string or returns an invalid date. * @param value - The date string to parse. * @param timezone - The timezone to use (default is "default"). * @returns The parsed Date object or an invalid date object. */ date: (value?: T, timezone?: Timezone) => TZDate; /** * Gets the current date with the time set to the start of the day. * @param timezone - The timezone to use (default is "default"). * @returns The current date at the start of the day. */ today(timezone?: Timezone): TZDate; /** * Gets the current date and time. * @param timezone - The timezone to use (default is "default"). * @returns The current date and time. */ now(timezone?: Timezone): TZDate; /** * Get the timezone from the Date object * @returns timezone */ getTimezone: (date: Date) => string; /** * Set the timezone for the Date object * @param date - A Date object * @param timezone - Timezone to set date object to * @returns date object set to the timezone */ setTimezone: (date: Date, timezone?: Timezone) => TZDate; /** * Clone the date object * @param date */ clone(date: TZDate): TZDate; /** * Convert a TZDate to a plain JS Date. * TZDate extends Date but overrides toISOString() to return offset-aware * strings (e.g. "+01:00"). Returning a plain Date ensures toISOString() * produces standard UTC "Z" strings, consistent with all other adapters. * @param value - A TZDate or Date object * @returns A plain Date representing the same instant */ toJSDate: (value: Date) => Date; }