@dmdata/telegram-json-types 1.1.4 → 1.1.8

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.
@@ -1,56 +1,77 @@
1
1
  import { Coordinate } from './coordinate';
2
2
  import { UnitValueNotNull } from './unit-value';
3
3
 
4
- type Depth = {
4
+ interface DepthBase {
5
5
  type: '深さ';
6
6
  unit: 'km';
7
- } & ({
8
- value: null;
9
- condition: '不明';
10
- } | {
7
+ value: string | null;
8
+ condition: string | never;
9
+ }
10
+
11
+ interface DepthNormal extends DepthBase {
12
+ value: string;
13
+ condition: never;
14
+ }
15
+
16
+ interface DepthShallow extends DepthBase {
11
17
  value: '0';
12
18
  condition: 'ごく浅い';
13
- } | {
19
+ }
20
+
21
+ interface DepthDeep extends DepthBase {
14
22
  value: '700';
15
23
  condition: '700km以上';
16
- } | {
17
- value: string;
18
- condition: never;
19
- });
20
- type Magnitude = {
24
+ }
25
+
26
+ interface DepthUnknown extends DepthBase {
27
+ value: null;
28
+ condition: '不明';
29
+ }
30
+
31
+ type Depth = DepthNormal | DepthShallow | DepthDeep | DepthUnknown;
32
+
33
+
34
+ interface MagnitudeBase {
21
35
  type: 'マグニチュード';
22
36
  unit: 'Mj' | 'M';
23
- } & ({
24
- value: null;
25
- condition: 'M不明' | 'M8を超える巨大地震';
26
- } | {
37
+ value: string | null;
38
+ condition: string | never;
39
+ }
40
+
41
+ interface MagnitudeNormal extends MagnitudeBase {
27
42
  value: string;
28
43
  condition: never;
29
- });
44
+ }
30
45
 
