import type { EnsureTrainedDataOptions, TesseractDocumentApi, TesseractConstructor, TesseractInitOptions, TrainingDataDownloadProgress } from "./types"; export type { ConfigurationVariables, DebugConfigurationVariableNames, DebugOnlyConfigurationVariables, DetectOrientationScriptResult, EnsureTrainedDataOptions, InitOnlyConfigurationVariables, ProgressChangedInfo, SetBoolConfigurationVariableNames, SetConfigurationVariableNames, SetNumberConfigurationVariableNames, SetStringConfigurationVariableNames, SetVariableConfigVariables, TesseractBeginProcessPagesOptions, TesseractConstructor, TesseractDocumentApi, TesseractInitOptions, TesseractInstance, TesseractProcessPagesStatus, TesseractSetRectangleOptions, TrainingDataDownloadProgress, } from "./types"; export type NativeTesseract = import("./types").TesseractInstance; /** * All available languages for tesseract * @readonly * @enum {string} */ export declare const Language: { readonly afr: "afr"; readonly amh: "amh"; readonly ara: "ara"; readonly asm: "asm"; readonly aze: "aze"; readonly aze_cyrl: "aze_cyrl"; readonly bel: "bel"; readonly ben: "ben"; readonly bod: "bod"; readonly bos: "bos"; readonly bre: "bre"; readonly bul: "bul"; readonly cat: "cat"; readonly ceb: "ceb"; readonly ces: "ces"; readonly chi_sim: "chi_sim"; readonly chi_tra: "chi_tra"; readonly chr: "chr"; readonly cos: "cos"; readonly cym: "cym"; readonly dan: "dan"; readonly deu: "deu"; readonly deu_latf: "deu_latf"; readonly div: "div"; readonly dzo: "dzo"; readonly ell: "ell"; readonly eng: "eng"; readonly enm: "enm"; readonly epo: "epo"; readonly equ: "equ"; readonly est: "est"; readonly eus: "eus"; readonly fao: "fao"; readonly fas: "fas"; readonly fil: "fil"; readonly fin: "fin"; readonly fra: "fra"; readonly frm: "frm"; readonly fry: "fry"; readonly gla: "gla"; readonly gle: "gle"; readonly glg: "glg"; readonly grc: "grc"; readonly guj: "guj"; readonly hat: "hat"; readonly heb: "heb"; readonly hin: "hin"; readonly hrv: "hrv"; readonly hun: "hun"; readonly hye: "hye"; readonly iku: "iku"; readonly ind: "ind"; readonly isl: "isl"; readonly ita: "ita"; readonly ita_old: "ita_old"; readonly jav: "jav"; readonly jpn: "jpn"; readonly kan: "kan"; readonly kat: "kat"; readonly kat_old: "kat_old"; readonly kaz: "kaz"; readonly khm: "khm"; readonly kir: "kir"; readonly kmr: "kmr"; readonly kor: "kor"; readonly kor_vert: "kor_vert"; readonly kur: "kur"; readonly lao: "lao"; readonly lat: "lat"; readonly lav: "lav"; readonly lit: "lit"; readonly ltz: "ltz"; readonly mal: "mal"; readonly mar: "mar"; readonly mkd: "mkd"; readonly mlt: "mlt"; readonly mon: "mon"; readonly mri: "mri"; readonly msa: "msa"; readonly mya: "mya"; readonly nep: "nep"; readonly nld: "nld"; readonly nor: "nor"; readonly oci: "oci"; readonly ori: "ori"; readonly osd: "osd"; readonly pan: "pan"; readonly pol: "pol"; readonly por: "por"; readonly pus: "pus"; readonly que: "que"; readonly ron: "ron"; readonly rus: "rus"; readonly san: "san"; readonly sin: "sin"; readonly slk: "slk"; readonly slv: "slv"; readonly snd: "snd"; readonly spa: "spa"; readonly spa_old: "spa_old"; readonly sqi: "sqi"; readonly srp: "srp"; readonly srp_latn: "srp_latn"; readonly sun: "sun"; readonly swa: "swa"; readonly swe: "swe"; readonly syr: "syr"; readonly tam: "tam"; readonly tat: "tat"; readonly tel: "tel"; readonly tgk: "tgk"; readonly tha: "tha"; readonly tir: "tir"; readonly ton: "ton"; readonly tur: "tur"; readonly uig: "uig"; readonly ukr: "ukr"; readonly urd: "urd"; readonly uzb: "uzb"; readonly uzb_cyrl: "uzb_cyrl"; readonly vie: "vie"; readonly yid: "yid"; readonly yor: "yor"; }; export type Language = (typeof Language)[keyof typeof Language]; /** * When Tesseract/Cube is initialized we can choose to instantiate/load/run * only the Tesseract part, only the Cube part or both along with the combiner. * The preference of which engine to use is stored in tessedit_ocr_engine_mode. * @readonly * @enum {number} */ export declare const OcrEngineModes: { /** * Run Tesseract only - fastest * @deprecated * @type {number} */ readonly OEM_TESSERACT_ONLY: 0; /** * Run just the LSTM line recognizer. * @type {nmumber} */ readonly OEM_LSTM_ONLY: 1; /** * Run the LSTM recognizer, but allow fallback * to Tesseract when things get difficult. * @deprecated * @type {number} */ readonly OEM_TESSERACT_LSTM_COMBINED: 2; /** * Specify this mode when calling init(), * to indicate that any of the above modes * should be automatically inferred from the * variables in the language-specific config, * command-line configs, or if not specified * in any of the above should be set to the * default OEM_TESSERACT_ONLY. * @type {number} * @default */ readonly OEM_DEFAULT: 3; }; export type OcrEngineMode = (typeof OcrEngineModes)[keyof typeof OcrEngineModes]; /** * Possible modes for page layout analysis. * @readonly * @enum {number} */ export declare const PageSegmentationModes: { readonly PSM_OSD_ONLY: 0; readonly PSM_AUTO_OSD: 1; readonly PSM_AUTO_ONLY: 2; readonly PSM_AUTO: 3; readonly PSM_SINGLE_COLUMN: 4; readonly PSM_SINGLE_BLOCK_VERT_TEXT: 5; readonly PSM_SINGLE_BLOCK: 6; readonly PSM_SINGLE_LINE: 7; readonly PSM_SINGLE_WORD: 8; readonly PSM_CIRCLE_WORD: 9; readonly PSM_SINGLE_CHAR: 10; readonly PSM_SPARSE_TEXT: 11; readonly PSM_SPARSE_TEXT_OSD: 12; readonly PSM_RAW_LINE: 13; }; export type PageSegmentationMode = (typeof PageSegmentationModes)[keyof typeof PageSegmentationModes]; export declare const LogLevels: { readonly ALL: "-2147483648"; readonly TRACE: "5000"; readonly DEBUG: "10000"; readonly INFO: "20000"; readonly WARN: "30000"; readonly ERROR: "40000"; readonly FATAL: "50000"; readonly OFF: "2147483647"; }; export type LogLevel = (typeof LogLevels)[keyof typeof LogLevels]; declare const NativeTesseract: TesseractConstructor; declare class Tesseract extends NativeTesseract { document: TesseractDocumentApi; constructor(); init(options?: TesseractInitOptions): Promise; ensureTrainingData({ lang, dataPath, cachePath, downloadBaseUrl }: EnsureTrainedDataOptions, progressCallback?: (info: TrainingDataDownloadProgress) => void): Promise; } export { Tesseract, NativeTesseract }; export default Tesseract;