@uniai-fe/uds-templates 0.5.28 → 0.6.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.
Files changed (56) hide show
  1. package/README.md +3 -6
  2. package/dist/styles.css +1 -1
  3. package/package.json +1 -1
  4. package/src/cctv/styles/variables.scss +1 -1
  5. package/src/weather/_legacy/apis/index.ts +4 -0
  6. package/src/weather/_legacy/data/response.ts +36 -0
  7. package/src/weather/_legacy/hooks/index.ts +5 -0
  8. package/src/weather/{hooks → _legacy/hooks}/useOpenWeatherMap.ts +1 -1
  9. package/src/weather/{hooks → _legacy/hooks}/useWeatherKorea.ts +4 -7
  10. package/src/weather/{hooks → _legacy/hooks}/useWeatherKoreaAlert.ts +2 -4
  11. package/src/weather/_legacy/types/api.ts +221 -0
  12. package/src/weather/_legacy/types/base.ts +70 -0
  13. package/src/weather/_legacy/types/index.ts +4 -0
  14. package/src/weather/_legacy/utils/index.ts +5 -0
  15. package/src/weather/_legacy/utils/locale.ts +28 -0
  16. package/src/weather/_legacy/utils/location.ts +139 -0
  17. package/src/weather/_legacy/utils/weather.ts +460 -0
  18. package/src/weather/apis/client.ts +339 -0
  19. package/src/weather/apis/index.ts +2 -4
  20. package/src/weather/apis/server.ts +264 -0
  21. package/src/weather/components/icon/Address.tsx +7 -0
  22. package/src/weather/components/icon/Weather.tsx +7 -6
  23. package/src/weather/components/page-header/Address.tsx +14 -0
  24. package/src/weather/components/page-header/Alert.tsx +17 -13
  25. package/src/weather/components/page-header/Container.tsx +12 -19
  26. package/src/weather/components/page-header/Forecast.tsx +21 -28
  27. package/src/weather/components/page-header/NextDays.tsx +10 -0
  28. package/src/weather/components/page-header/Today.tsx +86 -158
  29. package/src/weather/components/page-header/index.ts +5 -0
  30. package/src/weather/data/response.ts +4 -23
  31. package/src/weather/hooks/index.ts +3 -3
  32. package/src/weather/hooks/useWeather.ts +52 -0
  33. package/src/weather/hooks/useWeatherAlert.ts +35 -0
  34. package/src/weather/index.tsx +2 -2
  35. package/src/weather/jotai/coordinate.ts +4 -0
  36. package/src/weather/jotai/farm-idx.ts +4 -0
  37. package/src/weather/types/api.ts +393 -114
  38. package/src/weather/types/base.ts +15 -32
  39. package/src/weather/types/index.ts +0 -3
  40. package/src/weather/types/page-header.ts +118 -68
  41. package/src/weather/utils/index.ts +6 -4
  42. package/src/weather/utils/locale.ts +7 -69
  43. package/src/weather/utils/location.ts +6 -141
  44. package/src/weather/utils/weather.ts +53 -456
  45. package/src/weather/data/alert-regions-meta.json +0 -1286
  46. package/src/weather/data/weather-regions-meta.json +0 -9833
  47. package/src/weather/types/provider.ts +0 -34
  48. package/src/weather/utils/alert.ts +0 -30
  49. /package/src/weather/{apis → _legacy/apis}/korea/client.ts +0 -0
  50. /package/src/weather/{apis → _legacy/apis}/korea/server.ts +0 -0
  51. /package/src/weather/{apis → _legacy/apis}/open-weather-map/client.ts +0 -0
  52. /package/src/weather/{apis → _legacy/apis}/open-weather-map/server.ts +0 -0
  53. /package/src/weather/{types → _legacy/types}/korea.ts +0 -0
  54. /package/src/weather/{types → _legacy/types}/open-weather-map.ts +0 -0
  55. /package/src/weather/{utils → _legacy/utils}/date-time.ts +0 -0
  56. /package/src/weather/{utils → _legacy/utils}/validate.ts +0 -0