31
- export interface Earthquake {
32
- originTime: string;
33
- arrivalTime: string;
34
- hypocenter: {
46
+ interface MagnitudeUnknown extends MagnitudeBase {
47
+ value: null;
48
+ condition: 'M不明' | 'M8を超える巨大地震';
49
+ }
50
+
51
+ type Magnitude = MagnitudeNormal | MagnitudeUnknown;
52
+
53
+ interface Hypocenter {
54
+ name: string;
55
+ code: string;
56
+ coordinate: Coordinate<'日本測地系' | undefined>;
57
+ depth: Depth;
58
+ detailed?: {
59
+ code: string;
35
60
  name: string;
61
+ };
62
+ auxiliary?: {
63
+ text: string;
36
64
  code: string;
37
- coordinate: Coordinate<'日本測地系' | undefined>;
38
- depth: Depth;
39
- detailed?: {
40
- code: string;
41
- name: string;
42
- };
43
- auxiliary?: {
44
- text: string;
45
- code: string;
46
- name: string;
47
- direction: string;
48
- distance: Omit<UnitValueNotNull<never, 'km'>, 'type' | 'condition'>;
49
- };
50
- source?: 'PTWC' | 'USGS' | 'WCATWC';
65
+ name: string;
66
+ direction: string;
67
+ distance: Omit<UnitValueNotNull<never, 'km'>, 'type' | 'condition'>;
51
68
  };
52
- magnitude: Magnitude;
69
+ source?: 'PTWC' | 'USGS' | 'WCATWC';
53
70
  }
54
71
 
55
-
56
-
72
+ export interface Earthquake {
73
+ originTime: string;
74
+ arrivalTime: string;
75
+ hypocenter: Hypocenter;
76
+ magnitude: Magnitude;
77
+ }
@@ -30,7 +30,7 @@ export namespace EarthquakeInformation {
30
30
  condition?: '震度5弱以上未入電';
31
31
  }
32
32
 
33
- export type Comment = {
33
+ export interface Comments {
34
34
  free?: string;
35
35
  forecast?: {
36
36
  text: string;
@@ -40,7 +40,7 @@ export namespace EarthquakeInformation {
40
40
  text: string;
41
41
  codes: string[];
42
42
  };
43
- };
43
+ }
44
44
 
45
45
 
46
46
  export interface IntensityVXSE51 {
@@ -61,20 +61,20 @@ export namespace EarthquakeInformation {
61
61
  export interface PublicBodyVXSE51 {
62
62
  intensity: IntensityVXSE51;
63
63
  text?: string;
64
- comments: Omit<Comment, 'var'>;
64
+ comments: Omit<Comments, 'var'>;
65
65
  }
66
66
 
67
67
  export interface PublicBodyVXSE52 {
68
68
  earthquake: Components.Earthquake;
69
69
  text?: string;
70
- comments: Omit<Comment, 'var'>;
70
+ comments: Omit<Comments, 'var'>;
71
71
  }
72
72
 
73
73
  export interface PublicBodyVXSE53 {
74
74
  earthquake: Components.Earthquake;
75
75
  intensity?: IntensityVXSE53;
76
76
  text?: string;
77
- comments: Comment;
77
+ comments: Comments;
78
78
  }
79
79
 
80
80
  export interface PublicBodyVXZSE40 {
@@ -46,7 +46,7 @@ export namespace EarthquakeInformation {
46
46
  prePeriods: IntensityLpgmStationPrePeriod[];
47
47
  }
48
48
 
49
- export type Comment = {
49
+ export interface Comments {
50
50
  free?: string;
51
51
  forecast?: {
52
52
  text: string;
@@ -56,7 +56,7 @@ export namespace EarthquakeInformation {
56
56
  text: string;
57
57
  codes: string[];
58
58
  };
59
- };
59
+ }
60
60
 
61
61
 
62
62
  export interface IntensityVXSE51 {
@@ -86,27 +86,27 @@ export namespace EarthquakeInformation {
86
86
  export interface PublicBodyVXSE51 {
87
87
  intensity: IntensityVXSE51;
88
88
  text?: string;
89
- comments: Omit<Comment, 'var'>;
89
+ comments: Omit<Comments, 'var'>;
90
90
  }
91
91
 
92
92
  export interface PublicBodyVXSE52 {
93
93
  earthquake: Components.Earthquake;
94
94
  text?: string;
95
- comments: Omit<Comment, 'var'>;
95
+ comments: Omit<Comments, 'var'>;
96
96
  }
97
97
 
98
98
  export interface PublicBodyVXSE53 {
99
99
  earthquake: Components.Earthquake;
100
100
  intensity?: IntensityVXSE53;
101
101
  text?: string;
102
- comments: Comment;
102
+ comments: Comments;
103
103
  }
104
104
 
105
105
  export interface PublicBodyVXSE62 {
106
106
  earthquake: Components.Earthquake;
107
107
  intensity?: IntensityVXSE62;
108
108
  text?: string;
109
- comments: Comment;
109
+ comments: Comments;
110
110
  }
111
111
 
112
112
  export interface PublicBodyVXZSE40 {
@@ -80,44 +80,82 @@ export namespace EewInformation {
80
80
  export interface IntensityRegion extends Components.CodeName {
81
81
  forecastMaxInt: IntensityForecastMaxInt;
82
82
  forecastLpgmMaxInt?: IntensityForecastLpgmMaxInt;
83
+ isPlum: boolean;
84
+ isWarning: boolean;
83
85
  kind: IntensityRegionKind;
86
+ condition?: '既に主要動到達と推測';
87
+ arrivalTime?: string;
84
88
  }
85
89
 
90
+ export interface IntensityRegionReached extends IntensityRegion {
91
+ condition: '既に主要動到達と推測';
92
+ arrivalTime: never;
93
+ }
94
+
95
+ export interface IntensityRegionUnReached extends IntensityRegion {
96
+ condition: never;
97
+ arrivalTime: string;
98
+ }
99
+
100
+ export type IntensityRegionItem = IntensityRegionReached | IntensityRegionUnReached
101
+
102
+ export interface IntensityRealtimeStation {
103
+ code: string;
104
+ name: string;
105
+ int: IntensityClass;
106
+ k: string;
107
+ }
86
108
 
87
109
  export interface Intensity {
88
110
  forecastMaxInt: IntensityForecastMaxInt;
89
111
  forecastLpgmMaxInt?: IntensityForecastLpgmMaxInt;
90
112
  appendix?: IntensityAppendix;
91
- regions: IntensityRegion[];
113
+ regions: IntensityRegionItem[];
114
+ }
115
+
116
+ export interface IntensityRealtime {
117
+ stations: IntensityRealtimeStation[];
92
118
  }
93
119
 
94
120
 
95
- export type Comment = {
121
+ export interface Comments {
96
122
  free?: string;
97
123
  warning?: {
98
124
  text: string;
99
125
  codes: string[];
100
126
  };
101
- };
127
+ }
102
128
 
103
129
  export interface PublicCommonBody {
104
130
  isLastInfo: boolean;
131
+ isCanceled: boolean;
132
+ isWarning: boolean;
105
133
  zones?: WarningArea[];
106
134
  prefectures?: WarningArea[];
107
135
  regions?: WarningArea[];
108
136
  earthquake: Earthquake;
109
137
  intensity?: Intensity;
110
138
  text?: string;
111
- comments: Comment;
139
+ comments: Comments;
140
+ }
141
+
142
+ export interface PublicRealtimeBody {
143
+ isLastInfo: boolean;
144
+ isCanceled: boolean;
145
+ earthquake: Earthquake;
146
+ intensity?: IntensityRealtime;
147
+ text?: string;
112
148
  }
113
149
 
114
150
  export interface PublicTestingBody {
115
151
  isLastInfo: false;
152
+ isCanceled: false;
116
153
  text: string;
117
154
  }
118
155
 
119
156
  export interface CancelBody {
120
157
  isLastInfo: true;
158
+ isCanceled: true;
121
159
  text: string;
122
160
  }
123
161
 
@@ -135,6 +173,21 @@ export namespace EewInformation {
135
173
  body: PublicCommonBody;
136
174
  }
137
175
 
176
+ export interface PublicRealtime extends TelegramJSONMain {
177
+ _schema: Schema;
178
+ type: 'リアルタイム震度';
179
+ title: 'リアルタイム震度';
180
+ infoType: '発表' | '訂正';
181
+ targetDateTimeDubious: never;
182
+ targetDuration: never;
183
+ validDateTime: never;
184
+ eventId: string;
185
+ serialNo: string;
186
+ infoKind: '緊急地震速報';
187
+ body: PublicRealtimeBody;
188
+ }
189
+
190
+
138
191
  export interface PublicTesting extends TelegramJSONMain {
139
192
  _schema: Schema;
140
193
  type: '緊急地震速報配信テスト';
@@ -151,8 +204,8 @@ export namespace EewInformation {
151
204
 
152
205
  export interface Cancel extends TelegramJSONMain {
153
206
  _schema: Schema;
154
- type: '緊急地震速報(予報)' | '緊急地震速報(地震動予報)' | '緊急地震速報(警報)' | '緊急地震速報配信テスト';
155
- title: '緊急地震速報(予報)' | '緊急地震速報(地震動予報)' | '緊急地震速報(警報)' | '緊急地震速報配信テスト';
207
+ type: '緊急地震速報(予報)' | '緊急地震速報(地震動予報)' | '緊急地震速報(警報)' | 'リアルタイム震度' | '緊急地震速報配信テスト';
208
+ title: '緊急地震速報(予報)' | '緊急地震速報(地震動予報)' | '緊急地震速報(警報)' | 'リアルタイム震度' | '緊急地震速報配信テスト';
156
209
  infoType: '取消';
157
210
  targetDateTimeDubious: never;
158
211
  targetDuration: never;
@@ -163,6 +216,6 @@ export namespace EewInformation {
163
216
  body: CancelBody;
164
217
  }
165
218
 
166
- export type Main = PublicCommon | PublicTesting | Cancel;
219
+ export type Main = PublicCommon | PublicRealtime | PublicTesting | Cancel;
167
220
 
168
221
  }