diff --git a/types/expo-localization/expo-localization-tests.ts b/types/expo-localization/expo-localization-tests.ts new file mode 100644 index 0000000000..0bf0756855 --- /dev/null +++ b/types/expo-localization/expo-localization-tests.ts @@ -0,0 +1,6 @@ +import { Localization } from "expo-localization"; + +Localization.getLocalizationAsync().then(localization => { + localization.locale +}); +Localization.locale; \ No newline at end of file diff --git a/types/expo-localization/index.d.ts b/types/expo-localization/index.d.ts new file mode 100644 index 0000000000..453be2b388 --- /dev/null +++ b/types/expo-localization/index.d.ts @@ -0,0 +1,73 @@ +// Type definitions for expo-localization 1.0 +// Project: https://docs.expo.io/ +// Definitions by: burtek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface LocalizationProps { + /** + * Native device language, returned in standard format. ex: `en-US`, `es-US` + */ + locale: string; + + /** + * List of all the native languages provided by the user settings. These are returned in the order the user defines in their native settings + */ + locales: string[]; + + /** + * Country code for your device + */ + country: string | undefined; + + /** + * A list of all the supported ISO codes + */ + isoCurrencyCodes: string[] | undefined; + + /** + * The current time zone in display format. ex: `America/Los_Angeles` + */ + timezone: string; + + /** + * This will return `true` if the current language is Right-to-Left + */ + isRTL: boolean; +} + +export class Localization { + /** + * Native device language, returned in standard format. ex: `en-US`, `es-US` + */ + static locale: string; + + /** + * List of all the native languages provided by the user settings. These are returned in the order the user defines in their native settings + */ + static locales: string[]; + + /** + * Country code for your device + */ + static country: string | undefined; + + /** + * A list of all the supported ISO codes + */ + static isoCurrencyCodes: string[] | undefined; + + /** + * The current time zone in display format. ex: `America/Los_Angeles` + */ + static timezone: string; + + /** + * This will return `true` if the current language is Right-to-Left + */ + static isRTL: boolean; + + /** + * Android only, on iOS changing the locale settings will cause all the apps to reset + */ + static getLocalizationAsync(): Promise; +} diff --git a/types/expo-localization/tsconfig.json b/types/expo-localization/tsconfig.json new file mode 100644 index 0000000000..76ed37a779 --- /dev/null +++ b/types/expo-localization/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "expo-localization-tests.ts" + ] +} diff --git a/types/expo-localization/tslint.json b/types/expo-localization/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/expo-localization/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-infinite-scroll-component/index.d.ts b/types/react-infinite-scroll-component/index.d.ts index 4380c2f11a..d7fdc11ddc 100644 --- a/types/react-infinite-scroll-component/index.d.ts +++ b/types/react-infinite-scroll-component/index.d.ts @@ -1,7 +1,7 @@ // Type definitions for react-infinite-scroll-component 4.2 // Project: https://github.com/ankeetmaini/react-infinite-scroll-component#readme // Definitions by: Stephanie Roy -// Bartosz Dotryw +// burtek // David Kevork // Joshua R. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped