@sil/data 0.1.8 → 0.1.10
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.
- package/dist/sil-data.cjs +398 -197
- package/dist/sil-data.cjs.map +1 -1
- package/dist/sil-data.js +398 -197
- package/dist/sil-data.js.map +1 -1
- package/dist/types/data/countries.d.ts +5 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/types/index.d.ts +46 -0
- package/package.json +1 -1
|
@@ -16,3 +16,8 @@ export declare function getCountriesByContinent(continent: Country["continent"])
|
|
|
16
16
|
* Get a country's flag emoji by its ISO 3166-1 alpha-2 code.
|
|
17
17
|
*/
|
|
18
18
|
export declare function getCountryFlag(alpha2: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Get all officially recognized sovereign countries.
|
|
21
|
+
* Excludes disputed or unrecognized territories.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getRecognizedCountries(): Country[];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* }));
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
export type { Country, PhoneCountryCode, City, State, StateType, Continent, ContinentName, Currency, CountryGeography, CountryBounds, ClimateZone, FlagInfo, FlagColor, CardinalDirection, WorldMapCountry, WorldMapOptions, WorldMapHighlight, CountryMapOptions, } from "./types/index.js";
|
|
19
|
-
export { countries, getCountryByCode, getCountriesByContinent, getCountryFlag, } from "./data/countries.js";
|
|
18
|
+
export type { Country, PhoneCountryCode, City, State, StateType, Continent, ContinentName, Currency, CountryGeography, CountryBounds, ClimateZone, FlagInfo, FlagColor, CardinalDirection, WorldMapCountry, WorldMapOptions, WorldMapHighlight, ReligionBreakdown, EthnicGroup, CountryDemographics, CountryMapOptions, } from "./types/index.js";
|
|
19
|
+
export { countries, getCountryByCode, getCountriesByContinent, getCountryFlag, getRecognizedCountries, } from "./data/countries.js";
|
|
20
20
|
export { phoneCountryCodes, getPhoneCodeByCountry, getCountriesByPhoneCode, } from "./data/phoneCodes.js";
|
|
21
21
|
export { cities, getCitiesByCountry, getCapitalCity, getCitiesByPopulation, searchCities, } from "./data/cities.js";
|
|
22
22
|
export { states, getStatesByCountry, getStateByCode, getStatesByType, } from "./data/states.js";
|
|
@@ -26,6 +26,12 @@ export interface Country {
|
|
|
26
26
|
languages: string[];
|
|
27
27
|
/** Top-level domain (e.g., ".us") */
|
|
28
28
|
tld?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the country is officially recognized as a sovereign state.
|
|
31
|
+
* `false` for disputed or unrecognized territories (e.g., Kosovo, Nagorno-Karabakh)
|
|
32
|
+
* that use user-assigned ISO codes not endorsed by the UN.
|
|
33
|
+
*/
|
|
34
|
+
recognized: boolean;
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
31
37
|
* Continent names
|
|
@@ -207,6 +213,46 @@ export interface WorldMapOptions {
|
|
|
207
213
|
/** Optional CSS class added to the `<svg>` element. */
|
|
208
214
|
className?: string;
|
|
209
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* A single religion and its approximate share of a country's population.
|
|
218
|
+
*/
|
|
219
|
+
export interface ReligionBreakdown {
|
|
220
|
+
/** Religion name (e.g., "Christianity", "Islam", "Hinduism") */
|
|
221
|
+
name: string;
|
|
222
|
+
/** Percentage of the population (0–100) */
|
|
223
|
+
percentage: number;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* A single ethnic group and its approximate share of a country's population.
|
|
227
|
+
*/
|
|
228
|
+
export interface EthnicGroup {
|
|
229
|
+
/** Ethnic group name (e.g., "Han Chinese", "White", "Mestizo") */
|
|
230
|
+
name: string;
|
|
231
|
+
/** Percentage of the population (0–100) */
|
|
232
|
+
percentage: number;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Demographic data for a country: population, religions, and ethnic makeup.
|
|
236
|
+
* Data is sourced from the CIA World Factbook, Pew Research Center, and UN estimates.
|
|
237
|
+
*/
|
|
238
|
+
export interface CountryDemographics {
|
|
239
|
+
/** ISO 3166-1 alpha-2 code */
|
|
240
|
+
alpha2: string;
|
|
241
|
+
/** Approximate total population */
|
|
242
|
+
population: number;
|
|
243
|
+
/** Year of the population estimate */
|
|
244
|
+
populationYear: number;
|
|
245
|
+
/**
|
|
246
|
+
* Religious breakdown, sorted by percentage descending.
|
|
247
|
+
* Percentages may not sum to exactly 100 due to rounding or "other/unspecified" omissions.
|
|
248
|
+
*/
|
|
249
|
+
religions: ReligionBreakdown[];
|
|
250
|
+
/**
|
|
251
|
+
* Ethnic group breakdown, sorted by percentage descending.
|
|
252
|
+
* Percentages may not sum to exactly 100 due to rounding or "other/unspecified" omissions.
|
|
253
|
+
*/
|
|
254
|
+
ethnicGroups: EthnicGroup[];
|
|
255
|
+
}
|
|
210
256
|
/**
|
|
211
257
|
* Describes a highlighted country on the world map.
|
|
212
258
|
*/
|
package/package.json
CHANGED