-
-
Notifications
You must be signed in to change notification settings - Fork 172
/
index.js
62 lines (58 loc) · 2.02 KB
/
index.js
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
61
62
import { useEffect } from "react";
import { NativeModules, DeviceEventEmitter } from "react-native";
export const LANG_AFRIKAANS = "afr";
export const LANG_AMHARIC = "amh";
export const LANG_ARABIC = "ara";
export const LANG_ASSAMESE = "asm";
export const LANG_AZERBAIJANI = "aze";
export const LANG_BELARUSIAN = "bel";
export const LANG_BOSNIAN = "bos";
export const LANG_BULGARIAN = "bul";
export const LANG_CHINESE_SIMPLIFIED = "chi_sim";
export const LANG_CHINESE_TRADITIONAL = "chi_tra";
export const LANG_CROATIAN = "hrv";
export const LANG_CUSTOM = "custom";
export const LANG_DANISH = "dan";
export const LANG_ENGLISH = "eng";
export const LANG_ESTONIAN = "est";
export const LANG_FRENCH = "fra";
export const LANG_GALICIAN = "glg";
export const LANG_GERMAN = "deu";
export const LANG_HEBREW = "heb";
export const LANG_HUNGARIAN = "hun";
export const LANG_ICELANDIC = "isl";
export const LANG_INDONESIAN = "ind";
export const LANG_IRISH = "gle";
export const LANG_ITALIAN = "ita";
export const LANG_JAPANESE = "jpn";
export const LANG_KOREAN = "kor";
export const LANG_LATIN = "lat";
export const LANG_LITHUANIAN = "lit";
export const LANG_NEPALI = "nep";
export const LANG_NORWEGIAN = "nor";
export const LANG_PERSIAN = "fas";
export const LANG_POLISH = "pol";
export const LANG_PORTUGUESE = "por";
export const LANG_RUSSIAN = "rus";
export const LANG_SERBIAN = "srp";
export const LANG_SLOVAK = "slk";
export const LANG_SPANISH = "spa";
export const LANG_SWEDISH = "swe";
export const LANG_TURKISH = "tur";
export const LANG_UKRAINIAN = "ukr";
export const LANG_VIETNAMESE = "vie";
export const LEVEL_BLOCK = "block";
export const LEVEL_LINE = "line";
export const LEVEL_PARAGRAPH = "paragraph";
export const LEVEL_SYMBOL = "symbol";
export const LEVEL_WORD = "word";
export function useEventListener(eventType, listener) {
useEffect(() => {
const subscription = DeviceEventEmitter.addListener(eventType, listener);
return () => {
subscription.remove();
};
});
}
const { TesseractOcr } = NativeModules;
export default TesseractOcr;