UNPKG

1.76 kBTypeScriptView Raw
1import { Zone } from './zone';
2
3/**
4 * Settings contains static getters and setters that control Luxon's overall behavior.
5 * Luxon is a simple library with few options, but the ones it does have live here.
6 */
7export namespace Settings {
8 /**
9 * The current function for returning the current timestamp.
10 * The function should return a number, which will be interpreted as an Epoch millisecond count
11 * @example
12 * Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future
13 * @example
14 * Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time
15 */
16 function now(): number;
17
18 /**
19 * The default time zone to create DateTimes in. Does not affect existing instances.
20 * Set this to change {@link defaultZone}
21 */
22 let defaultZoneName: string;
23
24 /**
25 * The default time zone object to create DateTimes in. Does not affect existing instances.
26 * Change by setting {@link defaultZoneName}
27 */
28 const defaultZone: Zone;
29
30 /**
31 * The default locale to create DateTimes with. Does not affect existing instances.
32 */
33 let defaultLocale: string;
34
35 /**
36 * The default numbering system to create DateTimes with. Does not affect existing instances.
37 */
38 let defaultNumberingSystem: string;
39
40 /**
41 * The default output calendar to create DateTimes with. Does not affect existing instances.
42 */
43 let defaultOutputCalendar: string;
44
45 /**
46 * Whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
47 */
48 let throwOnInvalid: boolean;
49
50 /**
51 * Reset Luxon's global caches. Should only be necessary in testing scenarios.
52 */
53 function resetCaches(): void;
54}