forked from zoontek/react-native-localize
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
60 lines (52 loc) · 1.78 KB
/
index.d.ts
File metadata and controls
60 lines (52 loc) · 1.78 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
declare module "react-native-localize" {
export 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;
readonly scriptCode?: string;
readonly countryCode: string;
readonly languageTag: string;
readonly isRTL: boolean;
};
export type NumberFormatSettings = {
decimalSeparator: string;
groupingSeparator: string;
};
export type LocalizationConstants = {
calendar: Calendar;
country: string;
currencies: string[];
locales: Locale[];
numberFormatSettings: NumberFormatSettings;
temperatureUnit: TemperatureUnit;
timeZone: string;
uses24HourClock: boolean;
usesMetricSystem: boolean;
usesAutoDateAndTime: Option<boolean>;
usesAutoTimeZone: Option<boolean>;
};
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 } | void;
}