@@ -1,221 +1,500 @@
1
1
  import type {
2
- KMA_Res_WeatherNow,
3
- KMA_Res_WeatherForecast,
4
- KMA_Res_Base,
5
- KMA_Req_BaseGridCoordinate,
6
- KMA_Req_BaseMoments,
7
- KMA_Res_AlertType,
8
- KMA_Res_AlertLevel,
9
- KMA_Res_AlertCommand,
10
- KMA_Res_WeatherItem,
11
- } from "./korea";
2
+ WeatherApiLocaleOptions,
3
+ WeatherCoordinate,
4
+ WeatherGeoCoordinate,
5
+ } from "./base";
12
6
 
13
- export type API_Req_WeatherKoreaGrid = KMA_Req_BaseGridCoordinate;
14
- export type API_Req_WeatherKoreaMoments = KMA_Req_BaseMoments;
7
+ /**
8
+ * Weather backend; 농장/좌표/locale 공통 요청 옵션.
9
+ * @property {number|string|null} [farm_idx] 농장 식별자
10
+ * @property {number|null} [lat] 위도
11
+ * @property {number|null} [lng] 경도
12
+ * @property {string} [locale] 요청 언어 코드
13
+ * @property {boolean} [include_raw] 원본 응답 포함 여부
14
+ */
15
+ export interface API_Req_Weather
16
+ extends WeatherApiLocaleOptions, Partial<WeatherGeoCoordinate> {
17
+ /**
18
+ * 농장 식별자
19
+ */
20
+ farm_idx?: number | string | null;
21
+ /**
22
+ * 위도
23
+ */
24
+ lat?: number | null;
25
+ /**
26
+ * 경도
27
+ */
28
+ lng?: number | null;
29
+ /**
30
+ * 요청 언어 코드
31
+ */
32
+ locale?: string;
33
+ /**
34
+ * 원본 응답 포함 여부
35
+ */
36
+ include_raw?: boolean;
37
+ }
38
+
39
+ /**
40
+ * Weather backend; 현재 날씨 요청.
41
+ */
42
+ export type API_Req_WeatherNow = API_Req_Weather;
43
+
44
+ /**
45
+ * Weather backend; 예보 날씨 요청.
46
+ */
47
+ export type API_Req_WeatherForecast = API_Req_Weather;
48
+
49
+ /**
50
+ * Weather backend; summary 요청.
51
+ */
52
+ export type API_Req_WeatherSummary = API_Req_Weather;
53
+
54
+ /**
55
+ * Weather backend; 특보 요청 파라미터.
56
+ * @property {number|string|null} farm_idx 농장 식별자
57
+ */
58
+ export interface API_Req_WeatherAlert {
59
+ /**
60
+ * 농장 식별자
61
+ */
62
+ farm_idx: number | string | null;
63
+ }
64
+
65
+ /**
66
+ * Weather Client; local route 경로 옵션.
67
+ * @property {string} [routePath] service app의 local weather route 경로
68
+ */
69
+ export interface WeatherClientRouteOptions {
70
+ /**
71
+ * service app의 local weather route 경로
72
+ */
73
+ routePath?: string;
74
+ }
15
75
 
16
76
  /**
17
- * 기상청 API; 날씨 요청.
77
+ * Weather Client; React Query 실행 옵션.
78
+ * @property {boolean} [enabled] query 실행 여부
18
79
  */
19
- export type API_Req_WeatherKorea = API_Req_WeatherKoreaGrid &
20
- Partial<API_Req_WeatherKoreaMoments>;
80
+ export interface WeatherQueryOptions {
81
+ /**
82
+ * query 실행 여부
83
+ */
84
+ enabled?: boolean;
85
+ }
21
86
 
