mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
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:
parent
ce47e1675f
commit
11ec643763
5
types/country-code-lookup/country-code-lookup-tests.ts
Normal file
5
types/country-code-lookup/country-code-lookup-tests.ts
Normal 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
43
types/country-code-lookup/index.d.ts
vendored
Normal 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[];
|
||||
23
types/country-code-lookup/tsconfig.json
Normal file
23
types/country-code-lookup/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/country-code-lookup/tslint.json
Normal file
1
types/country-code-lookup/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user