diff --git a/types/ex-react-native-i18n/ex-react-native-i18n-tests.ts b/types/ex-react-native-i18n/ex-react-native-i18n-tests.ts new file mode 100644 index 0000000000..c83c4b60d3 --- /dev/null +++ b/types/ex-react-native-i18n/ex-react-native-i18n-tests.ts @@ -0,0 +1,8 @@ +import I18n from 'ex-react-native-i18n'; + +I18n.defaultLocale = 'en'; +I18n.fallbacks = true; +I18n.translations = {}; +I18n.locale = 'zh'; + +const deviceLocale: string = I18n.locale; diff --git a/types/ex-react-native-i18n/index.d.ts b/types/ex-react-native-i18n/index.d.ts new file mode 100644 index 0000000000..0b83b06a68 --- /dev/null +++ b/types/ex-react-native-i18n/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for ex-react-native-i18n 0.0 +// Project: https://github.com/xcarpentier/ex-react-native-i18n/ +// Definitions by: LikKee Richie +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Actual version for ex-react-native-i18n is 0.0.4 but 'npm run lint' doesn't allow patch version to pass +import I18n = require("i18n-js"); +// import I18n from 'ex-react-native-i18n'; + +export default I18n; diff --git a/types/ex-react-native-i18n/tsconfig.json b/types/ex-react-native-i18n/tsconfig.json new file mode 100644 index 0000000000..8e6dd691bf --- /dev/null +++ b/types/ex-react-native-i18n/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ex-react-native-i18n-tests.ts" + ] +} diff --git a/types/ex-react-native-i18n/tslint.json b/types/ex-react-native-i18n/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ex-react-native-i18n/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }