-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
98 lines (86 loc) · 1.72 KB
/
types.ts
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
export interface Coordinates {
lon: number,
lat: number,
}
interface Main {
temp: number,
["feels_like"]: number,
["temp_min"]: number,
["temp_max"]: number,
pressure: number,
humidity: number,
["sea_level"]?: number,
["ground_level"]?: number,
["temp_kf"]: number,
}
interface Weatherinterface {
id: number,
main: string,
description: string,
icon: string,
}
interface Wind {
speed: number,
deg: number,
gust?: number,
}
interface Clouds {
all: number,
}
interface Rain {
[key: string]: string,
}
interface City {
id: number,
name: string,
coord: Coordinates,
country: string,
population: number,
timezone: number,
sunrise: number,
sunset: number,
}
export interface WeatherForecast {
weather: Weatherinterface[];
main: Main;
visibility: number;
wind: Wind;
clouds: Clouds;
dt: number;
rain?: Rain;
dt_txt?: string;
}
export interface CurrentWeatherForecast extends WeatherForecast {
coord: Coordinates;
base: string;
sys: { interface: number, id: number, country: string, sunrise: number, sunset: number };
timezone: number;
id: number;
name: string;
cod: number;
}
export interface HourForecast extends WeatherForecast {
["dt_txt"]: string,
sys: { pod: string },
pop: number,
}
export interface HourlyWeatherForecast {
cod: string,
message: number,
cnt: number,
list: HourForecast[],
city: City,
}
// Zip code state returns the zipcode itself, a function to change the zipcode, and a boolean stating if the zipcode is valid or not
export interface ZipCodeState {
zipcode: string;
setZipcode: Function;
valid: boolean;
}
export interface FetchOptions {
appid: string,
units: string,
zip?: string,
lat?: number,
lon?: number,
}