import { NumberingSystem, CalendarSystem, WeekSettings } from "./types/locale.js"; import { Zone } from "./zone.js"; import { ZoneLike } from "./types/zone.js"; /** * Settings contains static getters and setters that control TsLuxon's overall behavior. * TsLuxon is a simple library with few options, but the ones it does have live here. */ export declare class Settings { /** * Set the default locale to create DateTimes with. Does not affect existing instances. */ static set defaultLocale(locale: string | undefined); /** * Get the default locale to create DateTimes with. Does not affect existing instances. */ static get defaultLocale(): string; /** * Set the default numbering system to create DateTimes with. Does not affect existing instances. * @type {string} */ static set defaultNumberingSystem(numberingSystem: NumberingSystem | undefined); /** * Get the default numbering system to create DateTimes with. Does not affect existing instances. */ static get defaultNumberingSystem(): NumberingSystem; /** * Set the default output calendar to create DateTimes with. Does not affect existing instances. */ static set defaultOutputCalendar(outputCalendar: CalendarSystem | undefined); /** * Get the default output calendar to create DateTimes with. Does not affect existing instances. */ static get defaultOutputCalendar(): CalendarSystem; /** * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and * how many days are required in the first week of a year. * Does not affect existing instances. */ static set defaultWeekSettings(weekSettings: WeekSettings | void); static get defaultWeekSettings(): WeekSettings | void; /** * [TS] had to use type Zone here. I created another setter to use a ZoneLike instead * Let's face it. This is ugly. The original should have this approach as well. * Set the default time zone to create DateTimes in. Does not affect existing instances. * Use the value "system" to reset this value to the system's time zone. */ static set defaultZone(zone: Zone); /** * Get the default time zone object to create DateTimes in. Does not affect existing instances. */ static get defaultZone(): Zone; /** * [TS] can't use the real setter here because set and get must have the same type. * Let's face this. This is bullshit. But I get that you want to make life easier for users. * Set the default time zone to create DateTimes in. Does not affect existing instances. * Use the value "system" to reset this value to the system's time zone. */ static set defaultZoneLike(zone: ZoneLike); /** * Set the callback for returning the current timestamp. * The function should return a number, which will be interpreted as an Epoch millisecond count * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time */ static set now(n: () => number); /** * Get the callback for returning the current timestamp. */ static get now(): () => number; /** * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals * @type {boolean} */ static set throwOnInvalid(t: boolean); /** * Get whether TSLuxon will throw when it encounters invalid DateTimes, Durations, or Intervals */ static get throwOnInvalid(): boolean; /** * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. * @type {number} * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950 * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 */ static set twoDigitCutoffYear(cutoffYear: number); /** * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. * @type {number} */ static get twoDigitCutoffYear(): number; /** * Reset TSLuxon's global caches. Should only be necessary in testing scenarios. */ static resetCaches(): void; }