22
87
  /**
23
- * 기상청 API; 특보 요청 파라미터
24
- * @property {number | null} farm_idx 농장 식별자
88
+ * Weather Client; local route 경로와 query 실행 옵션.
89
+ * @property {string} [routePath] service app의 local weather route 경로
90
+ * @property {boolean} [enabled] query 실행 여부
25
91
  */
26
- export type API_Req_WeatherKoreaAlert = { farm_idx: number | null };
92
+ export interface WeatherClientQueryOptions
93
+ extends WeatherClientRouteOptions, WeatherQueryOptions {
94
+ /**
95
+ * service app의 local weather route 경로
96
+ */
97
+ routePath?: string;
98
+ /**
99
+ * query 실행 여부
100
+ */
101
+ enabled?: boolean;
102
+ }
27
103
 
28
104
  /**
29
- * 기상청 API; 특보 응답 타입 - 지역별 특보정보
105
+ * Weather Server; backend proxy route 입력.
106
+ * @property {string} domain backend API domain
107
+ * @property {string} routeUrl service app local route URL
108
+ * @property {URLSearchParams} searchParams service app local route query
30
109
  */
31
- export type API_Res_WeatherKoreaAlertEach = {
110
+ export interface WeatherServerRouteParams {
111
+ /**
112
+ * backend API domain
113
+ */
114
+ domain: string;
115
+ /**
116
+ * service app local route URL
117
+ */
118
+ routeUrl: string;
119
+ /**
120
+ * service app local route query
121
+ */
122
+ searchParams: URLSearchParams;
123
+ }
124
+
125
+ /**
126
+ * Weather Server; backend fetch helper 입력.
127
+ * @property {string} domain backend API domain
128
+ * @property {string} routeUrl service app local route URL
129
+ * @property {URLSearchParams} searchParams service app local route query
130
+ * @property {string} queryUrl backend weather route URL
131
+ * @property {Data} fallback 실패 시 반환할 fallback 응답
132
+ */
133
+ export type WeatherBackendFetchParams<Data> = WeatherServerRouteParams & {
134
+ /**
135
+ * backend weather route URL
136
+ */
137
+ queryUrl: string;
138
+ /**
139
+ * 실패 시 반환할 fallback 응답
140
+ */
141
+ fallback: Data;
142
+ };
143
+
144
+ /**
145
+ * Weather Hook; 통합 weather 조회 옵션.
146
+ * @property {string} [locale] 요청 언어 코드
147
+ * @property {boolean} [enabled] query 실행 여부
148
+ */
149
+ export interface UseWeatherOptions extends WeatherApiLocaleOptions {
150
+ /**
151
+ * 요청 언어 코드
152
+ */
153
+ locale?: string;
154
+ /**
155
+ * query 실행 여부
156
+ */
157
+ enabled?: boolean;
158
+ }
159
+
160
+ /**
161
+ * Weather Hook; 통합 weather query 결과.
162
+ * @property {API_Req_Weather} params weather summary 요청 파라미터
163
+ * @property {WeatherCoordinate} coordinate 현재 지역 좌표
164
+ * @property {number|null} farm_idx 특보 조회에 사용할 농장 식별자
165
+ * @property {API_Res_WeatherSummary} [summary] summary 응답
166
+ * @property {API_Res_WeatherNow} [now] 현재 날씨 응답
167
+ * @property {API_Res_WeatherForecast} [forecast] 예보 날씨 응답
168
+ * @property {API_Res_WeatherAlertItem[]} alert 특보 목록
169
+ * @property {boolean} isFetching 현재/예보/특보 조회 상태
170
+ * @property {boolean} isFetchingNow 현재 날씨 조회 상태
171
+ * @property {boolean} isFetchingForecast 예보 날씨 조회 상태
172
+ * @property {boolean} isFetchingAlert 특보 조회 상태
173
+ */
174
+ export interface UseWeatherReturn {
175
+ /**
176
+ * weather summary 요청 파라미터
177
+ */
178
+ params: API_Req_Weather;
179
+ /**
180
+ * 현재 지역 좌표
181
+ */
182
+ coordinate: WeatherCoordinate;
183
+ /**
184
+ * 특보 조회에 사용할 농장 식별자
185
+ */
186
+ farm_idx: number | null;
187
+ /**
188
+ * summary 응답
189
+ */
190
+ summary?: API_Res_WeatherSummary;
191
+ /**
192
+ * 현재 날씨 응답
193
+ */
194
+ now?: API_Res_WeatherNow;
195
+ /**
196
+ * 예보 날씨 응답
197
+ */
198
+ forecast?: API_Res_WeatherForecast;
199
+ /**
200
+ * 특보 목록
201
+ */
202
+ alert: API_Res_WeatherAlertItem[];
203
+ /**
204
+ * 현재/예보/특보 조회 상태
205
+ */
206
+ isFetching: boolean;
207
+ /**
208
+ * 현재 날씨 조회 상태
209
+ */
210
+ isFetchingNow: boolean;
211
+ /**
212
+ * 예보 날씨 조회 상태
213
+ */
214
+ isFetchingForecast: boolean;
215
+ /**
216
+ * 특보 조회 상태
217
+ */
218
+ isFetchingAlert: boolean;
219
+ }
220
+
221
+ /**
222
+ * Weather Hook; 통합 weather alert 조회 옵션.
223
+ * @property {boolean} [enabled] query 실행 여부
224
+ */
225
+ export interface UseWeatherAlertOptions {
226
+ /**
227
+ * query 실행 여부
228
+ */
229
+ enabled?: boolean;
230
+ }
231
+
232
+ /**
233
+ * Weather Hook; 통합 weather alert query 결과.
234
+ * @property {number|null} farm_idx 특보 조회에 사용할 농장 식별자
235
+ * @property {API_Res_WeatherAlertItem[]} alert 특보 목록
236
+ * @property {boolean} isFetching 특보 조회 상태
237
+ */
238
+ export interface UseWeatherAlertReturn {
239
+ /**
240
+ * 특보 조회에 사용할 농장 식별자
241
+ */
242
+ farm_idx: number | null;
243
+ /**
244
+ * 특보 목록
245
+ */
246
+ alert: API_Res_WeatherAlertItem[];
247
+ /**
248
+ * 특보 조회 상태
249
+ */
250
+ isFetching: boolean;
251
+ }
252
+
253
+ /**
254
+ * Weather backend; 특보 종류.
255
+ */
256
+ export type API_Res_WeatherAlertType = string;
257
+
258
+ /**
259
+ * Weather backend; 특보 수준.
260
+ */
261
+ export type API_Res_WeatherAlertLevel = string;
262
+
263
+ /**
264
+ * Weather backend; 특보 명령.
265
+ */
266
+ export type API_Res_WeatherAlertCommand = string;
267
+
268
+ /**
269
+ * Weather backend; 지역별 특보정보.
270
+ * @property {string} upper_region_code 상위 지역 코드
271
+ * @property {string} upper_region_name 상위 지역 이름
272
+ * @property {string} alert_region_code 특보 지역 코드
273
+ * @property {string} alert_region_name 특보 지역 이름
274
+ * @property {string} announcement_time 특보 발표시간
275
+ * @property {string} effective_time 특보 발효시간
276
+ * @property {API_Res_WeatherAlertType} alert_type 특보 종류
277
+ * @property {API_Res_WeatherAlertLevel} alert_level 특보 수준
278
+ * @property {API_Res_WeatherAlertCommand} alert_command 특보 명령
279
+ * @property {string} cancel_notice_time 특보 해제 예고시점
280
+ */
281
+ export type API_Res_WeatherAlertItem = {
32
282
  /**
33
283
  * 상위 지역 코드
34
- * @see https://apihub.kma.go.kr/api/typ01/url/wrn_reg.php?tmfc=0&authKey=njld-D40Rb25Xfg-NAW9hA
35
284
  */
36
285
  upper_region_code: string;
37
286
  /**
38
287
  * 상위 지역 이름
39
- * @see https://apihub.kma.go.kr/api/typ01/url/wrn_reg.php?tmfc=0&authKey=njld-D40Rb25Xfg-NAW9hA
40
288
  */
41
289
  upper_region_name: string;
42
290
  /**
43
291
  * 특보 지역 코드
44
- * @see https://apihub.kma.go.kr/api/typ01/url/wrn_reg.php?tmfc=0&authKey=njld-D40Rb25Xfg-NAW9hA
45
292
  */
46
293
  alert_region_code: string;
47
294
  /**
48
295
  * 특보 지역 이름
49
- * @see https://apihub.kma.go.kr/api/typ01/url/wrn_reg.php?tmfc=0&authKey=njld-D40Rb25Xfg-NAW9hA
50
296
  */
51
297
  alert_region_name: string;
52
298
  /**
53
299
  * 특보 발표시간
54
- * - yyyymmddhhmm
55
300
  */
56
301
  announcement_time: string;
57
302
  /**
58
303
  * 특보 발효시간
59
- * - yyyymmddhhmm
60
304
  */
61
305
  effective_time: string;
62
- /** * 특보 종류 (한글) */
63
- alert_type: KMA_Res_AlertType;
64
306
  /**
65
- * 특보 수준 (한글)
66
- * - 경보, 주의, 예비
307
+ * 특보 종류
67
308
  */
68
- alert_level: KMA_Res_AlertLevel;
309
+ alert_type: API_Res_WeatherAlertType;
69
310
  /**
70
- * 특보 명령 (한글)
71
- * - 발표, 변경, 해제
311
+ * 특보 수준
72
312
  */
73
- alert_command: KMA_Res_AlertCommand;
313
+ alert_level: API_Res_WeatherAlertLevel;
74
314
  /**
75
- * 특보 해제 예고시점 (한글)
76
- * - dd일 오전/오후/밤(HH시 ~ HH시)
315
+ * 특보 명령
316
+ */
317
+ alert_command: API_Res_WeatherAlertCommand;
318
+ /**
319
+ * 특보 해제 예고시점
77
320
  */
78
321
  cancel_notice_time: string;
79
322
  };
323
+
80
324
  /**
81
- * 기상청 API; 특보 응답 타입
325
+ * Weather backend; 특보 응답 타입.
326
+ * @property {string|null} api_announcement_time 특보 발표 시간
327
+ * @property {number} total_count 총 특보 개수
328
+ * @property {API_Res_WeatherAlertItem[]} alerts 지역별 특보
82
329
  */
83
- export type API_Res_WeatherKoreaAlert = {
84
- /** * 특보 발표 시간 */
330
+ export type API_Res_WeatherAlert = {
331
+ /**
332
+ * 특보 발표 시간
333
+ */
85
334
  api_announcement_time: string | null;
86
- /** * 총 특보 개수 */
335
+ /**
336
+ * 총 특보 개수
337
+ */
87
338
  total_count: number;
88
- /** * 지역별 특보 */
89
- alerts: API_Res_WeatherKoreaAlertEach[];
339
+ /**
340
+ * 지역별 특보
341
+ */
342
+ alerts: API_Res_WeatherAlertItem[];
90
343
  };
91
344
 
92
345
  /**
93
- * 기상청 API; 기초 정보
94
- * @property {string} condition - 개황 정보
346
+ * Weather backend; 기초 정보.
347
+ * @property {string|null} sky 하늘상태 코드
348
+ * @property {string|null} drop 강수형태 코드
349
+ * @property {string|null} rainAmount 강수량 코드
350
+ * @property {string|null} snowAmount 강설량 코드
351
+ * @property {string|null} windSpeed 풍속 코드
352
+ * @property {string|null} condition 날씨 상태 코드
353
+ * @property {string|null} conditionName 날씨 상태 텍스트
95
354
  */
96
- export type API_Res_WeatherKoreaBase = {
355
+ export type API_Res_WeatherBase = {
97
356
  /**
98
357
  * 하늘상태 코드
99
- * - 1(맑음)
100
- * - 2(구름조금)
101
- * - 3(구름많음)
102
- * - 4(흐림)
103
358
  */
104
359
  sky: string | null;
105
360
  /**
106
361
  * 강수형태 코드
107
- * - 0(없음)
108
- * - 1(비)
109
- * - 2(비/눈)
110
- * - 3(눈)
111
- * - 4(소나기)
112
362
  */
113
363
  drop: string | null;
114
364
  /**
115
365
  * 강수량 코드
116
- * - 1(약한 비); 3mm/h 미만
117
- * - 2(보통 비); 3mm/h 이상 15mm/h 미만
118
- * - 3(강한 비); 15mm/h 이상
119
366
  */
120
367
  rainAmount: string | null;
121
368
  /**
122
369
  * 강설량 코드
123
- * - 1(보통 눈); 1cm/h 미만
124
- * - 2(많은 눈); 1cm/h 이상
125
370
  */
126
371
  snowAmount: string | null;
127
372
  /**
128
373
  * 풍속 코드
129
- * - 1(약한 바람); 4m/s 미만
130
- * - 2(약간 강한 바람); 4m/s 이상 9m/s 미만
131
- * - 3(강한 바람); 9m/s 이상
132
374
  */
133
375
  windSpeed: string | null;
134
376
  /**
135
377
  * 날씨 상태 코드
136
- * - sky-1(맑음)
137
- * - sky-2(구름조금)
138
- * - sky-3(구름많음)
139
- * - sky-4(흐림)
140
- * - drop-rain-shower(소나기)
141
- * - drop-rain(비)
142
- * - drop-rain-1(약한 비)
143
- * - drop-rain-2(보통 비)
144
- * - drop-rain-3(강한 비)
145
- * - drop-rain-snow(비/눈)
146
- * - drop-rain-snow-1(약한 비/눈)
147
- * - drop-rain-snow-2(보통 비/눈)
148
- * - drop-rain-snow-3(강한 비/눈)
149
- * - drop-snow(눈)
150
- * - drop-snow-1(보통 눈)
151
- * - drop-snow-2(많은 눈)
152
378
  */
153
379
  condition: string | null;
154
- /** 날씨 상태 텍스트 */
380
+ /**
381
+ * 날씨 상태 텍스트
382
+ */
155
383
  conditionName: string | null;
156
384
  };
157
385
 
158
386
  /**
159
- * 기상청 API; 오늘 날씨
387
+ * Weather backend; 오늘 날씨.
160
388
  * @property {number|string|null} temperature 기온(℃)
161
389
  * @property {number|string|null} max_temperature 최고기온(℃)
162
390
  * @property {number|string|null} min_temperature 최저기온(℃)
163
391
  * @property {number|string|null} humidity 습도(%)
164
392
  */
165
- export type API_Res_WeatherKoreaToday = API_Res_WeatherKoreaBase & {
166
- /** 기온(℃) */
393
+ export type API_Res_WeatherToday = API_Res_WeatherBase & {
394
+ /**
395
+ * 기온(℃)
396
+ */
167
397
  temperature: number | string | null;
168
- /** 최고 기온(℃) */
398
+ /**
399
+ * 최고 기온(℃)
400
+ */
169
401
  max_temperature: number | string | null;
170
- /** 최저 기온(℃) */
402
+ /**
403
+ * 최저 기온(℃)
404
+ */
171
405
  min_temperature: number | string | null;
172
- /** 습도(%) */
406
+ /**
407
+ * 습도(%)
408
+ */
173
409
  humidity: number | string | null;
174
410
  };
175
411
 
176
412
  /**
177
- * 기상청 API; 내일/모레 날씨
413
+ * Weather backend; 내일/모레 날씨.
178
414
  * @property {number|string|null} max_temperature 최고기온(℃)
179
415
  * @property {number|string|null} min_temperature 최저기온(℃)
180
416
  */
181
- export type API_Res_WeatherKoreaNextDays = API_Res_WeatherKoreaBase & {
182
- /** 최고 기온(℃) */
417
+ export type API_Res_WeatherNextDays = API_Res_WeatherBase & {
418
+ /**
419
+ * 최고 기온(℃)
420
+ */
183
421
  max_temperature: number | string | null;
184
- /** 최저 기온(℃) */
422
+ /**
423
+ * 최저 기온(℃)
424
+ */
185
425
  min_temperature: number | string | null;
186
426
  };
187
427
 
188
428
  /**
189
- * 기상청 API; 원본 응답
190
- * @property {RAW} raw API 원본 데이터
429
+ * Weather backend; 공통 응답 메타.
430
+ * @property {string|null} [source] backend weather source
431
+ * @property {boolean} [fallback_used] fallback 사용 여부
432
+ * @property {unknown} [raw] include_raw 요청 시 원본 응답
191
433
  */
192
- export type API_Res_WeatherKoreaRaw<RAW = KMA_Res_Base<KMA_Res_WeatherItem>> = {
193
- /** API 원본 */
194
- raw: RAW;
434
+ export interface API_Res_WeatherBackendMeta {
435
+ /**
436
+ * backend weather source
437
+ */
438
+ source?: string | null;
439
+ /**
440
+ * fallback 사용 여부
441
+ */
442
+ fallback_used?: boolean;
443
+ /**
444
+ * include_raw 요청 시 원본 응답
445
+ */
446
+ raw?: unknown;
447
+ }
448
+
449
+ /**
450
+ * Weather backend; 현재 날씨 구조.
451
+ * @property {API_Res_WeatherToday} today 오늘 데이터
452
+ */
453
+ export type API_Res_WeatherNow = API_Res_WeatherBackendMeta & {
454
+ /**
455
+ * 오늘 날씨
456
+ */
457
+ today: API_Res_WeatherToday;
195
458
  };
196
459
 
197
460
  /**
198
- * 기상청 API; 초단기 실황 구조
199
- * @property {API_Res_WeatherKoreaToday} today 오늘 데이터
461
+ * Weather backend; 예보 날씨 구조.
462
+ * @property {API_Res_WeatherToday} today 오늘 데이터
463
+ * @property {API_Res_WeatherNextDays} day_1 내일 데이터
464
+ * @property {API_Res_WeatherNextDays} day_2 모레 데이터
200
465
  */
201
- export type API_Res_WeatherKoreaNow =
202
- API_Res_WeatherKoreaRaw<KMA_Res_WeatherNow> & {
203
- /** 오늘 날씨 */
204
- today: API_Res_WeatherKoreaToday;
205
- };
466
+ export type API_Res_WeatherForecast = API_Res_WeatherBackendMeta & {
467
+ /**
468
+ * 오늘 날씨
469
+ */
470
+ today: API_Res_WeatherToday;
471
+ /**
472
+ * 내일 날씨
473
+ */
474
+ day_1: API_Res_WeatherNextDays;
475
+ /**
476
+ * 모레 날씨
477
+ */
478
+ day_2: API_Res_WeatherNextDays;
479
+ };
206
480
 
207
481
  /**
208
- * 기상청 API; 단기 예보 구조
209
- * @property {API_Res_WeatherKoreaToday} today 오늘 데이터
210
- * @property {API_Res_WeatherKoreaNextDays} day_1 내일 데이터
211
- * @property {API_Res_WeatherKoreaNextDays} day_2 모레 데이터
482
+ * Weather backend; summary 구조.
483
+ * @property {API_Res_WeatherNow} now 현재 날씨
484
+ * @property {API_Res_WeatherForecast} forecast 예보 날씨
485
+ * @property {API_Res_WeatherAlert} alert 특보
212
486
  */
213
- export type API_Res_WeatherKoreaForecast =
214
- API_Res_WeatherKoreaRaw<KMA_Res_WeatherForecast> & {
215
- /** 오늘 날씨 */
216
- today: API_Res_WeatherKoreaToday;
217
- /** 내일 날씨 */
218
- day_1: API_Res_WeatherKoreaNextDays;
219
- /** 모레 날씨 */
220
- day_2: API_Res_WeatherKoreaNextDays;
221
- };
487
+ export type API_Res_WeatherSummary = {
488
+ /**
489
+ * 현재 날씨
490
+ */
491
+ now: API_Res_WeatherNow;
492
+ /**
493
+ * 예보 날씨
494
+ */
495
+ forecast: API_Res_WeatherForecast;
496
+ /**
497
+ * 특보
498
+ */
499
+ alert: API_Res_WeatherAlert;
500
+ };
@@ -4,9 +4,13 @@
4
4
  * @property {number | null} longitude 경도
5
5
  */
6
6
  export type GeoCoordinate = {
7
- /** 위도 */
7
+ /**
8
+ * 위도
9
+ */
8
10
  latitude: number | null;
9
- /** 경도 */
11
+ /**
12
+ * 경도
13
+ */
10
14
  longitude: number | null;
11
15
  };
12
16
 
@@ -16,9 +20,13 @@ export type GeoCoordinate = {
16
20
  * @property {number | null} lng 경도
17
21
  */
18
22
  export type WeatherGeoCoordinate = {
19
- /** 위도 */
23
+ /**
24
+ * 위도
25
+ */
20
26
  lat: number | null;
21
- /** 경도 */
27
+ /**
28
+ * 경도
29
+ */
22
30
  lng: number | null;
23
31
  };
24
32
 
@@ -33,38 +41,13 @@ export interface WeatherApiLocaleOptions {
33
41
  locale?: string;
34
42
  }
35
43
 
36
- /**
37
- * OpenWeatherMap 요청 파라미터.
38
- * @property {number | null} lat 위도
39
- * @property {number | null} lng 경도
40
- * @property {string} [locale] 요청 언어 코드
41
- */
42
- export type WeatherOpenWeatherMapParams = WeatherGeoCoordinate &
43
- WeatherApiLocaleOptions;
44
-
45
44
  /**
46
45
  * 좌표와 주소 정보를 함께 담는 구조.
47
46
  * @property {string | null} address 좌표 주소
48
47
  */
49
48
  export type WeatherCoordinate = {
50
- /** 좌표 주소 */
49
+ /**
50
+ * 좌표 주소
51
+ */
51
52
  address: string | null;
52
53
  } & WeatherGeoCoordinate;
53
-
54
- /**
55
- * 날씨 로직에서 사용하는 날짜 기준값 모음.
56
- * @property {Date} now 현재 시각
57
- * @property {string} today 오늘 날짜(yyyymmdd)
58
- * @property {string} tomorrow 내일 날짜(yyyymmdd)
59
- * @property {string} dayAfterTomorrow 모레 날짜(yyyymmdd)
60
- */
61
- export type WeatherUtilDateTimeMoments = {
62
- /** 현재 시각 */
63
- now: Date;
64
- /** 오늘 날짜(yyyymmdd) */
65
- today: string;
66
- /** 내일 날짜(yyyymmdd) */
67
- tomorrow: string;
68
- /** 모레 날짜(yyyymmdd) */
69
- dayAfterTomorrow: string;
70
- };
@@ -1,6 +1,3 @@
1
1
  export type * from "./base";
2
2
  export type * from "./api";
3
- export type * from "./korea";
4
- export type * from "./open-weather-map";
5
3
  export type * from "./page-header";
6
- export type * from "./provider";