forked from zoontek/react-native-localize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
46 lines (39 loc) · 1.37 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
declare module "react-native-localize" {
type Option<T> = T | undefined;
export type Calendar = "gregorian" | "japanese" | "buddhist";
export type LocalizationEvent = "change";
export type TemperatureUnit = "celsius" | "fahrenheit";
export type Locale = Readonly<{
languageCode: string;
scriptCode?: string;
countryCode: string;
languageTag: string;
isRTL: boolean;
}>;
export type NumberFormatSettings = Readonly<{
decimalSeparator: string;
groupingSeparator: string;
}>;
export function getCalendar(): Calendar;
export function getCountry(): string;
export function getCurrencies(): string[];
export function getLocales(): Locale[];
export function getNumberFormatSettings(): NumberFormatSettings;
export function getTemperatureUnit(): TemperatureUnit;
export function getTimeZone(): string;
export function uses24HourClock(): boolean;
export function usesMetricSystem(): boolean;
export function usesAutoDateAndTime(): Option<boolean>;
export function usesAutoTimeZone(): Option<boolean>;
export function addEventListener(
type: LocalizationEvent,
handler: Function,
): void;
export function removeEventListener(
type: LocalizationEvent,
handler: Function,
): void;
export function findBestAvailableLanguage<T extends string>(
languageTags: T[],
): { languageTag: T; isRTL: boolean } | undefined;
}