weather-i18n 1.0.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,614 @@
1
+ import z from "zod";
2
+ import type { WMO4677Code } from "./types";
3
+ export declare const WMO4677_VALIDATION_ERRORS: {
4
+ INTEGER_OUTSIDE_OF_RANGE: string;
5
+ STRING_INVALID_FORMAT: string;
6
+ };
7
+ export declare const WMO4677NumericFormat: z.ZodNumber & z.ZodType<WMO4677Code, number, z.core.$ZodTypeInternals<WMO4677Code, number>>;
8
+ export declare const WMO4677StringFormat: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>> & z.ZodType<WMO4677Code, string, z.core.$ZodTypeInternals<WMO4677Code, string>>;
9
+ export declare const WMO4677HumanKeyFormat: z.ZodEnum<{
10
+ cloud_not_observed: "cloud_not_observed";
11
+ cloud_dissolving: "cloud_dissolving";
12
+ sky_unchanged: "sky_unchanged";
13
+ cloud_developing: "cloud_developing";
14
+ smoke_haze_reduced_visibility: "smoke_haze_reduced_visibility";
15
+ haze: "haze";
16
+ dust_suspension: "dust_suspension";
17
+ dust_sand_raised_by_wind: "dust_sand_raised_by_wind";
18
+ dust_sand_whirls: "dust_sand_whirls";
19
+ duststorm_sandstorm: "duststorm_sandstorm";
20
+ mist: "mist";
21
+ fog_patches_shallow: "fog_patches_shallow";
22
+ fog_shallow_continuous: "fog_shallow_continuous";
23
+ lightning_no_thunder: "lightning_no_thunder";
24
+ precipitation_not_reaching_ground: "precipitation_not_reaching_ground";
25
+ precipitation_distant: "precipitation_distant";
26
+ precipitation_nearby: "precipitation_nearby";
27
+ thunderstorm_no_precipitation: "thunderstorm_no_precipitation";
28
+ squalls: "squalls";
29
+ funnel_clouds: "funnel_clouds";
30
+ drizzle_or_snow_grains_past_hour: "drizzle_or_snow_grains_past_hour";
31
+ rain_past_hour: "rain_past_hour";
32
+ snow_past_hour: "snow_past_hour";
33
+ rain_and_snow_past_hour: "rain_and_snow_past_hour";
34
+ freezing_drizzle_or_rain_past_hour: "freezing_drizzle_or_rain_past_hour";
35
+ rain_showers_past_hour: "rain_showers_past_hour";
36
+ snow_showers_past_hour: "snow_showers_past_hour";
37
+ hail_showers_past_hour: "hail_showers_past_hour";
38
+ fog_past_hour: "fog_past_hour";
39
+ thunderstorm_past_hour: "thunderstorm_past_hour";
40
+ duststorm_decreasing: "duststorm_decreasing";
41
+ duststorm_no_change: "duststorm_no_change";
42
+ duststorm_increasing: "duststorm_increasing";
43
+ severe_duststorm_decreasing: "severe_duststorm_decreasing";
44
+ severe_duststorm_no_change: "severe_duststorm_no_change";
45
+ severe_duststorm_increasing: "severe_duststorm_increasing";
46
+ drifting_snow_low_slight: "drifting_snow_low_slight";
47
+ drifting_snow_low_heavy: "drifting_snow_low_heavy";
48
+ blowing_snow_high_slight: "blowing_snow_high_slight";
49
+ blowing_snow_high_heavy: "blowing_snow_high_heavy";
50
+ fog_distant: "fog_distant";
51
+ fog_patches: "fog_patches";
52
+ fog_thinning_sky_visible: "fog_thinning_sky_visible";
53
+ fog_thinning_sky_invisible: "fog_thinning_sky_invisible";
54
+ fog_no_change_sky_visible: "fog_no_change_sky_visible";
55
+ fog_no_change_sky_invisible: "fog_no_change_sky_invisible";
56
+ fog_thickening_sky_visible: "fog_thickening_sky_visible";
57
+ fog_thickening_sky_invisible: "fog_thickening_sky_invisible";
58
+ fog_rime_sky_visible: "fog_rime_sky_visible";
59
+ fog_rime_sky_invisible: "fog_rime_sky_invisible";
60
+ drizzle_intermittent_slight: "drizzle_intermittent_slight";
61
+ drizzle_continuous_slight: "drizzle_continuous_slight";
62
+ drizzle_intermittent_moderate: "drizzle_intermittent_moderate";
63
+ drizzle_continuous_moderate: "drizzle_continuous_moderate";
64
+ drizzle_intermittent_heavy: "drizzle_intermittent_heavy";
65
+ drizzle_continuous_heavy: "drizzle_continuous_heavy";
66
+ freezing_drizzle_slight: "freezing_drizzle_slight";
67
+ freezing_drizzle_moderate_heavy: "freezing_drizzle_moderate_heavy";
68
+ rain_drizzle_slight: "rain_drizzle_slight";
69
+ rain_drizzle_moderate_heavy: "rain_drizzle_moderate_heavy";
70
+ rain_intermittent_slight: "rain_intermittent_slight";
71
+ rain_continuous_slight: "rain_continuous_slight";
72
+ rain_intermittent_moderate: "rain_intermittent_moderate";
73
+ rain_continuous_moderate: "rain_continuous_moderate";
74
+ rain_intermittent_heavy: "rain_intermittent_heavy";
75
+ rain_continuous_heavy: "rain_continuous_heavy";
76
+ freezing_rain_slight: "freezing_rain_slight";
77
+ freezing_rain_moderate_heavy: "freezing_rain_moderate_heavy";
78
+ rain_snow_mixed_slight: "rain_snow_mixed_slight";
79
+ rain_snow_mixed_moderate_heavy: "rain_snow_mixed_moderate_heavy";
80
+ snowflakes_intermittent_slight: "snowflakes_intermittent_slight";
81
+ snowflakes_continuous_slight: "snowflakes_continuous_slight";
82
+ snowflakes_intermittent_moderate: "snowflakes_intermittent_moderate";
83
+ snowflakes_continuous_moderate: "snowflakes_continuous_moderate";
84
+ snowflakes_intermittent_heavy: "snowflakes_intermittent_heavy";
85
+ snowflakes_continuous_heavy: "snowflakes_continuous_heavy";
86
+ diamond_dust: "diamond_dust";
87
+ snow_grains: "snow_grains";
88
+ snow_crystals: "snow_crystals";
89
+ ice_pellets: "ice_pellets";
90
+ rain_showers_slight: "rain_showers_slight";
91
+ rain_showers_moderate_heavy: "rain_showers_moderate_heavy";
92
+ rain_showers_violent: "rain_showers_violent";
93
+ rain_snow_showers_slight: "rain_snow_showers_slight";
94
+ rain_snow_showers_moderate_heavy: "rain_snow_showers_moderate_heavy";
95
+ snow_showers_slight: "snow_showers_slight";
96
+ snow_showers_moderate_heavy: "snow_showers_moderate_heavy";
97
+ snow_pellets_hail_showers_slight: "snow_pellets_hail_showers_slight";
98
+ snow_pellets_hail_showers_moderate_heavy: "snow_pellets_hail_showers_moderate_heavy";
99
+ hail_showers_no_thunder_slight: "hail_showers_no_thunder_slight";
100
+ hail_showers_no_thunder_moderate_heavy: "hail_showers_no_thunder_moderate_heavy";
101
+ rain_with_recent_thunderstorm_slight: "rain_with_recent_thunderstorm_slight";
102
+ rain_with_recent_thunderstorm_moderate_heavy: "rain_with_recent_thunderstorm_moderate_heavy";
103
+ snow_hail_with_recent_thunderstorm_slight: "snow_hail_with_recent_thunderstorm_slight";
104
+ snow_hail_with_recent_thunderstorm_moderate_heavy: "snow_hail_with_recent_thunderstorm_moderate_heavy";
105
+ thunderstorm_slight_moderate_no_hail: "thunderstorm_slight_moderate_no_hail";
106
+ thunderstorm_slight_moderate_with_hail: "thunderstorm_slight_moderate_with_hail";
107
+ thunderstorm_heavy_no_hail: "thunderstorm_heavy_no_hail";
108
+ thunderstorm_with_duststorm: "thunderstorm_with_duststorm";
109
+ thunderstorm_heavy_with_hail: "thunderstorm_heavy_with_hail";
110
+ }>;
111
+ export declare const WMO4677Schema: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber & z.ZodType<WMO4677Code, number, z.core.$ZodTypeInternals<WMO4677Code, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>> & z.ZodType<WMO4677Code, string, z.core.$ZodTypeInternals<WMO4677Code, string>>, z.ZodEnum<{
112
+ cloud_not_observed: "cloud_not_observed";
113
+ cloud_dissolving: "cloud_dissolving";
114
+ sky_unchanged: "sky_unchanged";
115
+ cloud_developing: "cloud_developing";
116
+ smoke_haze_reduced_visibility: "smoke_haze_reduced_visibility";
117
+ haze: "haze";
118
+ dust_suspension: "dust_suspension";
119
+ dust_sand_raised_by_wind: "dust_sand_raised_by_wind";
120
+ dust_sand_whirls: "dust_sand_whirls";
121
+ duststorm_sandstorm: "duststorm_sandstorm";
122
+ mist: "mist";
123
+ fog_patches_shallow: "fog_patches_shallow";
124
+ fog_shallow_continuous: "fog_shallow_continuous";
125
+ lightning_no_thunder: "lightning_no_thunder";
126
+ precipitation_not_reaching_ground: "precipitation_not_reaching_ground";
127
+ precipitation_distant: "precipitation_distant";
128
+ precipitation_nearby: "precipitation_nearby";
129
+ thunderstorm_no_precipitation: "thunderstorm_no_precipitation";
130
+ squalls: "squalls";
131
+ funnel_clouds: "funnel_clouds";
132
+ drizzle_or_snow_grains_past_hour: "drizzle_or_snow_grains_past_hour";
133
+ rain_past_hour: "rain_past_hour";
134
+ snow_past_hour: "snow_past_hour";
135
+ rain_and_snow_past_hour: "rain_and_snow_past_hour";
136
+ freezing_drizzle_or_rain_past_hour: "freezing_drizzle_or_rain_past_hour";
137
+ rain_showers_past_hour: "rain_showers_past_hour";
138
+ snow_showers_past_hour: "snow_showers_past_hour";
139
+ hail_showers_past_hour: "hail_showers_past_hour";
140
+ fog_past_hour: "fog_past_hour";
141
+ thunderstorm_past_hour: "thunderstorm_past_hour";
142
+ duststorm_decreasing: "duststorm_decreasing";
143
+ duststorm_no_change: "duststorm_no_change";
144
+ duststorm_increasing: "duststorm_increasing";
145
+ severe_duststorm_decreasing: "severe_duststorm_decreasing";
146
+ severe_duststorm_no_change: "severe_duststorm_no_change";
147
+ severe_duststorm_increasing: "severe_duststorm_increasing";
148
+ drifting_snow_low_slight: "drifting_snow_low_slight";
149
+ drifting_snow_low_heavy: "drifting_snow_low_heavy";
150
+ blowing_snow_high_slight: "blowing_snow_high_slight";
151
+ blowing_snow_high_heavy: "blowing_snow_high_heavy";
152
+ fog_distant: "fog_distant";
153
+ fog_patches: "fog_patches";
154
+ fog_thinning_sky_visible: "fog_thinning_sky_visible";
155
+ fog_thinning_sky_invisible: "fog_thinning_sky_invisible";
156
+ fog_no_change_sky_visible: "fog_no_change_sky_visible";
157
+ fog_no_change_sky_invisible: "fog_no_change_sky_invisible";
158
+ fog_thickening_sky_visible: "fog_thickening_sky_visible";
159
+ fog_thickening_sky_invisible: "fog_thickening_sky_invisible";
160
+ fog_rime_sky_visible: "fog_rime_sky_visible";
161
+ fog_rime_sky_invisible: "fog_rime_sky_invisible";
162
+ drizzle_intermittent_slight: "drizzle_intermittent_slight";
163
+ drizzle_continuous_slight: "drizzle_continuous_slight";
164
+ drizzle_intermittent_moderate: "drizzle_intermittent_moderate";
165
+ drizzle_continuous_moderate: "drizzle_continuous_moderate";
166
+ drizzle_intermittent_heavy: "drizzle_intermittent_heavy";
167
+ drizzle_continuous_heavy: "drizzle_continuous_heavy";
168
+ freezing_drizzle_slight: "freezing_drizzle_slight";
169
+ freezing_drizzle_moderate_heavy: "freezing_drizzle_moderate_heavy";
170
+ rain_drizzle_slight: "rain_drizzle_slight";
171
+ rain_drizzle_moderate_heavy: "rain_drizzle_moderate_heavy";
172
+ rain_intermittent_slight: "rain_intermittent_slight";
173
+ rain_continuous_slight: "rain_continuous_slight";
174
+ rain_intermittent_moderate: "rain_intermittent_moderate";
175
+ rain_continuous_moderate: "rain_continuous_moderate";
176
+ rain_intermittent_heavy: "rain_intermittent_heavy";
177
+ rain_continuous_heavy: "rain_continuous_heavy";
178
+ freezing_rain_slight: "freezing_rain_slight";
179
+ freezing_rain_moderate_heavy: "freezing_rain_moderate_heavy";
180
+ rain_snow_mixed_slight: "rain_snow_mixed_slight";
181
+ rain_snow_mixed_moderate_heavy: "rain_snow_mixed_moderate_heavy";
182
+ snowflakes_intermittent_slight: "snowflakes_intermittent_slight";
183
+ snowflakes_continuous_slight: "snowflakes_continuous_slight";
184
+ snowflakes_intermittent_moderate: "snowflakes_intermittent_moderate";
185
+ snowflakes_continuous_moderate: "snowflakes_continuous_moderate";
186
+ snowflakes_intermittent_heavy: "snowflakes_intermittent_heavy";
187
+ snowflakes_continuous_heavy: "snowflakes_continuous_heavy";
188
+ diamond_dust: "diamond_dust";
189
+ snow_grains: "snow_grains";
190
+ snow_crystals: "snow_crystals";
191
+ ice_pellets: "ice_pellets";
192
+ rain_showers_slight: "rain_showers_slight";
193
+ rain_showers_moderate_heavy: "rain_showers_moderate_heavy";
194
+ rain_showers_violent: "rain_showers_violent";
195
+ rain_snow_showers_slight: "rain_snow_showers_slight";
196
+ rain_snow_showers_moderate_heavy: "rain_snow_showers_moderate_heavy";
197
+ snow_showers_slight: "snow_showers_slight";
198
+ snow_showers_moderate_heavy: "snow_showers_moderate_heavy";
199
+ snow_pellets_hail_showers_slight: "snow_pellets_hail_showers_slight";
200
+ snow_pellets_hail_showers_moderate_heavy: "snow_pellets_hail_showers_moderate_heavy";
201
+ hail_showers_no_thunder_slight: "hail_showers_no_thunder_slight";
202
+ hail_showers_no_thunder_moderate_heavy: "hail_showers_no_thunder_moderate_heavy";
203
+ rain_with_recent_thunderstorm_slight: "rain_with_recent_thunderstorm_slight";
204
+ rain_with_recent_thunderstorm_moderate_heavy: "rain_with_recent_thunderstorm_moderate_heavy";
205
+ snow_hail_with_recent_thunderstorm_slight: "snow_hail_with_recent_thunderstorm_slight";
206
+ snow_hail_with_recent_thunderstorm_moderate_heavy: "snow_hail_with_recent_thunderstorm_moderate_heavy";
207
+ thunderstorm_slight_moderate_no_hail: "thunderstorm_slight_moderate_no_hail";
208
+ thunderstorm_slight_moderate_with_hail: "thunderstorm_slight_moderate_with_hail";
209
+ thunderstorm_heavy_no_hail: "thunderstorm_heavy_no_hail";
210
+ thunderstorm_with_duststorm: "thunderstorm_with_duststorm";
211
+ thunderstorm_heavy_with_hail: "thunderstorm_heavy_with_hail";
212
+ }>]>, z.ZodTransform<{
213
+ key: "cloud_not_observed";
214
+ description: "Cloud development not observed or not observable";
215
+ code: WMO4677Code;
216
+ } | {
217
+ key: "cloud_dissolving";
218
+ description: "Cloud generally dissolving or becoming less developed";
219
+ code: WMO4677Code;
220
+ } | {
221
+ key: "sky_unchanged";
222
+ description: "State of sky on the whole unchanged";
223
+ code: WMO4677Code;
224
+ } | {
225
+ key: "cloud_developing";
226
+ description: "Clouds generally forming or developing";
227
+ code: WMO4677Code;
228
+ } | {
229
+ key: "smoke_haze_reduced_visibility";
230
+ description: "Visibility reduced by smoke, e.g. veldt or forest fires, industrial smoke or volcanic ashes";
231
+ code: WMO4677Code;
232
+ } | {
233
+ key: "haze";
234
+ description: "Haze";
235
+ code: WMO4677Code;
236
+ } | {
237
+ key: "dust_suspension";
238
+ description: "Widespread dust in suspension in the air, not raised by wind at or near the station at the time of observation";
239
+ code: WMO4677Code;
240
+ } | {
241
+ key: "dust_sand_raised_by_wind";
242
+ description: "Dust or sand raised by wind at or near the station at the time of observation, but no well-developed dust/sand whirls and no duststorm or sandstorm";
243
+ code: WMO4677Code;
244
+ } | {
245
+ key: "dust_sand_whirls";
246
+ description: "Well-developed dust or sand whirl(s) seen at or near the station during the preceding hour or at the time of observation, but no duststorm or sandstorm";
247
+ code: WMO4677Code;
248
+ } | {
249
+ key: "duststorm_sandstorm";
250
+ description: "Duststorm or sandstorm within sight at the time of observation, or at the station during the preceding hour";
251
+ code: WMO4677Code;
252
+ } | {
253
+ key: "mist";
254
+ description: "Mist";
255
+ code: WMO4677Code;
256
+ } | {
257
+ key: "fog_patches_shallow";
258
+ description: "Patches of shallow fog or ice fog at the station, not deeper than about 2m on land or 10m at sea";
259
+ code: WMO4677Code;
260
+ } | {
261
+ key: "fog_shallow_continuous";
262
+ description: "More or less continuous shallow fog or ice fog at the station, not deeper than about 2m on land or 10m at sea";
263
+ code: WMO4677Code;
264
+ } | {
265
+ key: "lightning_no_thunder";
266
+ description: "Lightning visible, no thunder heard";
267
+ code: WMO4677Code;
268
+ } | {
269
+ key: "precipitation_not_reaching_ground";
270
+ description: "Precipitation within sight, not reaching the ground or the surface of the sea";
271
+ code: WMO4677Code;
272
+ } | {
273
+ key: "precipitation_distant";
274
+ description: "Precipitation within sight, reaching the ground, but distant (> 5 km from the station)";
275
+ code: WMO4677Code;
276
+ } | {
277
+ key: "precipitation_nearby";
278
+ description: "Precipitation within sight, reaching the ground, near to but not at the station";
279
+ code: WMO4677Code;
280
+ } | {
281
+ key: "thunderstorm_no_precipitation";
282
+ description: "Thunderstorm, but no precipitation at the time of observation";
283
+ code: WMO4677Code;
284
+ } | {
285
+ key: "squalls";
286
+ description: "Squalls at or within sight of the station during the preceding hour or at the time of observation";
287
+ code: WMO4677Code;
288
+ } | {
289
+ key: "funnel_clouds";
290
+ description: "Funnel clouds at or within sight of the station during the preceding hour or at the time of observation";
291
+ code: WMO4677Code;
292
+ } | {
293
+ key: "drizzle_or_snow_grains_past_hour";
294
+ description: "Drizzle (not freezing) or snow grains, not falling as showers, during the preceding hour but not at the time of observation";
295
+ code: WMO4677Code;
296
+ } | {
297
+ key: "rain_past_hour";
298
+ description: "Rain (not freezing), not falling as showers, during the preceding hour but not at the time of observation";
299
+ code: WMO4677Code;
300
+ } | {
301
+ key: "snow_past_hour";
302
+ description: "Snow, not falling as showers, during the preceding hour but not at the time of observation";
303
+ code: WMO4677Code;
304
+ } | {
305
+ key: "rain_and_snow_past_hour";
306
+ description: "Rain and snow or ice pellets, not falling as showers, during the preceding hour but not at the time of observation";
307
+ code: WMO4677Code;
308
+ } | {
309
+ key: "freezing_drizzle_or_rain_past_hour";
310
+ description: "Freezing drizzle or freezing rain, during the preceding hour but not at the time of observation";
311
+ code: WMO4677Code;
312
+ } | {
313
+ key: "rain_showers_past_hour";
314
+ description: "Shower(s) of rain during the preceding hour but not at the time of observation";
315
+ code: WMO4677Code;
316
+ } | {
317
+ key: "snow_showers_past_hour";
318
+ description: "Shower(s) of snow, or of rain and snow, during the preceding hour but not at the time of observation";
319
+ code: WMO4677Code;
320
+ } | {
321
+ key: "hail_showers_past_hour";
322
+ description: "Shower(s) of hail, or of rain and hail, during the preceding hour but not at the time of observation";
323
+ code: WMO4677Code;
324
+ } | {
325
+ key: "fog_past_hour";
326
+ description: "Fog or ice fog during the preceding hour but not at the time of observation";
327
+ code: WMO4677Code;
328
+ } | {
329
+ key: "thunderstorm_past_hour";
330
+ description: "Thunderstorm (with or without precipitation) during the preceding hour but not at the time of observation";
331
+ code: WMO4677Code;
332
+ } | {
333
+ key: "duststorm_decreasing";
334
+ description: "Slight or moderate duststorm or sandstorm - has decreased during the preceding hour";
335
+ code: WMO4677Code;
336
+ } | {
337
+ key: "duststorm_no_change";
338
+ description: "Slight or moderate duststorm or sandstorm - no appreciable change during the preceding hour";
339
+ code: WMO4677Code;
340
+ } | {
341
+ key: "duststorm_increasing";
342
+ description: "Slight or moderate duststorm or sandstorm - has begun or has increased during the preceding hour";
343
+ code: WMO4677Code;
344
+ } | {
345
+ key: "severe_duststorm_decreasing";
346
+ description: "Severe duststorm or sandstorm - has decreased during the preceding hour";
347
+ code: WMO4677Code;
348
+ } | {
349
+ key: "severe_duststorm_no_change";
350
+ description: "Severe duststorm or sandstorm - no appreciable change during the preceding hour";
351
+ code: WMO4677Code;
352
+ } | {
353
+ key: "severe_duststorm_increasing";
354
+ description: "Severe duststorm or sandstorm - has begun or has increased during the preceding hour";
355
+ code: WMO4677Code;
356
+ } | {
357
+ key: "drifting_snow_low_slight";
358
+ description: "Slight/moderate drifting snow - generally low (below eye level)";
359
+ code: WMO4677Code;
360
+ } | {
361
+ key: "drifting_snow_low_heavy";
362
+ description: "Heavy drifting snow - generally low (below eye level)";
363
+ code: WMO4677Code;
364
+ } | {
365
+ key: "blowing_snow_high_slight";
366
+ description: "Slight/moderate blowing snow - generally high (above eye level)";
367
+ code: WMO4677Code;
368
+ } | {
369
+ key: "blowing_snow_high_heavy";
370
+ description: "Heavy blowing snow - generally high (above eye level)";
371
+ code: WMO4677Code;
372
+ } | {
373
+ key: "fog_distant";
374
+ description: "Fog or ice fog at a distance at the time of observation, but not at the station during the preceding hour, extending above the level of the observer";
375
+ code: WMO4677Code;
376
+ } | {
377
+ key: "fog_patches";
378
+ description: "Fog or ice fog in patches";
379
+ code: WMO4677Code;
380
+ } | {
381
+ key: "fog_thinning_sky_visible";
382
+ description: "Fog/ice fog, sky visible, has become thinner during the preceding hour";
383
+ code: WMO4677Code;
384
+ } | {
385
+ key: "fog_thinning_sky_invisible";
386
+ description: "Fog/ice fog, sky invisible, has become thinner during the preceding hour";
387
+ code: WMO4677Code;
388
+ } | {
389
+ key: "fog_no_change_sky_visible";
390
+ description: "Fog or ice fog, sky visible, no appreciable change during the preceding hour";
391
+ code: WMO4677Code;
392
+ } | {
393
+ key: "fog_no_change_sky_invisible";
394
+ description: "Fog or ice fog, sky invisible, no appreciable change during the preceding hour";
395
+ code: WMO4677Code;
396
+ } | {
397
+ key: "fog_thickening_sky_visible";
398
+ description: "Fog or ice fog, sky visible, has begun or has become thicker during the preceding hour";
399
+ code: WMO4677Code;
400
+ } | {
401
+ key: "fog_thickening_sky_invisible";
402
+ description: "Fog or ice fog, sky invisible, has begun or has become thicker during the preceding hour";
403
+ code: WMO4677Code;
404
+ } | {
405
+ key: "fog_rime_sky_visible";
406
+ description: "Fog, depositing rime, sky visible";
407
+ code: WMO4677Code;
408
+ } | {
409
+ key: "fog_rime_sky_invisible";
410
+ description: "Fog, depositing rime, sky invisible";
411
+ code: WMO4677Code;
412
+ } | {
413
+ key: "drizzle_intermittent_slight";
414
+ description: "Drizzle, not freezing, intermittent, slight at time of observation";
415
+ code: WMO4677Code;
416
+ } | {
417
+ key: "drizzle_continuous_slight";
418
+ description: "Drizzle, not freezing, continuous, slight at time of observation";
419
+ code: WMO4677Code;
420
+ } | {
421
+ key: "drizzle_intermittent_moderate";
422
+ description: "Drizzle, not freezing, intermittent, moderate at time of observation";
423
+ code: WMO4677Code;
424
+ } | {
425
+ key: "drizzle_continuous_moderate";
426
+ description: "Drizzle, not freezing, continuous, moderate at time of observation";
427
+ code: WMO4677Code;
428
+ } | {
429
+ key: "drizzle_intermittent_heavy";
430
+ description: "Drizzle, not freezing, intermittent, heavy at time of observation";
431
+ code: WMO4677Code;
432
+ } | {
433
+ key: "drizzle_continuous_heavy";
434
+ description: "Drizzle, not freezing, continuous, heavy at time of observation";
435
+ code: WMO4677Code;
436
+ } | {
437
+ key: "freezing_drizzle_slight";
438
+ description: "Drizzle, freezing, slight";
439
+ code: WMO4677Code;
440
+ } | {
441
+ key: "freezing_drizzle_moderate_heavy";
442
+ description: "Drizzle, freezing, moderate or heavy (dense)";
443
+ code: WMO4677Code;
444
+ } | {
445
+ key: "rain_drizzle_slight";
446
+ description: "Rain and drizzle, slight";
447
+ code: WMO4677Code;
448
+ } | {
449
+ key: "rain_drizzle_moderate_heavy";
450
+ description: "Rain and drizzle, moderate or heavy";
451
+ code: WMO4677Code;
452
+ } | {
453
+ key: "rain_intermittent_slight";
454
+ description: "Rain, not freezing, intermittent, slight at time of observation";
455
+ code: WMO4677Code;
456
+ } | {
457
+ key: "rain_continuous_slight";
458
+ description: "Rain, not freezing, continuous, slight at time of observation";
459
+ code: WMO4677Code;
460
+ } | {
461
+ key: "rain_intermittent_moderate";
462
+ description: "Rain, not freezing, intermittent, moderate at time of observation";
463
+ code: WMO4677Code;
464
+ } | {
465
+ key: "rain_continuous_moderate";
466
+ description: "Rain, not freezing, continuous, moderate at time of observation";
467
+ code: WMO4677Code;
468
+ } | {
469
+ key: "rain_intermittent_heavy";
470
+ description: "Rain, not freezing, intermittent, heavy at time of observation";
471
+ code: WMO4677Code;
472
+ } | {
473
+ key: "rain_continuous_heavy";
474
+ description: "Rain, not freezing, continuous, heavy at time of observation";
475
+ code: WMO4677Code;
476
+ } | {
477
+ key: "freezing_rain_slight";
478
+ description: "Rain, freezing, slight";
479
+ code: WMO4677Code;
480
+ } | {
481
+ key: "freezing_rain_moderate_heavy";
482
+ description: "Rain, freezing, moderate or heavy";
483
+ code: WMO4677Code;
484
+ } | {
485
+ key: "rain_snow_mixed_slight";
486
+ description: "Rain or drizzle and snow, slight";
487
+ code: WMO4677Code;
488
+ } | {
489
+ key: "rain_snow_mixed_moderate_heavy";
490
+ description: "Rain or drizzle and snow, moderate or heavy";
491
+ code: WMO4677Code;
492
+ } | {
493
+ key: "snowflakes_intermittent_slight";
494
+ description: "Intermittent fall of snowflakes, slight at time of observation";
495
+ code: WMO4677Code;
496
+ } | {
497
+ key: "snowflakes_continuous_slight";
498
+ description: "Continuous fall of snowflakes, slight at time of observation";
499
+ code: WMO4677Code;
500
+ } | {
501
+ key: "snowflakes_intermittent_moderate";
502
+ description: "Intermittent fall of snowflakes, moderate at time of observation";
503
+ code: WMO4677Code;
504
+ } | {
505
+ key: "snowflakes_continuous_moderate";
506
+ description: "Continuous fall of snowflakes, moderate at time of observation";
507
+ code: WMO4677Code;
508
+ } | {
509
+ key: "snowflakes_intermittent_heavy";
510
+ description: "Intermittent fall of snowflakes, heavy at time of observation";
511
+ code: WMO4677Code;
512
+ } | {
513
+ key: "snowflakes_continuous_heavy";
514
+ description: "Continuous fall of snowflakes, heavy at time of observation";
515
+ code: WMO4677Code;
516
+ } | {
517
+ key: "diamond_dust";
518
+ description: "Diamond dust (with or without fog)";
519
+ code: WMO4677Code;
520
+ } | {
521
+ key: "snow_grains";
522
+ description: "Snow grains (with or without fog)";
523
+ code: WMO4677Code;
524
+ } | {
525
+ key: "snow_crystals";
526
+ description: "Isolated star-like snow crystals (with or without fog)";
527
+ code: WMO4677Code;
528
+ } | {
529
+ key: "ice_pellets";
530
+ description: "Ice pellets";
531
+ code: WMO4677Code;
532
+ } | {
533
+ key: "rain_showers_slight";
534
+ description: "Rain shower(s), slight";
535
+ code: WMO4677Code;
536
+ } | {
537
+ key: "rain_showers_moderate_heavy";
538
+ description: "Rain shower(s), moderate or heavy";
539
+ code: WMO4677Code;
540
+ } | {
541
+ key: "rain_showers_violent";
542
+ description: "Rain shower(s), violent";
543
+ code: WMO4677Code;
544
+ } | {
545
+ key: "rain_snow_showers_slight";
546
+ description: "Shower(s) of rain and snow, slight";
547
+ code: WMO4677Code;
548
+ } | {
549
+ key: "rain_snow_showers_moderate_heavy";
550
+ description: "Shower(s) of rain and snow, moderate or heavy";
551
+ code: WMO4677Code;
552
+ } | {
553
+ key: "snow_showers_slight";
554
+ description: "Snow shower(s), slight";
555
+ code: WMO4677Code;
556
+ } | {
557
+ key: "snow_showers_moderate_heavy";
558
+ description: "Snow shower(s), moderate or heavy";
559
+ code: WMO4677Code;
560
+ } | {
561
+ key: "snow_pellets_hail_showers_slight";
562
+ description: "Shower(s) of snow pellets or small hail, with or without rain or rain and snow mixed - slight";
563
+ code: WMO4677Code;
564
+ } | {
565
+ key: "snow_pellets_hail_showers_moderate_heavy";
566
+ description: "Shower(s) of snow pellets or small hail, with or without rain or rain and snow mixed - moderate or heavy";
567
+ code: WMO4677Code;
568
+ } | {
569
+ key: "hail_showers_no_thunder_slight";
570
+ description: "Shower(s) of hail, with or without rain or rain and snow mixed, not associated with thunder - slight";
571
+ code: WMO4677Code;
572
+ } | {
573
+ key: "hail_showers_no_thunder_moderate_heavy";
574
+ description: "Shower(s) of hail, with or without rain or rain and snow mixed, not associated with thunder - moderate or heavy";
575
+ code: WMO4677Code;
576
+ } | {
577
+ key: "rain_with_recent_thunderstorm_slight";
578
+ description: "Slight rain at time of observation - thunderstorm during the preceding hour but not at time of observation";
579
+ code: WMO4677Code;
580
+ } | {
581
+ key: "rain_with_recent_thunderstorm_moderate_heavy";
582
+ description: "Moderate or heavy rain at time of observation - thunderstorm during the preceding hour but not at time of observation";
583
+ code: WMO4677Code;
584
+ } | {
585
+ key: "snow_hail_with_recent_thunderstorm_slight";
586
+ description: "Slight snow, or rain and snow mixed or hail at time of observation - thunderstorm during the preceding hour but not at time of observation";
587
+ code: WMO4677Code;
588
+ } | {
589
+ key: "snow_hail_with_recent_thunderstorm_moderate_heavy";
590
+ description: "Moderate or heavy snow, or rain and snow mixed or hail at time of observation - thunderstorm during the preceding hour but not at time of observation";
591
+ code: WMO4677Code;
592
+ } | {
593
+ key: "thunderstorm_slight_moderate_no_hail";
594
+ description: "Thunderstorm, slight or moderate, without hail, but with rain and/or snow at time of observation";
595
+ code: WMO4677Code;
596
+ } | {
597
+ key: "thunderstorm_slight_moderate_with_hail";
598
+ description: "Thunderstorm, slight or moderate, with hail at time of observation";
599
+ code: WMO4677Code;
600
+ } | {
601
+ key: "thunderstorm_heavy_no_hail";
602
+ description: "Thunderstorm, heavy, without hail, but with rain and/or snow at time of observation";
603
+ code: WMO4677Code;
604
+ } | {
605
+ key: "thunderstorm_with_duststorm";
606
+ description: "Thunderstorm combined with dust/sandstorm at time of observation";
607
+ code: WMO4677Code;
608
+ } | {
609
+ key: "thunderstorm_heavy_with_hail";
610
+ description: "Thunderstorm, heavy with hail at time of observation";
611
+ code: WMO4677Code;
612
+ }, 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | "cloud_not_observed" | "cloud_dissolving" | "sky_unchanged" | "cloud_developing" | "smoke_haze_reduced_visibility" | "haze" | "dust_suspension" | "dust_sand_raised_by_wind" | "dust_sand_whirls" | "duststorm_sandstorm" | "mist" | "fog_patches_shallow" | "fog_shallow_continuous" | "lightning_no_thunder" | "precipitation_not_reaching_ground" | "precipitation_distant" | "precipitation_nearby" | "thunderstorm_no_precipitation" | "squalls" | "funnel_clouds" | "drizzle_or_snow_grains_past_hour" | "rain_past_hour" | "snow_past_hour" | "rain_and_snow_past_hour" | "freezing_drizzle_or_rain_past_hour" | "rain_showers_past_hour" | "snow_showers_past_hour" | "hail_showers_past_hour" | "fog_past_hour" | "thunderstorm_past_hour" | "duststorm_decreasing" | "duststorm_no_change" | "duststorm_increasing" | "severe_duststorm_decreasing" | "severe_duststorm_no_change" | "severe_duststorm_increasing" | "drifting_snow_low_slight" | "drifting_snow_low_heavy" | "blowing_snow_high_slight" | "blowing_snow_high_heavy" | "fog_distant" | "fog_patches" | "fog_thinning_sky_visible" | "fog_thinning_sky_invisible" | "fog_no_change_sky_visible" | "fog_no_change_sky_invisible" | "fog_thickening_sky_visible" | "fog_thickening_sky_invisible" | "fog_rime_sky_visible" | "fog_rime_sky_invisible" | "drizzle_intermittent_slight" | "drizzle_continuous_slight" | "drizzle_intermittent_moderate" | "drizzle_continuous_moderate" | "drizzle_intermittent_heavy" | "drizzle_continuous_heavy" | "freezing_drizzle_slight" | "freezing_drizzle_moderate_heavy" | "rain_drizzle_slight" | "rain_drizzle_moderate_heavy" | "rain_intermittent_slight" | "rain_continuous_slight" | "rain_intermittent_moderate" | "rain_continuous_moderate" | "rain_intermittent_heavy" | "rain_continuous_heavy" | "freezing_rain_slight" | "freezing_rain_moderate_heavy" | "rain_snow_mixed_slight" | "rain_snow_mixed_moderate_heavy" | "snowflakes_intermittent_slight" | "snowflakes_continuous_slight" | "snowflakes_intermittent_moderate" | "snowflakes_continuous_moderate" | "snowflakes_intermittent_heavy" | "snowflakes_continuous_heavy" | "diamond_dust" | "snow_grains" | "snow_crystals" | "ice_pellets" | "rain_showers_slight" | "rain_showers_moderate_heavy" | "rain_showers_violent" | "rain_snow_showers_slight" | "rain_snow_showers_moderate_heavy" | "snow_showers_slight" | "snow_showers_moderate_heavy" | "snow_pellets_hail_showers_slight" | "snow_pellets_hail_showers_moderate_heavy" | "hail_showers_no_thunder_slight" | "hail_showers_no_thunder_moderate_heavy" | "rain_with_recent_thunderstorm_slight" | "rain_with_recent_thunderstorm_moderate_heavy" | "snow_hail_with_recent_thunderstorm_slight" | "snow_hail_with_recent_thunderstorm_moderate_heavy" | "thunderstorm_slight_moderate_no_hail" | "thunderstorm_slight_moderate_with_hail" | "thunderstorm_heavy_no_hail" | "thunderstorm_with_duststorm" | "thunderstorm_heavy_with_hail">>;
613
+ export type WMO4677Object = z.infer<typeof WMO4677Schema>;
614
+ export default WMO4677Schema;
@@ -0,0 +1,30 @@
1
+ import z from "zod";
2
+ import { CODE_BY_KEY, HUMAN_KEYS, isValidCode, WMO_4677_SPEC, } from "./spec";
3
+ export const WMO4677_VALIDATION_ERRORS = {
4
+ INTEGER_OUTSIDE_OF_RANGE: "WMO Code outside of range (00-99)",
5
+ STRING_INVALID_FORMAT: "Must be a 1-2 digits numeric string (eg. '05', '73')",
6
+ };
7
+ export const WMO4677NumericFormat = z
8
+ .number()
9
+ .int()
10
+ .refine(isValidCode, {
11
+ message: WMO4677_VALIDATION_ERRORS.INTEGER_OUTSIDE_OF_RANGE,
12
+ });
13
+ export const WMO4677StringFormat = z
14
+ .string()
15
+ .regex(/^\d{1,2}$/, WMO4677_VALIDATION_ERRORS.STRING_INVALID_FORMAT)
16
+ .transform((s) => Number(s))
17
+ .refine(isValidCode, {
18
+ message: WMO4677_VALIDATION_ERRORS.INTEGER_OUTSIDE_OF_RANGE,
19
+ });
20
+ export const WMO4677HumanKeyFormat = z.enum(HUMAN_KEYS);
21
+ export const WMO4677Schema = z
22
+ .union([WMO4677NumericFormat, WMO4677StringFormat, WMO4677HumanKeyFormat])
23
+ .transform((value) => {
24
+ const code = typeof value === "number" ? value : CODE_BY_KEY[value];
25
+ return {
26
+ code,
27
+ ...WMO_4677_SPEC[code],
28
+ };
29
+ });
30
+ export default WMO4677Schema;