mmntjs-timezone 0.0.1

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,98 @@
1
+ interface MomentFnProps {
2
+ tz: (this: unknown, tz?: string, keepTime?: boolean) => unknown;
3
+ zoneName?: (this: unknown) => string;
4
+ zoneAbbr?: (this: unknown) => string;
5
+ isDST?: (this: unknown) => boolean;
6
+ [key: string]: unknown;
7
+ }
8
+ interface MomentTzZone {
9
+ name: string;
10
+ abbr: (ts: number) => string;
11
+ offset: (ts: number) => number;
12
+ utcOffset: (ts: number) => number;
13
+ parse: (ts: number) => number;
14
+ countries?: () => string[];
15
+ }
16
+ interface CountryWithOffset {
17
+ name: string;
18
+ offset: number;
19
+ }
20
+ interface TimezoneDataBundle {
21
+ version?: string;
22
+ zones?: unknown;
23
+ links?: unknown;
24
+ countries?: unknown;
25
+ }
26
+ interface MomentTz {
27
+ (input?: unknown, formatOrZone?: unknown, zoneOrStrict?: unknown, fourth?: unknown): MomentInstance;
28
+ guess: (preferCache?: boolean) => string;
29
+ names: () => string[];
30
+ zone: (name: string) => MomentTzZone | null;
31
+ zoneExists?: (name: string) => boolean;
32
+ add: (data: unknown) => void;
33
+ link: (links: unknown) => void;
34
+ load?: (data: TimezoneDataBundle) => void;
35
+ setDefault: (tz?: string) => MomentLike;
36
+ countries: () => string[];
37
+ zonesForCountry: (code: string, withOffset?: boolean) => string[] | CountryWithOffset[] | null;
38
+ unpack?: (data: string) => UnpackedZone;
39
+ unpackBase60?: (input: string) => number;
40
+ version?: string;
41
+ dataVersion?: string;
42
+ Zone?: new (packedString?: string) => MomentTzZone;
43
+ _zones?: Record<string, string | PrebuiltZonePayload | DecodedZonePayload>;
44
+ _links?: Record<string, string>;
45
+ _names?: Record<string, string>;
46
+ _countries?: Record<string, {
47
+ name: string;
48
+ zones: string[];
49
+ }>;
50
+ moveInvalidForward?: boolean;
51
+ moveAmbiguousForward?: boolean;
52
+ }
53
+ type MomentInstance = MomentLike & {
54
+ tz(tz?: string, keepTime?: boolean): MomentInstance | string;
55
+ _z?: MomentTzZone | null;
56
+ utcOffset(offset?: number | string, keepLocalTime?: boolean): number | MomentInstance;
57
+ isValid(): boolean;
58
+ year(): number;
59
+ month(): number;
60
+ date(): number;
61
+ hour(): number;
62
+ minute(): number;
63
+ second(): number;
64
+ millisecond(): number;
65
+ clone(): MomentInstance;
66
+ valueOf(): number;
67
+ utc(): MomentInstance;
68
+ };
69
+ type MomentLike = {
70
+ fn: MomentFnProps;
71
+ momentProperties: string[];
72
+ defaultZone?: string | null;
73
+ tz?: MomentTz;
74
+ updateOffset?: ((m: MomentInstance, keepTime?: boolean) => void) | undefined;
75
+ (...args: unknown[]): MomentInstance;
76
+ };
77
+ interface UnpackedZone {
78
+ name: string;
79
+ abbrs: string[];
80
+ offsets: number[];
81
+ untils: number[];
82
+ population: number;
83
+ }
84
+ interface DecodedZonePayload {
85
+ abbrs: string[];
86
+ offsets: Int16Array | Int32Array;
87
+ untils: Float64Array;
88
+ population: number;
89
+ }
90
+ interface PrebuiltZonePayload {
91
+ abbrs: string[];
92
+ offsets: number[];
93
+ ut: number;
94
+ ud: number[];
95
+ pop: number;
96
+ }
97
+
98
+ export type { MomentLike as M, MomentTz as a };
@@ -0,0 +1,98 @@
1
+ interface MomentFnProps {
2
+ tz: (this: unknown, tz?: string, keepTime?: boolean) => unknown;
3
+ zoneName?: (this: unknown) => string;
4
+ zoneAbbr?: (this: unknown) => string;
5
+ isDST?: (this: unknown) => boolean;
6
+ [key: string]: unknown;
7
+ }
8
+ interface MomentTzZone {
9
+ name: string;
10
+ abbr: (ts: number) => string;
11
+ offset: (ts: number) => number;
12
+ utcOffset: (ts: number) => number;
13
+ parse: (ts: number) => number;
14
+ countries?: () => string[];
15
+ }
16
+ interface CountryWithOffset {
17
+ name: string;
18
+ offset: number;
19
+ }
20
+ interface TimezoneDataBundle {
21
+ version?: string;
22
+ zones?: unknown;
23
+ links?: unknown;
24
+ countries?: unknown;
25
+ }
26
+ interface MomentTz {
27
+ (input?: unknown, formatOrZone?: unknown, zoneOrStrict?: unknown, fourth?: unknown): MomentInstance;
28
+ guess: (preferCache?: boolean) => string;
29
+ names: () => string[];
30
+ zone: (name: string) => MomentTzZone | null;
31
+ zoneExists?: (name: string) => boolean;
32
+ add: (data: unknown) => void;
33
+ link: (links: unknown) => void;
34
+ load?: (data: TimezoneDataBundle) => void;
35
+ setDefault: (tz?: string) => MomentLike;
36
+ countries: () => string[];
37
+ zonesForCountry: (code: string, withOffset?: boolean) => string[] | CountryWithOffset[] | null;
38
+ unpack?: (data: string) => UnpackedZone;
39
+ unpackBase60?: (input: string) => number;
40
+ version?: string;
41
+ dataVersion?: string;
42
+ Zone?: new (packedString?: string) => MomentTzZone;
43
+ _zones?: Record<string, string | PrebuiltZonePayload | DecodedZonePayload>;
44
+ _links?: Record<string, string>;
45
+ _names?: Record<string, string>;
46
+ _countries?: Record<string, {
47
+ name: string;
48
+ zones: string[];
49
+ }>;
50
+ moveInvalidForward?: boolean;
51
+ moveAmbiguousForward?: boolean;
52
+ }
53
+ type MomentInstance = MomentLike & {
54
+ tz(tz?: string, keepTime?: boolean): MomentInstance | string;
55
+ _z?: MomentTzZone | null;
56
+ utcOffset(offset?: number | string, keepLocalTime?: boolean): number | MomentInstance;
57
+ isValid(): boolean;
58
+ year(): number;
59
+ month(): number;
60
+ date(): number;
61
+ hour(): number;
62
+ minute(): number;
63
+ second(): number;
64
+ millisecond(): number;
65
+ clone(): MomentInstance;
66
+ valueOf(): number;
67
+ utc(): MomentInstance;
68
+ };
69
+ type MomentLike = {
70
+ fn: MomentFnProps;
71
+ momentProperties: string[];
72
+ defaultZone?: string | null;
73
+ tz?: MomentTz;
74
+ updateOffset?: ((m: MomentInstance, keepTime?: boolean) => void) | undefined;
75
+ (...args: unknown[]): MomentInstance;
76
+ };
77
+ interface UnpackedZone {
78
+ name: string;
79
+ abbrs: string[];
80
+ offsets: number[];
81
+ untils: number[];
82
+ population: number;
83
+ }
84
+ interface DecodedZonePayload {
85
+ abbrs: string[];
86
+ offsets: Int16Array | Int32Array;
87
+ untils: Float64Array;
88
+ population: number;
89
+ }
90
+ interface PrebuiltZonePayload {
91
+ abbrs: string[];
92
+ offsets: number[];
93
+ ut: number;
94
+ ud: number[];
95
+ pop: number;
96
+ }
97
+
98
+ export type { MomentLike as M, MomentTz as a };