mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Typings for expo-localization
This commit is contained in:
parent
7500ae4609
commit
4e88afacba
6
types/expo-localization/expo-localization-tests.ts
Normal file
6
types/expo-localization/expo-localization-tests.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { Localization } from "expo-localization";
|
||||
|
||||
Localization.getLocalizationAsync().then(localization => {
|
||||
localization.locale
|
||||
});
|
||||
Localization.locale;
|
||||
73
types/expo-localization/index.d.ts
vendored
Normal file
73
types/expo-localization/index.d.ts
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
// Type definitions for expo-localization 1.0
|
||||
// Project: https://docs.expo.io/
|
||||
// Definitions by: burtek <https://github.com/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<LocalizationProps>;
|
||||
}
|
||||
22
types/expo-localization/tsconfig.json
Normal file
22
types/expo-localization/tsconfig.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
1
types/expo-localization/tslint.json
Normal file
1
types/expo-localization/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@ -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 <https://github.com/sroy3>
|
||||
// Bartosz Dotryw <https://github.com/burtek>
|
||||
// burtek <https://github.com/burtek>
|
||||
// David Kevork <https://github.com/davidkevork>
|
||||
// Joshua R. <https://github.com/JoshuaScript>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Loading…
Reference in New Issue
Block a user