Add types for facebook-locales (#36231)

This commit is contained in:
Jarek Radosz 2019-06-28 02:15:38 +02:00 committed by Benjamin Lichtman
parent fe61074c48
commit d200340ecb
4 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,3 @@
import { bestFacebookLocaleFor } from 'facebook-locales';
bestFacebookLocaleFor('en_US'); // $ExpectType string

18
types/facebook-locales/index.d.ts vendored Normal file
View File

@ -0,0 +1,18 @@
// Type definitions for facebook-locales 1.0
// Project: https://github.com/wix/facebook-locales
// Definitions by: Jarek Radosz <https://github.com/CvX>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Maps locales to Facebook locales.
*
* @example
*
* import { bestFacebookLocaleFor } from 'facebook-locales';
*
* bestFacebookLocaleFor('en_US'); //-> 'en_US'
* bestFacebookLocaleFor('fr_FR'); //-> 'fr_FR'
* bestFacebookLocaleFor('es_AR'); //-> 'es_LA'
* bestFacebookLocaleFor('ar_EG'); //-> 'ar_AR'
*/
export function bestFacebookLocaleFor(locale: string): string;

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",
"facebook-locales-tests.ts"
]
}

View File

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