@vvo/tzdb 6.198.0 → 6.200.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,65 @@
1
+ //#region src/types.d.ts
2
+ type TimeZoneName = string;
3
+ interface RawTimeZone {
4
+ /** IANA name of the most populated zone of the group, like "America/Los_Angeles" */
5
+ name: TimeZoneName;
6
+ /** English generic name, like "Pacific Time" */
7
+ alternativeName: string;
8
+ /** Every IANA name, current or deprecated, that shows this exact time */
9
+ group: TimeZoneName[];
10
+ continentCode: string;
11
+ continentName: string;
12
+ countryName: string;
13
+ countryCode: string;
14
+ /** Up to four cities, most populated first */
15
+ mainCities: string[];
16
+ /** UTC offset outside of daylight saving time */
17
+ rawOffsetInMinutes: number;
18
+ /** Abbreviation outside of daylight saving time, like "PST" */
19
+ abbreviation: string;
20
+ /** Abbreviation during daylight saving time, like "PDT". Only for zones that observe it */
21
+ dstAbbreviation?: string;
22
+ rawFormat: string;
23
+ }
24
+ interface TimeZone extends RawTimeZone {
25
+ /** UTC offset right now, according to the tz database of the browser or Node.js */
26
+ currentTimeOffsetInMinutes: number;
27
+ currentTimeFormat: string;
28
+ /** "PDT" or "PST" depending on the current date */
29
+ currentAbbreviation: string;
30
+ }
31
+ interface TimeZoneOptions {
32
+ /** Adds an "Etc/UTC" time zone, whose group includes "UTC" and "GMT" */
33
+ includeUtc?: boolean;
34
+ /**
35
+ * Adds the fixed offset time zones from "Etc/GMT-14" to "Etc/GMT+12".
36
+ * Their sign is inverted: "Etc/GMT+5" is 5 hours behind UTC.
37
+ */
38
+ includeGmtOffsets?: boolean;
39
+ /**
40
+ * Translates alternativeName, countryName and continentName with the Intl
41
+ * API, like "fr" or "es-MX". City names are not translated.
42
+ */
43
+ locale?: string;
44
+ }
45
+ //#endregion
46
+ //#region src/index.d.ts
47
+ export declare const rawTimeZones: RawTimeZone[];
48
+ export declare const timeZonesNames: TimeZoneName[];
49
+ export declare const abbreviations: Record<string, string>;
50
+ /** Release of the IANA tz database used to build the data, like "2026e" */
51
+ export declare const tzdbVersion: string;
52
+ /**
53
+ * ISO 3166 country code of any IANA time zone name, current or deprecated,
54
+ * like "FR" for "Europe/Paris" or "IN" for "Asia/Calcutta". Undefined for
55
+ * names without a country, like "UTC".
56
+ */
57
+ export declare function getCountryCode(timeZone: string): string | undefined;
58
+ /**
59
+ * Time zones grouped by country and clock, sorted by current offset. The
60
+ * current offset comes from the runtime's own tz database, which browsers
61
+ * and operating systems keep up to date.
62
+ */
63
+ export declare function getTimeZones(options?: TimeZoneOptions): TimeZone[];
64
+ //#endregion
65
+ export type { RawTimeZone, TimeZone, TimeZoneName, TimeZoneOptions };
package/dist/index.d.ts CHANGED
@@ -1,28 +1,65 @@
1
+ //#region src/types.d.ts
1
2
  type TimeZoneName = string;
2
-
3
3
  interface RawTimeZone {
4
+ /** IANA name of the most populated zone of the group, like "America/Los_Angeles" */
4
5
  name: TimeZoneName;
6
+ /** English generic name, like "Pacific Time" */
5
7
  alternativeName: string;
6
- group: string[];
8
+ /** Every IANA name, current or deprecated, that shows this exact time */
9
+ group: TimeZoneName[];
7
10
  continentCode: string;
8
11
  continentName: string;
9
12
  countryName: string;
10
13
  countryCode: string;
14
+ /** Up to four cities, most populated first */
11
15
  mainCities: string[];
16
+ /** UTC offset outside of daylight saving time */
12
17
  rawOffsetInMinutes: number;
18
+ /** Abbreviation outside of daylight saving time, like "PST" */
13
19
  abbreviation: string;
20
+ /** Abbreviation during daylight saving time, like "PDT". Only for zones that observe it */
21
+ dstAbbreviation?: string;
14
22
  rawFormat: string;
15
23
  }
16
-
17
24
  interface TimeZone extends RawTimeZone {
25
+ /** UTC offset right now, according to the tz database of the browser or Node.js */
18
26
  currentTimeOffsetInMinutes: number;
19
27
  currentTimeFormat: string;
28
+ /** "PDT" or "PST" depending on the current date */
29
+ currentAbbreviation: string;
20
30
  }
21
-
22
31
  interface TimeZoneOptions {
32
+ /** Adds an "Etc/UTC" time zone, whose group includes "UTC" and "GMT" */
23
33
  includeUtc?: boolean;
34
+ /**
35
+ * Adds the fixed offset time zones from "Etc/GMT-14" to "Etc/GMT+12".
36
+ * Their sign is inverted: "Etc/GMT+5" is 5 hours behind UTC.
37
+ */
38
+ includeGmtOffsets?: boolean;
39
+ /**
40
+ * Translates alternativeName, countryName and continentName with the Intl
41
+ * API, like "fr" or "es-MX". City names are not translated.
42
+ */
43
+ locale?: string;
24
44
  }
25
-
26
- export const rawTimeZones: RawTimeZone[];
27
- export const timeZonesNames: TimeZoneName[];
28
- export function getTimeZones(opts?: TimeZoneOptions): TimeZone[];
45
+ //#endregion
46
+ //#region src/index.d.ts
47
+ export declare const rawTimeZones: RawTimeZone[];
48
+ export declare const timeZonesNames: TimeZoneName[];
49
+ export declare const abbreviations: Record<string, string>;
50
+ /** Release of the IANA tz database used to build the data, like "2026e" */
51
+ export declare const tzdbVersion: string;
52
+ /**
53
+ * ISO 3166 country code of any IANA time zone name, current or deprecated,
54
+ * like "FR" for "Europe/Paris" or "IN" for "Asia/Calcutta". Undefined for
55
+ * names without a country, like "UTC".
56
+ */
57
+ export declare function getCountryCode(timeZone: string): string | undefined;
58
+ /**
59
+ * Time zones grouped by country and clock, sorted by current offset. The
60
+ * current offset comes from the runtime's own tz database, which browsers
61
+ * and operating systems keep up to date.
62
+ */
63
+ export declare function getTimeZones(options?: TimeZoneOptions): TimeZone[];
64
+ //#endregion
65
+ export type { RawTimeZone, TimeZone, TimeZoneName, TimeZoneOptions };