Added declarations for 'country-code-lookup 0.0.17' (#44070)

* Added declarations for  'country-code-lookup 0.0.17'

* remove the patch version from header
This commit is contained in:
Felix Schlenkrich 2020-04-27 15:33:40 +02:00 committed by GitHub
parent ce47e1675f
commit 11ec643763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,5 @@
import * as lookup from 'country-code-lookup';
const countryByFip = lookup.byFips('gm');
const countryByIso = lookup.byIso('de');
const countryByName = lookup.byCountry('Germany');

43
types/country-code-lookup/index.d.ts vendored Normal file
View File

@ -0,0 +1,43 @@
// Type definitions for country-code-lookup 0.0
// Project: https://github.com/richorama/country-code-lookup
// Definitions by: Felix Schlenkrich <https://github.com/fastereder>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface CountryCode {
continent: string;
region: string;
country: string;
capital: string;
fips: string;
iso2: string;
iso3: string;
isoNo: string;
internet: string;
}
/**
* @description Find a country by its FIPS 10 code.
* @param code FIPS 10 code
* @return Object containing all the country codes.
*/
export function byFips(code: string): CountryCode;
/**
* @description Find a country by its ISO 3166 code.
* @param code ISO 3166 code
* @return Object containing all the country codes.
*/
export function byIso(code: string | number): CountryCode;
/**
* @description Find a country by its ccTLD code.
* @param code ccTLD6 code
* @return Object containing all the country codes.
*/
export function byInternet(code: string): CountryCode;
/**
* @description Find a country by its country name.
* @param country country name
* @return Object containing all the country codes.
*/
export function byCountry(country: string): CountryCode;
export const countries: CountryCode[];

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"country-code-lookup-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }