aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorFridon <[email protected]>2022-06-20 00:52:25 +0400
committerFridon <[email protected]>2022-06-20 00:52:25 +0400
commit65261a5ae2ee9c7492b119f1ab1a2a8c19126ef0 (patch)
tree29d2108aad9b60c248c8ddc11f8d861791ea558a /models
downloadcountryfetch-65261a5ae2ee9c7492b119f1ab1a2a8c19126ef0.tar.xz
countryfetch-65261a5ae2ee9c7492b119f1ab1a2a8c19126ef0.zip
initial commit
Diffstat (limited to 'models')
-rw-r--r--models/country.model.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/models/country.model.ts b/models/country.model.ts
new file mode 100644
index 0000000..7fa8de0
--- /dev/null
+++ b/models/country.model.ts
@@ -0,0 +1,18 @@
+// For better currency types, this can be used later:
+// https://github.com/freeall/currency-codes
+export type CurrencyAbbr = string;
+export type CurrencyInfo = { name: string; symbol: string };
+export type LangAbbr = string;
+
+export interface Country {
+ name: {
+ common: string;
+ official: string;
+ // Need type for nativeName later
+ };
+ currencies: Record<CurrencyAbbr, CurrencyInfo>;
+ capital: string[];
+ flag: string;
+ population: number;
+ languages: Record<LangAbbr, string>;
+}