import { SbbDateLike } from '../interfaces.js'; import { DateAdapter } from './date-adapter.js'; export declare class NativeDateAdapter extends DateAdapter { private readonly _cutoffYearOffset; constructor(cutoffYearOffset?: number); /** Gets the year of the input date. */ getYear(date: Date): number; /** Gets the month of the input date. */ getMonth(date: Date): number; /** Gets the day of the input date. */ getDate(date: Date): number; /** Gets the day of the week of the input date. */ getDayOfWeek(date: Date): number; /** Gets the date in the local format. */ getAccessibilityFormatDate(date: Date | string): string; /** * Creates an array of strings with length = 12, filled with the name of the months starting from January, in the document language. * @param style See `month` in `DateTimeFormatOptions`: `long` for full name, `short` for short name, `narrow` for single letter, * E.g., with January in en-gb: `long` returns "January", `short` returns "Jan", `narrow` returns "J". */ getMonthNames(style: 'long' | 'short' | 'narrow'): string[]; /** Creates a string array with length = 31, filled with the days in a month, starting from 1. */ getDateNames(): string[]; /** * Creates a string array with length = 7, filled with the name of the days in a week starting from Sunday, in the document language. * @param style See `weekday` in `DateTimeFormatOptions` - 'long' for full name, 'short' for short name, 'narrow' for single letter; * E.g., with Monday in en-gb: `long` returns "Monday", `short` returns "Mon", `narrow` returns "M". */ getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[]; getFirstDayOfWeek(): number; /** Calculates the number of days in a month given the year and the month. */ getNumDaysInMonth(date: Date): number; /** Creates today's date. */ today(): Date; /** Creates a new date, given day, month and year; the method doesn't allow date's overflow. */ createDate(year: number, month: number, date: number): Date; /** Checks whether the given `obj` is a Date. */ isDateInstance(obj: any): boolean; /** Checks whether the given `date` is a valid Date. */ isValid(date: Date | null | undefined): boolean; /** Creates a new date by cloning the given one. */ clone(date: Date): Date; /** * Creates a new date adding the number of provided `years` to the provided `date`. * @param date The starting date. * @param years The number of years to add. */ addCalendarYears(date: Date, years: number): Date; /** * Creates a new date adding the number of provided `months` to the provided `date`. * If the calculated month has fewer days than the original one, the date is set to the last day of the month. * E.g., with `date` = new Date(2022, 0, 31) and `months` = 1, it returns new Date(2022, 1, 28). */ addCalendarMonths(date: Date, months: number): Date; /** Creates a new date by adding the number of provided `days` to the provided `date`. */ addCalendarDays(date: Date, days: number): Date; /** Creates a Date from a valid input (Date, string or number in seconds). */ deserialize(date: SbbDateLike | null | undefined): Date | null; /** Returns the right format for the `valueAsDate` property. */ parse(value: string | null | undefined, now: Date): Date | undefined; format(value: Date | null | undefined): string; invalid(): Date; /** * Creates an array with the given length and fills it by mapping with the provided function. * @param length The length of the array to be created. * @param valueFunction The function of array's index used to fill the array. */ private _range; /** Creates a date but allows the month and date to overflow. */ private _createDateWithOverflow; } export declare const defaultDateAdapter: NativeDateAdapter; //# sourceMappingURL=native-date-adapter.d.ts.map