🤖 Merge PR #45971 Update country-data typings by @mikemaccana

Allow currencies to be used by key
Include 'symbol' on currency
Add tests
This commit is contained in:
Mike MacCana 2020-07-09 22:10:20 +01:00 committed by GitHub
parent 68523d9095
commit 67b69fb122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -7,6 +7,7 @@ lib.continents.africa.countries; // $ExpectType ReadonlyArray<Country>
lib.countries.all; // $ExpectType ReadonlyArray<Country>
lib.countries.BY; // $ExpectType Country
lib.currencies.all; // $ExpectType ReadonlyArray<Currency>
lib.currencies.USD; // $ExpectType Currency
lib.languages.all; // $ExpectType ReadonlyArray<Language>
lib.regions.antarctica; // $ExpectType Region
lib.regions.antarctica.countries; // $ExpectType ReadonlyArray<string>

View File

@ -1,6 +1,7 @@
// Type definitions for country-data 0.0
// Project: https://github.com/OpenBookPrices/country-data
// Definitions by: Logan Dam <https://github.com/biltongza>
// Mike MacCana <https://github.com/mikemaccana>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
@ -20,6 +21,7 @@ export interface Currency {
readonly code: string;
readonly decimals: number;
readonly name: string;
readonly symbol: string;
readonly number: number;
}
@ -66,6 +68,8 @@ export const callingCountries: {
};
export const currencies: {
readonly [key: string]: Currency;
} & {
readonly all: ReadonlyArray<Currency>;
};