@dmdata/telegram-json-types 1.0.4 → 1.0.5

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.
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@dmdata/telegram-json-types",
3
- "version": "1.0.4",
4
- "scripts": {},
3
+ "version": "1.0.5",
4
+ "scripts": {
5
+ "publish:npm": "npm publish --access=public"
6
+ },
5
7
  "types": "index.d.ts",
6
8
  "keywords": [],
7
9
  "author": "",
@@ -1,7 +1,7 @@
1
1
  import { Earthquake } from './component/earthquake';
2
2
  import { TelegramJSONMain } from '../main';
3
+ import { UnitValueNotNull } from './component/unit-value';
3
4
 
4
- type Intensity = '1' | '2' | '3' | '4' | '5-' | '5+' | '6-' | '6+' | '7';
5
5
 
6
6
  export namespace EarthquakeInformation {
7
7
  export interface Schema {
@@ -9,87 +9,113 @@ export namespace EarthquakeInformation {
9
9
  version: '1.0.0';
10
10
  }
11
11
 
12
+ export type Intensity = '1' | '2' | '3' | '4' | '5-' | '5+' | '6-' | '6+' | '7';
13
+ export type LpgmIntensity = '0' | '1' | '2' | '3' | '4';
14
+ export type LpgmCategory = '1' | '2' | '3' | '4';
12
15
 
16
+ type OnRevise = { revise?: '上方修正' | '追加'; };
17
+ export type IntensityMaxInt = {
18
+ name: string;
19
+ code: string;
20
+ maxInt: Intensity;
21
+ };
22
+ export type IntensityMaxIntOnRevise = {
23
+ name: string;
24
+ code: string;
25
+ maxInt?: Intensity;
26
+ } & OnRevise;
13
27
 
14
- export interface PublicBodyVXSE51 {
15
- intensity: {
16
- maxInt: string;
17
- prefectures: {
18
- name: string;
19
- code: string;
20
- maxInt: Intensity;
21
- }[];
22
- regions: {
23
- name: string;
24
- code: string;
25
- maxInt: Intensity;
26
- }[];
28
+ export type IntensityCity = {
29
+ name: string;
30
+ code: string;
31
+ maxInt?: Intensity;
32
+ revise?: '上方修正' | '追加';
33
+ condition?: '震度5弱以上未入電';
34
+ };
35
+
36
+ export type IntensityStation = {
37
+ name: string;
38
+ code: string;
39
+ int: Intensity | '!5-';
40
+ revise?: '上方修正' | '追加';
41
+ condition?: '震度5弱以上未入電';
42
+ };
43
+
44
+ export type IntensityLpgmMaxInt = IntensityMaxIntOnRevise & {
45
+ maxLpgmInt: LpgmIntensity;
46
+ };
47
+ export type IntensityLpgmStationPrePeriod = {
48
+ periodicBand: UnitValueNotNull<never, '秒台'>;
49
+ lpgmInt: LpgmIntensity;
50
+ sva: UnitValueNotNull<never, 'cm/s'>;
51
+ };
52
+ export type IntensityLpgmStation = IntensityStation & {
53
+ lpgmInt: LpgmIntensity;
54
+ sva: UnitValueNotNull<never, 'cm/s'>;
55
+ prePeriods: IntensityLpgmStationPrePeriod[];
56
+ }
57
+
58
+ export type Comment = {
59
+ free?: string;
60
+ forecast?: {
61
+ text: string;
62
+ codes: string[];
27
63
  };
28
- text?: string;
29
- comments: {
30
- free?: string;
31
- forecast?: {
32
- text: string;
33
- codes: string[];
34
- };
64
+ var?: {
65
+ text: string;
66
+ codes: string[];
35
67
  };
68
+ };
69
+
70
+
71
+ export type IntensityVXSE51 = {
72
+ maxInt: Intensity;
73
+ prefectures: IntensityMaxInt[];
74
+ regions: IntensityMaxInt[];
75
+ };
76
+
77
+ export type IntensityVXSE53 = {
78
+ maxInt: Intensity;
79
+ prefectures: IntensityMaxIntOnRevise[];
80
+ regions: IntensityMaxIntOnRevise[];
81
+ cities: IntensityCity[];
82
+ stations: IntensityStation[];
83
+ };
84
+
85
+ export type IntensityVXSE62 = {
86
+ maxInt: Intensity;
87
+ maxLpgmInt: LpgmIntensity;
88
+ lpgmCategory: LpgmCategory;
89
+ prefectures: IntensityLpgmMaxInt[];
90
+ regions: IntensityLpgmMaxInt[];
91
+ stations: IntensityLpgmStation[];
92
+ };
93
+
94
+
95
+ export interface PublicBodyVXSE51 {
96
+ intensity: IntensityVXSE51;
97
+ text?: string;
98
+ comments: Omit<Comment, 'var'>;
36
99
  }
37
100
 
38
101
  export interface PublicBodyVXSE52 {
39
102
  earthquake: Earthquake;
40
103
  text?: string;
41
- comments: {
42
- free?: string;
43
- forecast?: {
44
- text: string;
45
- codes: string[];
46
- };
47
- };
104
+ comments: Omit<Comment, 'var'>;
48
105
  }
49
106
 
50
107
  export interface PublicBodyVXSE53 {
51
108
  earthquake: Earthquake;
52
- intensity?: {
53
- maxInt: string;
54
- prefectures: {
55
- name: string;
56
- code: string;
57
- maxInt?: Intensity;
58
- revise?: '上方修正' | '追加';
59
- }[];
60
- regions: {
61
- name: string;
62
- code: string;
63
- maxInt?: Intensity;
64
- revise?: '上方修正' | '追加';
65
- }[];
66
- cities: {
67
- name: string;
68
- code: string;
69
- maxInt?: Intensity;
70
- revise?: '上方修正' | '追加';
71
- condition?: '震度5弱以上未入電';
72
- }[];
73
- stations: {
74
- name: string;
75
- code: string;
76
- int: Intensity | '!5-';
77
- revise?: '上方修正' | '追加';
78
- condition?: '震度5弱以上未入電';
79
- }[];
80
- };
109
+ intensity?: IntensityVXSE53;
81
110
  text?: string;
82
- comments: {
83
- free?: string;
84
- forecast?: {
85
- text: string;
86
- codes: string[];
87
- };
88
- var?: {
89
- text: string;
90
- codes: string[];
91
- };
92
- };
111
+ comments: Comment;
112
+ }
113
+
114
+ export interface PublicBodyVXSE62 {
115
+ earthquake: Earthquake;
116
+ intensity?: IntensityVXSE62;
117
+ text?: string;
118
+ comments: Comment;
93
119
  }
94
120
 
95
121
  export interface ChancelBody {
@@ -129,12 +155,23 @@ export namespace EarthquakeInformation {
129
155
  body: PublicBodyVXSE53;
130
156
  }
131
157
 
158
+ export interface PublicVXSE62 extends TelegramJSONMain {
159
+ _schema: Schema;
160
+ type: '長周期地震動に関する観測情報';
161
+ title: '長周期地震動に関する観測情報';
162
+ infoKind: '長周期地震動に関する観測情報';
163
+ eventId: string;
164
+ serialNo: string;
165
+ infoType: '発表' | '訂正';
166
+ body: PublicBodyVXSE62;
167
+ }
168
+
132
169
  export interface Channel extends TelegramJSONMain {
133
170
  infoType: '取消';
134
171
  eventId: string;
135
172
  body: ChancelBody;
136
173
  }
137
174
 
138
- export type Main = (PublicVXSE51 | PublicVXSE52 | PublicVXSE53) | Channel;
175
+ export type Main = (PublicVXSE51 | PublicVXSE52 | PublicVXSE53 | PublicVXSE62) | Channel;
139
176
 
140
177
  }
@@ -8,7 +8,7 @@ export namespace WeatherTyphoon {
8
8
  version: '1.0.0';
9
9
  }
10
10
 
11
- type Direction = {
11
+ export type Direction = {
12
12
  type: string;
13
13
  unit: string;
14
14
  value: string;
@@ -19,67 +19,68 @@ export namespace WeatherTyphoon {
19
19
  value: null;
20
20
  azimuth: null;
21
21
  condition: string;
22
- }
22
+ };
23
23
 
24
- interface Axis {
24
+ export type Axis = {
25
25
  direction: Direction;
26
26
  radius: UnitValue;
27
27
  }
28
28
 
29
+ export type RealStateClassification = {
30
+ category: 'TD' | 'TY' | 'STS' | 'Hurricane' | 'Tropical Storm' | 'LOW' | null;
31
+ name: '熱帯低気圧' | '台風' | 'ハリケーン' | '発達した熱帯低気圧' | '温帯低気圧' | null;
32
+ area: '大型' | '超大型' | null;
33
+ intensity: '強い' | '非常に強い' | '猛烈な' | null;
34
+ };
35
+ export type ForecastClassification = Omit<RealStateClassification, 'area'>;
36
+
37
+ export type RealStateCenter = {
38
+ location: Coordinate;
39
+ direction: Direction;
40
+ speed: UnitValue;
41
+ pressure: UnitValue;
42
+ };
43
+ export type ForecastCenter = {
44
+ probabilityCircle: {
45
+ basePoint: Coordinate;
46
+ axes: Axis[];
47
+ };
48
+ } & Omit<RealStateCenter, 'location'>;
49
+
50
+ export type RealStateWindArea = {
51
+ strong: Axis[];
52
+ storm: Axis[];
53
+ };
54
+ export type RealStateWind = {
55
+ average: UnitValue;
56
+ instantaneous: UnitValue;
57
+ area: RealStateWindArea;
58
+ };
59
+ export type ForecastWindArea = {
60
+ stormWarning: Axis[];
61
+ };
62
+ export type ForecastWind = {
63
+ average: UnitValue;
64
+ instantaneous: UnitValue;
65
+ area: ForecastWindArea;
66
+ }
29
67
 
30
- interface A {
68
+ interface RealState {
31
69
  type: '実況' | '推定';
32
70
  elapsedTime: 'PT0H' | 'PT1H';
33
71
  dateTime: string;
34
- classification: {
35
- category: 'TD' | 'TY' | 'STS' | 'Hurricane' | 'Tropical Storm' | 'LOW' | null;
36
- name: '熱帯低気圧' | '台風' | 'ハリケーン' | '発達した熱帯低気圧' | '温帯低気圧' | null;
37
- area: '大型' | '超大型' | null;
38
- intensity: '強い' | '非常に強い' | '猛烈な' | null;
39
- };
40
- center: {
41
- location: Coordinate;
42
- direction: Direction;
43
- speed: UnitValue;
44
- pressure: UnitValue;
45
- };
46
- wind?: {
47
- average: UnitValue;
48
- instantaneous: UnitValue;
49
- area: {
50
- strong: Axis[];
51
- storm: Axis[];
52
- };
53
- };
72
+ classification: RealStateClassification;
73
+ center: RealStateCenter;
74
+ wind?:RealStateWind;
54
75
  }
55
76
 
56
- interface B {
77
+ interface Forecast {
57
78
  type: '予報' | '延長予報';
58
79
  elapsedTime: string;
59
80
  dateTime: string;
60
- classification: {
61
- category: 'TD' | 'TY' | 'STS' | 'Hurricane' | 'Tropical Storm' | 'LOW' | null;
62
- name: '熱帯低気圧' | '台風' | 'ハリケーン' | '発達した熱帯低気圧' | '温帯低気圧' | null;
63
- intensity?: '強い' | '非常に強い' | '猛烈な' | null;
64
- };
65
- center: {
66
- probabilityCircle: {
67
- basePoint: Coordinate;
68
- axes: Axis[];
69
- };
70
- direction: Direction;
71
- speed: UnitValue;
72
- pressure: UnitValue
73
- };
74
- wind: {
75
- average: UnitValue;
76
- instantaneous: UnitValue;
77
- area?: {
78
- strong?: Axis[];
79
- storm?: Axis[];
80
- stormWarning?: Axis[];
81
- };
82
- };
81
+ classification: ForecastClassification;
82
+ center: ForecastCenter;
83
+ wind: ForecastWind;
83
84
  }
84
85
 
85
86
  export interface PublicBody {
@@ -93,7 +94,7 @@ export namespace WeatherTyphoon {
93
94
  remark: '台風発生' | '台風発生(域外から入る)' | '台風消滅(域外へ出る)' | '台風消滅(温帯低気圧化)' | '台風消滅(熱帯低気圧化)' |
94
95
  '台風発生の可能性が小さくなった' | '発表間隔変更(毎時から3時間毎)' | '発表間隔変更(3時間毎から毎時)' | '台風発生予想' | '温帯低気圧化しつつある' | null;
95
96
  };
96
- forecasts: [A] | [A, ...B[]] | [A, A] | [A, A, ...B[]];
97
+ forecasts: [RealState] | [RealState, ...Forecast[]] | [RealState, RealState] | [RealState, RealState, ...Forecast[]];
97
98
  }
98
99
 
99
100
  export interface Public extends TelegramJSONMain {