aboutsummaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
authorPridon Tetradze <[email protected]>2022-06-26 13:46:59 +0400
committerGitHub <[email protected]>2022-06-26 13:46:59 +0400
commit2e058526d896ab4ee5173ceb80d1248ac08ff594 (patch)
tree9550b812ea66f069396fef043cff1d10aeaec859 /src/models
parent8626e2d8e258e11837d27a1e99ef3277e7dfdf3b (diff)
downloadcountryfetch-2e058526d896ab4ee5173ceb80d1248ac08ff594.tar.xz
countryfetch-2e058526d896ab4ee5173ceb80d1248ac08ff594.zip
Flag ASCII art, remove tabularization & refactor (#3)
* initial flag image converter * add flags caching * refactor, remove tabularization, make flag ASCII optional. * update readme * update readme
Diffstat (limited to 'src/models')
-rw-r--r--src/models/country.model.ts3
-rw-r--r--src/models/fetched-country.model.ts (renamed from src/models/FetchedCountry.model.ts)0
-rw-r--r--src/models/flag-ascii.model.ts4
3 files changed, 7 insertions, 0 deletions
diff --git a/src/models/country.model.ts b/src/models/country.model.ts
index 61e0dfc..3ebe2b4 100644
--- a/src/models/country.model.ts
+++ b/src/models/country.model.ts
@@ -4,6 +4,8 @@
type CurrencyAbbr = string;
type CurrencyInfo = { name: string; symbol: string };
type LangAbbr = string;
+type ImageFormat = "png" | "svg";
+type Flags = Record<ImageFormat, string>;
export type Currencies = Record<CurrencyAbbr, CurrencyInfo>;
export type Languages = Record<LangAbbr, string>;
@@ -35,4 +37,5 @@ export interface Country {
latlng: number[];
};
tld: string[];
+ flags: Flags;
}
diff --git a/src/models/FetchedCountry.model.ts b/src/models/fetched-country.model.ts
index a53482e..a53482e 100644
--- a/src/models/FetchedCountry.model.ts
+++ b/src/models/fetched-country.model.ts
diff --git a/src/models/flag-ascii.model.ts b/src/models/flag-ascii.model.ts
new file mode 100644
index 0000000..d11c9d1
--- /dev/null
+++ b/src/models/flag-ascii.model.ts
@@ -0,0 +1,4 @@
+export interface FlagAscii {
+ countryName: string;
+ flagString: string[];
+}