import type { Language, LogLevel, OcrEngineMode, PageSegmentationMode } from "./index"; export type ConfigurationVariables = { log_level: `${LogLevel}`; textord_dotmatrix_gap: `${number}`; textord_debug_block: `${0 | 1}`; textord_pitch_range: `${number}`; textord_words_veto_power: `${number}`; textord_tabfind_show_strokewidths: `${0 | 1}`; pitsync_linear_version: `${number}`; oldbl_holed_losscount: `${number}`; textord_skewsmooth_offset: `${number}`; textord_skewsmooth_offset2: `${0 | 1}`; textord_test_x: `${number}`; textord_test_y: `${number}`; textord_min_blobs_in_row: `${number}`; textord_spline_minblobs: `${number}`; textord_spline_medianwin: `${number}`; textord_max_blob_overlaps: `${number}`; textord_min_xheight: `${number}`; textord_lms_line_trials: `${number}`; textord_tabfind_show_images: `${0 | 1}`; textord_fp_chop_error: `${number}`; edges_max_children_per_outline: `${number}`; edges_max_children_layers: `${number}`; edges_children_per_grandchild: `${number}`; edges_children_count_limit: `${number}`; edges_min_nonhole: `${number}`; edges_patharea_ratio: `${number}`; devanagari_split_debuglevel: `${0 | 1}`; textord_tabfind_show_partitions: `${0 | 1}`; textord_debug_tabfind: `${0 | 1}`; textord_debug_bugs: `${0 | 1}`; textord_testregion_left: `${number}`; textord_testregion_top: `${number}`; textord_testregion_right: `${number}`; textord_testregion_bottom: `${number}`; classify_num_cp_levels: `${number}`; editor_image_xpos: `${number}`; editor_image_ypos: `${number}`; editor_image_menuheight: `${number}`; editor_image_blob_bb_color: `${number}`; editor_word_ypos: `${number}`; editor_word_width: `${number}`; curl_timeout: `${0 | 1}`; wordrec_display_all_blobs: `${0 | 1}`; wordrec_blob_pause: `${0 | 1}`; textord_force_make_prop_words: `${0 | 1}`; textord_chopper_test: `${0 | 1}`; textord_restore_underlines: `${0 | 1}`; textord_show_initial_words: `${0 | 1}`; textord_blocksall_fixed: `${0 | 1}`; textord_blocksall_prop: `${0 | 1}`; textord_pitch_scalebigwords: `${0 | 1}`; textord_debug_pitch_test: `${0 | 1}`; textord_disable_pitch_test: `${0 | 1}`; textord_fast_pitch_test: `${0 | 1}`; textord_debug_pitch_metric: `${0 | 1}`; textord_show_row_cuts: `${0 | 1}`; textord_show_page_cuts: `${0 | 1}`; textord_blockndoc_fixed: `${0 | 1}`; textord_show_tables: `${0 | 1}`; textord_tablefind_show_mark: `${0 | 1}`; textord_tablefind_show_stats: `${0 | 1}`; textord_tablefind_recognize_tables: `${0 | 1}`; textord_tabfind_show_initialtabs: `${0 | 1}`; textord_tabfind_show_finaltabs: `${0 | 1}`; textord_tabfind_only_strokewidths: `${0 | 1}`; textord_really_old_xheight: `${0 | 1}`; textord_oldbl_debug: `${0 | 1}`; textord_debug_baselines: `${0 | 1}`; textord_oldbl_paradef: `${0 | 1}`; textord_oldbl_split_splines: `${0 | 1}`; textord_oldbl_merge_parts: `${0 | 1}`; oldbl_corrfix: `${0 | 1}`; oldbl_xhfix: `${0 | 1}`; textord_ocropus_mode: `${0 | 1}`; textord_heavy_nr: `${0 | 1}`; textord_show_initial_rows: `${0 | 1}`; textord_show_parallel_rows: `${0 | 1}`; textord_show_expanded_rows: `${0 | 1}`; textord_show_final_rows: `${0 | 1}`; textord_show_final_blobs: `${0 | 1}`; textord_test_landscape: `${0 | 1}`; textord_parallel_baselines: `${0 | 1}`; textord_straight_baselines: `${0 | 1}`; textord_old_baselines: `${0 | 1}`; textord_old_xheight: `${0 | 1}`; textord_fix_xheight_bug: `${0 | 1}`; textord_fix_makerow_bug: `${0 | 1}`; textord_debug_xheights: `${0 | 1}`; textord_biased_skewcalc: `${0 | 1}`; textord_interpolating_skew: `${0 | 1}`; textord_new_initial_xheight: `${0 | 1}`; textord_debug_blob: `${0 | 1}`; gapmap_debug: `${0 | 1}`; gapmap_use_ends: `${0 | 1}`; gapmap_no_isolated_quanta: `${0 | 1}`; edges_use_new_outline_complexity: `${0 | 1}`; edges_debug: `${0 | 1}`; edges_children_fix: `${0 | 1}`; textord_show_fixed_cuts: `${0 | 1}`; devanagari_split_debugimage: `${0 | 1}`; textord_tabfind_show_initial_partitions: `${0 | 1}`; textord_tabfind_show_reject_blobs: `${0 | 1}`; textord_tabfind_show_columns: `${0 | 1}`; textord_tabfind_show_blocks: `${0 | 1}`; textord_tabfind_find_tables: `${0 | 1}`; textord_space_size_is_variable: `${0 | 1}`; textord_debug_printable: `${0 | 1}`; wordrec_display_splits: `${0 | 1}`; poly_debug: `${0 | 1}`; poly_wide_objects_better: `${0 | 1}`; equationdetect_save_bi_image: `${0 | 1}`; equationdetect_save_spt_image: `${0 | 1}`; equationdetect_save_seed_image: `${0 | 1}`; equationdetect_save_merged_image: `${0 | 1}`; debug_file: `${string}`; editor_word_name: `${string}`; dotproduct: `${string}`; document_title: `${string}`; curl_cookiefile: `${string}`; classify_font_name: `${string}`; textord_underline_offset: `${number}`; textord_wordstats_smooth_factor: `${number}`; textord_words_maxspace: `${number}`; textord_words_default_maxspace: `${number}`; textord_words_default_minspace: `${number}`; textord_words_min_minspace: `${number}`; textord_words_default_nonspace: `${number}`; textord_words_initial_lower: `${number}`; textord_words_initial_upper: `${number}`; textord_words_minlarge: `${number}`; textord_words_pitchsd_threshold: `${number}`; textord_words_def_fixed: `${number}`; textord_words_def_prop: `${number}`; textord_pitch_rowsimilarity: `${number}`; words_initial_lower: `${number}`; words_initial_upper: `${number}`; words_default_prop_nonspace: `${number}`; words_default_fixed_space: `${number}`; words_default_fixed_limit: `${number}`; textord_words_definite_spread: `${number}`; textord_spacesize_ratioprop: `${number}`; textord_fpiqr_ratio: `${number}`; textord_max_pitch_iqr: `${number}`; textord_projection_scale: `${number}`; textord_balance_factor: `${0 | 1}`; textord_tabvector_vertical_gap_fraction: `${number}`; textord_tabvector_vertical_box_ratio: `${number}`; pitsync_joined_edge: `${number}`; pitsync_offset_freecut_fraction: `${number}`; oldbl_xhfract: `${number}`; oldbl_dot_error_size: `${number}`; textord_oldbl_jumplimit: `${number}`; textord_spline_shift_fraction: `${number}`; textord_skew_ile: `${number}`; textord_skew_lag: `${number}`; textord_linespace_iqrlimit: `${number}`; textord_width_limit: `${number}`; textord_chop_width: `${number}`; textord_expansion_factor: `${0 | 1}`; textord_overlap_x: `${number}`; textord_minxh: `${number}`; textord_min_linesize: `${number}`; textord_excess_blobsize: `${number}`; textord_occupancy_threshold: `${number}`; textord_underline_width: `${number}`; textord_min_blob_height_fraction: `${number}`; textord_xheight_mode_fraction: `${number}`; textord_ascheight_mode_fraction: `${number}`; textord_descheight_mode_fraction: `${number}`; textord_ascx_ratio_min: `${number}`; textord_ascx_ratio_max: `${number}`; textord_descx_ratio_min: `${number}`; textord_descx_ratio_max: `${number}`; textord_xheight_error_margin: `${number}`; gapmap_big_gaps: `${number}`; edges_childarea: `${number}`; edges_boxarea: `${number}`; textord_underline_threshold: `${number}`; classify_pico_feature_length: `${number}`; classify_norm_adj_midpoint: `${number}`; classify_norm_adj_curl: `${number}`; classify_min_slope: `${number}`; classify_max_slope: `${number}`; classify_cp_angle_pad_loose: `${number}`; classify_cp_angle_pad_medium: `${number}`; classify_cp_angle_pad_tight: `${number}`; classify_cp_end_pad_loose: `${number}`; classify_cp_end_pad_medium: `${number}`; classify_cp_end_pad_tight: `${number}`; classify_cp_side_pad_loose: `${number}`; classify_cp_side_pad_medium: `${number}`; classify_cp_side_pad_tight: `${number}`; classify_pp_angle_pad: `${number}`; classify_pp_end_pad: `${number}`; classify_pp_side_pad: `${number}`; ambigs_debug_level: `${0 | 1}`; classify_debug_level: `${0 | 1}`; classify_norm_method: `${0 | 1}`; matcher_debug_level: `${0 | 1}`; matcher_debug_flags: `${0 | 1}`; classify_learning_debug_level: `${0 | 1}`; matcher_permanent_classes_min: `${0 | 1}`; matcher_min_examples_for_prototyping: `${number}`; matcher_sufficient_examples_for_prototyping: `${number}`; classify_adapt_proto_threshold: `${number}`; classify_adapt_feature_threshold: `${number}`; classify_class_pruner_threshold: `${number}`; classify_class_pruner_multiplier: `${number}`; classify_cp_cutoff_strength: `${number}`; classify_integer_matcher_multiplier: `${number}`; dawg_debug_level: `${0 | 1}`; hyphen_debug_level: `${0 | 1}`; stopper_smallword_size: `${number}`; stopper_debug_level: `${0 | 1}`; tessedit_truncate_wordchoice_log: `${number}`; max_permuter_attempts: `${number}`; repair_unchopped_blobs: `${0 | 1}`; chop_debug: `${0 | 1}`; chop_split_length: `${number}`; chop_same_distance: `${number}`; chop_min_outline_points: `${number}`; chop_seam_pile_size: `${number}`; chop_inside_angle: `${number}`; chop_min_outline_area: `${number}`; chop_centered_maxwidth: `${number}`; chop_x_y_weight: `${number}`; wordrec_debug_level: `${0 | 1}`; wordrec_max_join_chunks: `${number}`; segsearch_debug_level: `${0 | 1}`; segsearch_max_pain_points: `${number}`; segsearch_max_futile_classifications: `${number}`; language_model_debug_level: `${0 | 1}`; language_model_ngram_order: `${number}`; language_model_viterbi_list_max_num_prunable: `${number}`; language_model_viterbi_list_max_size: `${number}`; language_model_min_compound_length: `${number}`; wordrec_display_segmentations: `${0 | 1}`; tessedit_pageseg_mode: `${number}`; thresholding_method: `${0 | 1}`; tessedit_ocr_engine_mode: `${number}`; pageseg_devanagari_split_strategy: `${0 | 1}`; ocr_devanagari_split_strategy: `${0 | 1}`; bidi_debug: `${0 | 1}`; applybox_debug: `${0 | 1}`; applybox_page: `${0 | 1}`; tessedit_font_id: `${0 | 1}`; tessedit_bigram_debug: `${0 | 1}`; debug_noise_removal: `${0 | 1}`; noise_maxperblob: `${number}`; noise_maxperword: `${number}`; debug_x_ht_level: `${0 | 1}`; quality_min_initial_alphas_reqd: `${number}`; tessedit_tess_adaption_mode: `${number}`; multilang_debug_level: `${0 | 1}`; paragraph_debug_level: `${0 | 1}`; tessedit_preserve_min_wd_len: `${number}`; crunch_rating_max: `${number}`; crunch_pot_indicators: `${0 | 1}`; crunch_leave_lc_strings: `${number}`; crunch_leave_uc_strings: `${number}`; crunch_long_repetitions: `${number}`; crunch_debug: `${0 | 1}`; fixsp_non_noise_limit: `${0 | 1}`; fixsp_done_mode: `${0 | 1}`; debug_fix_space_level: `${0 | 1}`; x_ht_acceptance_tolerance: `${number}`; x_ht_min_change: `${number}`; superscript_debug: `${0 | 1}`; page_xml_level: `${0 | 1}`; jpg_quality: `${number}`; user_defined_dpi: `${0 | 1}`; min_characters_to_try: `${number}`; suspect_level: `${number}`; suspect_short_words: `${number}`; tessedit_reject_mode: `${0 | 1}`; tessedit_image_border: `${number}`; min_sane_x_ht_pixels: `${number}`; tessedit_page_number: `${number}`; tessedit_parallelize: `${0 | 1}`; lstm_choice_mode: `${0 | 1}`; lstm_choice_iterations: `${number}`; tosp_debug_level: `${0 | 1}`; tosp_enough_space_samples_for_median: `${number}`; tosp_redo_kern_limit: `${number}`; tosp_few_samples: `${number}`; tosp_short_row: `${number}`; tosp_sanity_method: `${0 | 1}`; textord_max_noise_size: `${number}`; textord_baseline_debug: `${0 | 1}`; textord_noise_sizefraction: `${number}`; textord_noise_translimit: `${number}`; textord_noise_sncount: `${0 | 1}`; use_ambigs_for_adaption: `${0 | 1}`; allow_blob_division: `${0 | 1}`; prioritize_division: `${0 | 1}`; classify_enable_learning: `${0 | 1}`; tess_cn_matching: `${0 | 1}`; tess_bn_matching: `${0 | 1}`; classify_enable_adaptive_matcher: `${0 | 1}`; classify_use_pre_adapted_templates: `${0 | 1}`; classify_save_adapted_templates: `${0 | 1}`; classify_enable_adaptive_debugger: `${0 | 1}`; classify_nonlinear_norm: `${0 | 1}`; disable_character_fragments: `${0 | 1}`; classify_debug_character_fragments: `${0 | 1}`; matcher_debug_separate_windows: `${0 | 1}`; classify_bln_numeric_mode: `${0 | 1}`; load_system_dawg: `${0 | 1}`; load_freq_dawg: `${0 | 1}`; load_unambig_dawg: `${0 | 1}`; load_punc_dawg: `${0 | 1}`; load_number_dawg: `${0 | 1}`; load_bigram_dawg: `${0 | 1}`; use_only_first_uft8_step: `${0 | 1}`; stopper_no_acceptable_choices: `${0 | 1}`; segment_nonalphabetic_script: `${0 | 1}`; save_doc_words: `${0 | 1}`; merge_fragments_in_matrix: `${0 | 1}`; wordrec_enable_assoc: `${0 | 1}`; force_word_assoc: `${0 | 1}`; chop_enable: `${0 | 1}`; chop_vertical_creep: `${0 | 1}`; chop_new_seam_pile: `${0 | 1}`; assume_fixed_pitch_char_segment: `${0 | 1}`; wordrec_skip_no_truth_words: `${0 | 1}`; wordrec_debug_blamer: `${0 | 1}`; wordrec_run_blamer: `${0 | 1}`; save_alt_choices: `${0 | 1}`; language_model_ngram_on: `${0 | 1}`; language_model_ngram_use_only_first_uft8_step: `${0 | 1}`; language_model_ngram_space_delimited_language: `${0 | 1}`; language_model_use_sigmoidal_certainty: `${0 | 1}`; tessedit_resegment_from_boxes: `${0 | 1}`; tessedit_resegment_from_line_boxes: `${0 | 1}`; tessedit_train_from_boxes: `${0 | 1}`; tessedit_make_boxes_from_boxes: `${0 | 1}`; tessedit_train_line_recognizer: `${0 | 1}`; tessedit_dump_pageseg_images: `${0 | 1}`; tessedit_do_invert: `${0 | 1}`; thresholding_debug: `${0 | 1}`; tessedit_ambigs_training: `${0 | 1}`; tessedit_adaption_debug: `${0 | 1}`; applybox_learn_chars_and_char_frags_mode: `${0 | 1}`; applybox_learn_ngrams_mode: `${0 | 1}`; tessedit_display_outwords: `${0 | 1}`; tessedit_dump_choices: `${0 | 1}`; tessedit_timing_debug: `${0 | 1}`; tessedit_fix_fuzzy_spaces: `${0 | 1}`; tessedit_unrej_any_wd: `${0 | 1}`; tessedit_fix_hyphens: `${0 | 1}`; tessedit_enable_doc_dict: `${0 | 1}`; tessedit_debug_fonts: `${0 | 1}`; tessedit_debug_block_rejection: `${0 | 1}`; tessedit_enable_bigram_correction: `${0 | 1}`; tessedit_enable_dict_correction: `${0 | 1}`; enable_noise_removal: `${0 | 1}`; tessedit_minimal_rej_pass1: `${0 | 1}`; tessedit_test_adaption: `${0 | 1}`; test_pt: `${0 | 1}`; paragraph_text_based: `${0 | 1}`; lstm_use_matrix: `${0 | 1}`; tessedit_good_quality_unrej: `${0 | 1}`; tessedit_use_reject_spaces: `${0 | 1}`; tessedit_preserve_blk_rej_perfect_wds: `${0 | 1}`; tessedit_preserve_row_rej_perfect_wds: `${0 | 1}`; tessedit_dont_blkrej_good_wds: `${0 | 1}`; tessedit_dont_rowrej_good_wds: `${0 | 1}`; tessedit_row_rej_good_docs: `${0 | 1}`; tessedit_reject_bad_qual_wds: `${0 | 1}`; tessedit_debug_doc_rejection: `${0 | 1}`; tessedit_debug_quality_metrics: `${0 | 1}`; bland_unrej: `${0 | 1}`; unlv_tilde_crunching: `${0 | 1}`; hocr_font_info: `${0 | 1}`; hocr_char_boxes: `${0 | 1}`; crunch_early_merge_tess_fails: `${0 | 1}`; crunch_early_convert_bad_unlv_chs: `${0 | 1}`; crunch_terrible_garbage: `${0 | 1}`; crunch_leave_ok_strings: `${0 | 1}`; crunch_accept_ok: `${0 | 1}`; crunch_leave_accept_strings: `${0 | 1}`; crunch_include_numerals: `${0 | 1}`; tessedit_prefer_joined_punct: `${0 | 1}`; tessedit_write_block_separators: `${0 | 1}`; tessedit_write_rep_codes: `${0 | 1}`; tessedit_write_unlv: `${0 | 1}`; tessedit_create_txt: `${0 | 1}`; tessedit_create_hocr: `${0 | 1}`; tessedit_create_alto: `${0 | 1}`; tessedit_create_page_xml: `${0 | 1}`; page_xml_polygon: `${0 | 1}`; tessedit_create_lstmbox: `${0 | 1}`; tessedit_create_tsv: `${0 | 1}`; tessedit_create_wordstrbox: `${0 | 1}`; tessedit_create_pdf: `${0 | 1}`; textonly_pdf: `${0 | 1}`; suspect_constrain_1Il: `${0 | 1}`; tessedit_minimal_rejection: `${0 | 1}`; tessedit_zero_rejection: `${0 | 1}`; tessedit_word_for_word: `${0 | 1}`; tessedit_zero_kelvin_rejection: `${0 | 1}`; tessedit_rejection_debug: `${0 | 1}`; tessedit_flip_0O: `${0 | 1}`; rej_trust_doc_dawg: `${0 | 1}`; rej_1Il_use_dict_word: `${0 | 1}`; rej_1Il_trust_permuter_type: `${0 | 1}`; rej_use_tess_accepted: `${0 | 1}`; rej_use_tess_blanks: `${0 | 1}`; rej_use_good_perm: `${0 | 1}`; rej_use_sensible_wd: `${0 | 1}`; rej_alphas_in_number_perm: `${0 | 1}`; tessedit_create_boxfile: `${0 | 1}`; tessedit_write_images: `${0 | 1}`; interactive_display_mode: `${0 | 1}`; tessedit_override_permuter: `${0 | 1}`; tessedit_use_primary_params_model: `${0 | 1}`; textord_tabfind_show_vlines: `${0 | 1}`; textord_use_cjk_fp_model: `${0 | 1}`; poly_allow_detailed_fx: `${0 | 1}`; tessedit_init_config_only: `${0 | 1}`; textord_equation_detect: `${0 | 1}`; textord_tabfind_vertical_text: `${0 | 1}`; textord_tabfind_force_vertical_text: `${0 | 1}`; preserve_interword_spaces: `${0 | 1}`; pageseg_apply_music_mask: `${0 | 1}`; textord_single_height_mode: `${0 | 1}`; tosp_old_to_method: `${0 | 1}`; tosp_old_to_constrain_sp_kn: `${0 | 1}`; tosp_only_use_prop_rows: `${0 | 1}`; tosp_force_wordbreak_on_punct: `${0 | 1}`; tosp_use_pre_chopping: `${0 | 1}`; tosp_old_to_bug_fix: `${0 | 1}`; tosp_block_use_cert_spaces: `${0 | 1}`; tosp_row_use_cert_spaces: `${0 | 1}`; tosp_narrow_blobs_not_cert: `${0 | 1}`; tosp_row_use_cert_spaces1: `${0 | 1}`; tosp_recovery_isolated_row_stats: `${0 | 1}`; tosp_only_small_gaps_for_kern: `${0 | 1}`; tosp_all_flips_fuzzy: `${0 | 1}`; tosp_fuzzy_limit_all: `${0 | 1}`; tosp_stats_use_xht_gaps: `${0 | 1}`; tosp_use_xht_gaps: `${0 | 1}`; tosp_only_use_xht_gaps: `${0 | 1}`; tosp_rule_9_test_punct: `${0 | 1}`; tosp_flip_fuzz_kn_to_sp: `${0 | 1}`; tosp_flip_fuzz_sp_to_kn: `${0 | 1}`; tosp_improve_thresh: `${0 | 1}`; textord_no_rejects: `${0 | 1}`; textord_show_blobs: `${0 | 1}`; textord_show_boxes: `${0 | 1}`; textord_noise_rejwords: `${0 | 1}`; textord_noise_rejrows: `${0 | 1}`; textord_noise_debug: `${0 | 1}`; classify_learn_debug_str: `${string}`; user_words_file: `${string}`; user_words_suffix: `${string}`; user_patterns_file: `${string}`; user_patterns_suffix: `${string}`; output_ambig_words_file: `${string}`; word_to_debug: `${string}`; tessedit_char_blacklist: `${string}`; tessedit_char_whitelist: `${string}`; tessedit_char_unblacklist: `${string}`; tessedit_write_params_to_file: `${string}`; applybox_exposure_pattern: `${string}`; chs_leading_punct: `${string}`; chs_trailing_punct1: `${string}`; chs_trailing_punct2: `${string}`; outlines_odd: `${string}`; outlines_2: `${string}`; numeric_punctuation: `${string}`; unrecognised_char: `${string}`; ok_repeated_ch_non_alphanum_wds: `${string}`; conflict_set_I_l_1: `${string}`; file_type: `${string}`; tessedit_load_sublangs: `${string}`; page_separator: `${string}`; classify_char_norm_range: `${number}`; classify_max_rating_ratio: `${number}`; classify_max_certainty_margin: `${number}`; matcher_good_threshold: `${number}`; matcher_reliable_adaptive_result: `${0 | 1}`; matcher_perfect_threshold: `${number}`; matcher_bad_match_pad: `${number}`; matcher_rating_margin: `${number}`; matcher_avg_noise_size: `${number}`; matcher_clustering_max_angle_delta: `${number}`; classify_misfit_junk_penalty: `${0 | 1}`; rating_scale: `${number}`; tessedit_class_miss_scale: `${number}`; classify_adapted_pruning_factor: `${number}`; classify_adapted_pruning_threshold: `${number}`; classify_character_fragments_garbage_certainty_threshold: `${number}`; speckle_large_max_size: `${number}`; speckle_rating_penalty: `${number}`; xheight_penalty_subscripts: `${number}`; xheight_penalty_inconsistent: `${number}`; segment_penalty_dict_frequent_word: `${0 | 1}`; segment_penalty_dict_case_ok: `${number}`; segment_penalty_dict_case_bad: `${number}`; segment_penalty_dict_nonword: `${number}`; segment_penalty_garbage: `${number}`; certainty_scale: `${number}`; stopper_nondict_certainty_base: `${number}`; stopper_phase2_certainty_rejection_offset: `${0 | 1}`; stopper_certainty_per_char: `${number}`; stopper_allowable_character_badness: `${number}`; doc_dict_pending_threshold: `${0 | 1}`; doc_dict_certainty_threshold: `${number}`; tessedit_certainty_threshold: `${number}`; chop_split_dist_knob: `${number}`; chop_overlap_knob: `${number}`; chop_center_knob: `${number}`; chop_sharpness_knob: `${number}`; chop_width_change_knob: `${number}`; chop_ok_split: `${number}`; chop_good_split: `${number}`; segsearch_max_char_wh_ratio: `${number}`; language_model_ngram_small_prob: `${number}`; language_model_ngram_nonmatch_score: `${number}`; language_model_ngram_scale_factor: `${number}`; language_model_ngram_rating_factor: `${number}`; language_model_penalty_non_freq_dict_word: `${number}`; language_model_penalty_non_dict_word: `${number}`; language_model_penalty_punc: `${number}`; language_model_penalty_case: `${number}`; language_model_penalty_script: `${number}`; language_model_penalty_chartype: `${number}`; language_model_penalty_font: `${0 | 1}`; language_model_penalty_spacing: `${number}`; language_model_penalty_increment: `${number}`; invert_threshold: `${number}`; thresholding_window_size: `${number}`; thresholding_kfactor: `${number}`; thresholding_tile_size: `${number}`; thresholding_smooth_kernel_size: `${0 | 1}`; thresholding_score_fraction: `${number}`; noise_cert_basechar: `${number}`; noise_cert_disjoint: `${number}`; noise_cert_punc: `${number}`; noise_cert_factor: `${number}`; quality_rej_pc: `${number}`; quality_blob_pc: `${0 | 1}`; quality_outline_pc: `${0 | 1}`; quality_char_pc: `${number}`; test_pt_x: `${number}`; test_pt_y: `${number}`; tessedit_reject_doc_percent: `${number}`; tessedit_reject_block_percent: `${number}`; tessedit_reject_row_percent: `${number}`; tessedit_whole_wd_rej_row_percent: `${number}`; tessedit_good_doc_still_rowrej_wd: `${number}`; quality_rowrej_pc: `${number}`; crunch_terrible_rating: `${number}`; crunch_poor_garbage_cert: `${number}`; crunch_poor_garbage_rate: `${number}`; crunch_pot_poor_rate: `${number}`; crunch_pot_poor_cert: `${number}`; crunch_del_rating: `${number}`; crunch_del_cert: `${number}`; crunch_del_min_ht: `${number}`; crunch_del_max_ht: `${number}`; crunch_del_min_width: `${number}`; crunch_del_high_word: `${number}`; crunch_del_low_word: `${number}`; crunch_small_outlines_size: `${number}`; fixsp_small_outlines_size: `${number}`; superscript_worse_certainty: `${number}`; superscript_bettered_certainty: `${number}`; superscript_scaledown_ratio: `${number}`; subscript_max_y_top: `${number}`; superscript_min_y_bottom: `${number}`; suspect_rating_per_ch: `${number}`; suspect_accept_rating: `${number}`; tessedit_lower_flip_hyphen: `${number}`; tessedit_upper_flip_hyphen: `${number}`; rej_whole_of_mostly_reject_word_fract: `${number}`; min_orientation_margin: `${number}`; textord_tabfind_vertical_text_ratio: `${number}`; textord_tabfind_aligned_gap_fraction: `${number}`; lstm_rating_coefficient: `${number}`; tosp_old_sp_kn_th_factor: `${number}`; tosp_threshold_bias1: `${0 | 1}`; tosp_threshold_bias2: `${0 | 1}`; tosp_narrow_fraction: `${number}`; tosp_narrow_aspect_ratio: `${number}`; tosp_wide_fraction: `${number}`; tosp_wide_aspect_ratio: `${0 | 1}`; tosp_fuzzy_space_factor: `${number}`; tosp_fuzzy_space_factor1: `${number}`; tosp_fuzzy_space_factor2: `${number}`; tosp_gap_factor: `${number}`; tosp_kern_gap_factor1: `${number}`; tosp_kern_gap_factor2: `${number}`; tosp_kern_gap_factor3: `${number}`; tosp_ignore_big_gaps: `${number}`; tosp_ignore_very_big_gaps: `${number}`; tosp_rep_space: `${number}`; tosp_enough_small_gaps: `${number}`; tosp_table_kn_sp_ratio: `${number}`; tosp_table_xht_sp_ratio: `${number}`; tosp_table_fuzzy_kn_sp_ratio: `${number}`; tosp_fuzzy_kn_fraction: `${number}`; tosp_fuzzy_sp_fraction: `${number}`; tosp_min_sane_kn_sp: `${number}`; tosp_init_guess_kn_mult: `${number}`; tosp_init_guess_xht_mult: `${number}`; tosp_max_sane_kn_thresh: `${number}`; tosp_flip_caution: `${0 | 1}`; tosp_large_kerning: `${number}`; tosp_dont_fool_with_small_kerns: `${number}`; tosp_near_lh_edge: `${0 | 1}`; tosp_silly_kn_sp_gap: `${number}`; tosp_pass_wide_fuzz_sp_to_context: `${number}`; textord_noise_area_ratio: `${number}`; textord_initialx_ile: `${number}`; textord_initialasc_ile: `${number}`; textord_noise_sizelimit: `${number}`; textord_noise_normratio: `${number}`; textord_noise_syfract: `${number}`; textord_noise_sxfract: `${number}`; textord_noise_hfract: `${number}`; textord_noise_rowratio: `${number}`; textord_blshift_maxshift: `${0 | 1}`; textord_blshift_xfraction: `${number}`; }; export type InitOnlyConfigurationVariableNames = "ambigs_debug_level" | "language_model_ngram_on" | "language_model_use_sigmoidal_certainty" | "load_bigram_dawg" | "load_freq_dawg" | "load_number_dawg" | "load_punc_dawg" | "load_system_dawg" | "load_unambig_dawg" | "tessedit_init_config_only" | "tessedit_ocr_engine_mode" | "user_patterns_suffix" | "user_words_suffix"; export type DebugConfigurationVariableNames = "textord_debug_block" | "devanagari_split_debuglevel" | "textord_debug_tabfind" | "textord_debug_bugs" | "textord_debug_pitch_test" | "textord_debug_pitch_metric" | "textord_oldbl_debug" | "textord_debug_baselines" | "textord_debug_xheights" | "textord_debug_blob" | "gapmap_debug" | "edges_debug" | "devanagari_split_debugimage" | "textord_debug_printable" | "poly_debug" | "debug_file" | "ambigs_debug_level" | "classify_debug_level" | "matcher_debug_level" | "matcher_debug_flags" | "classify_learning_debug_level" | "dawg_debug_level" | "hyphen_debug_level" | "stopper_debug_level" | "chop_debug" | "wordrec_debug_level" | "segsearch_debug_level" | "language_model_debug_level" | "bidi_debug" | "applybox_debug" | "tessedit_bigram_debug" | "debug_noise_removal" | "debug_x_ht_level" | "multilang_debug_level" | "paragraph_debug_level" | "crunch_debug" | "debug_fix_space_level" | "superscript_debug" | "tosp_debug_level" | "textord_baseline_debug" | "classify_enable_adaptive_debugger" | "classify_debug_character_fragments" | "matcher_debug_separate_windows" | "wordrec_debug_blamer" | "thresholding_debug" | "tessedit_adaption_debug" | "tessedit_timing_debug" | "tessedit_debug_fonts" | "tessedit_debug_block_rejection" | "tessedit_debug_doc_rejection" | "tessedit_debug_quality_metrics" | "tessedit_rejection_debug" | "textord_noise_debug" | "classify_learn_debug_str" | "word_to_debug"; export type InitOnlyConfigurationVariables = Pick; export type DebugOnlyConfigurationVariables = Pick; export type SetVariableConfigVariables = Omit; export type SetConfigurationVariableNames = keyof SetVariableConfigVariables; export type SetNumberConfigurationVariableNames = { [Name in SetConfigurationVariableNames]: SetVariableConfigVariables[Name] extends `${number}` ? SetVariableConfigVariables[Name] extends `${0 | 1}` ? never : Name : never; }[SetConfigurationVariableNames]; export type SetBoolConfigurationVariableNames = { [Name in SetConfigurationVariableNames]: SetVariableConfigVariables[Name] extends `${0 | 1}` ? Name : never; }[SetConfigurationVariableNames]; export type SetStringConfigurationVariableNames = { [Name in SetConfigurationVariableNames]: SetVariableConfigVariables[Name] extends `${number}` ? never : Name; }[SetConfigurationVariableNames]; /** * Tesseract init options */ export interface TesseractInitOptions { /** * Its generally safer to use as few languages as possible. * The more languages Tesseract needs to load the longer it takes to recognize a image. * The OSD Language will always be loaded to support orientation and script detection * IMPORTANT: if you specify more than one language here (e.g.: `deu, eng` for example) * tesseract will try to recognize german and english in the same image. * Originally tesseract itself accepts it as `deu+eng`, but since this * makes typing very hard to near impossible its safer to just accept a * array with the languages it should look for. * When talking about "hard typing/impossible typing" its because typescript * itself cannot create recursive types, and chaining template types * (e.g.: `${Language}+${Language}+...`) stretches out the compilation time * to a unacceptable amount * * @default [Language.osd] */ langs?: Language[]; /** * Specify where the trainingdata is located * Besides the datapath in general it is versioned to the * version of tesseract * @default '~/.cache/node-tesseract-ocr/' */ cachePath?: string; /** * Explicit datapath for traineddata. Takes precedence over * the `TESSDATA_PREFIX` environment variable. */ dataPath?: string; /** * This will be called for every language that was specified in `lang`, * it allows the user to be flexible about the training data's location * Or if he needs to specify his own location for certain languages/custom languages * IMPORTANT: Ensures that trainingdata will be downloaded from the following cdn * in case they dont exist * OEM_LSTM_ONLY => https://cdn.jsdelivr.net/npm/@tesseract.js-data/${lang}/4.0.0_best_int * NON OEM_LSTM_ONLY => https://cdn.jsdelivr.net/npm/@tesseract.js-data/${lang}/4.0.0 * NOTE: Tesseract 5.x.x still uses the 4.x.x trainingdata * * @default true */ ensureTraineddata?: boolean; /** * Optional progress callback for traineddata downloads. */ progressCallback?: (info: TrainingDataDownloadProgress) => void; /** * OCR Engine Modes * The engine mode cannot be changed after creating the instance * If another mode is needed, its advised to create a new instance. * @default OEM_DEFAULT * @throws {Error} Will throw an error when oem mode is below 0 or over 3 */ oem?: OcrEngineMode; /** * Controls if only non debug parameters will be set upon initialization * @default false */ setOnlyNonDebugParams?: boolean; /** * Array of paths that point to their corresponding config files * usually located in the `dataPath` location alongside the training data */ configs?: Array; /** * Record of parameters that should be set upon initialization * Consult the original documentation of tesseract on which variables * can actually be set */ vars?: Partial>; } export interface TrainingDataDownloadProgress { lang: Language; url: string; downloadedBytes: number; totalBytes?: number; percent?: number; } export interface TesseractSetRectangleOptions { top: number; left: number; width: number; height: number; } export interface TesseractBeginProcessPagesOptions { outputBase: string; title: string; timeout: number; textonly: boolean; } export interface TesseractAddProcessPageOptions { buffer: Buffer; filename?: string; progressCallback?: (info: ProgressChangedInfo) => void; } export interface TesseractProcessPagesStatus { active: boolean; healthy: boolean; processedPages: number; nextPageIndex: number; outputBase: string; timeoutMillisec: number; textonly: boolean; } export interface ProgressChangedInfo { /** * Chars in this buffer */ progress: number; /** * Percent complete increasing (0-100) */ percent: number; /** * States if the worker is still alive */ ocrAlive: number; /** * top coordinate of the bbox of the current element that tesseract is processing */ top: number; /** * right coordinate of the bbox of the current element that tesseract is processing */ right: number; /** * bottom coordinate of the bbox of the current element that tesseract is processing */ bottom: number; /** * left coordinate of the bbox of the current element that tesseract is processing */ left: number; } export interface DetectOrientationScriptResult { /** * Orientation of the source image in degrees * Orientation refers to the way the source is rotated, **not** how the text is * aligned. It ranges from 0° to 360° degrees. * @type {number} */ orientationDegrees: number; /** * The confidence of tesseract for the orientation * @type {number} */ orientationConfidence: number; /** * The name of the script that is used in the source image * @type {string} */ scriptName: string; /** * The confidence of tesseract about the detected script of the source image * @type {number} */ scriptConfidence: number; } export type EnsureTrainedDataOptions = { lang: Language; cachePath: string; dataPath: string; downloadBaseUrl: string; progressCallback?: (info: TrainingDataDownloadProgress) => void; }; /** * Stable native error codes emitted by addon-backed OCR methods. */ export type TesseractErrorCode = "ERR_INVALID_ARGUMENT" | "ERR_OUT_OF_RANGE" | "ERR_TESSERACT_RUNTIME" | "ERR_WORKER_CLOSED" | "ERR_WORKER_STOPPED"; /** * Base shape for errors rejected by native OCR methods. */ export type TesseractNativeError = Error & { code?: TesseractErrorCode; method?: string; }; /** * Argument validation error (`TypeError` + native metadata). */ export type TesseractArgumentError = TypeError & TesseractNativeError; /** * Range/domain error (`RangeError` + native metadata). */ export type TesseractRangeError = RangeError & TesseractNativeError; /** * Runtime/native engine error (`Error` + native metadata). */ export type TesseractRuntimeError = Error & TesseractNativeError; /** * Worker lifecycle error (worker is closing/stopped). */ export type TesseractWorkerError = Error & TesseractNativeError; export interface TesseractDocumentApi { /** * Starts a multipage processing session. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractArgumentError} If options are missing/invalid. * @throws {TesseractRuntimeError} If session already exists or renderer setup fails. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ begin(options: TesseractBeginProcessPagesOptions): Promise; /** * Adds one encoded page to the active multipage session. * @throws {TesseractRuntimeError} If called before `init(...)`. * @param {TesseractAddProcessPageOptions} options Page options. * @throws {TesseractArgumentError} If `options` is missing/invalid. * @throws {TesseractArgumentError} If `options.buffer` is not a non-empty Buffer. * @throws {TesseractArgumentError} If `options.filename` is provided but is not a string. * @throws {TesseractArgumentError} If `options.progressCallback` is provided but is not a function. * @throws {TesseractRuntimeError} If no session is active, decode fails, or page processing fails. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ addPage(options: TesseractAddProcessPageOptions): Promise; /** * Finalizes the active multipage session and returns output PDF path. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If no session is active or finalization fails. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ finish(): Promise; /** * Aborts the active multipage session. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ abort(): Promise; /** * Returns the current multipage session status. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ status(): Promise; } export interface TesseractInstance { /** * Multipage document processing facade. */ document: TesseractDocumentApi; /** * Gets the currently loaded libtesseract version string. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ version(): Promise; /** * Returns whether `init(...)` was completed and not reset via `end()`. * @throws {TesseractArgumentError} If called with unexpected arguments. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ isInitialized(): Promise; /** * Set the name of the input file. * This is used for training/zone files and searchable PDF metadata. * @param {string} inputName The name of the input file * @throws {TesseractArgumentError} If `inputName` is not a string. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ setInputName(inputName: string): Promise; /** * Returns the current input name from Tesseract state. * @throws {TesseractRuntimeError} If no input name is currently available. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getInputName(): Promise; /** * Sets the encoded source image buffer used by Tesseract. * @param {Buffer} buffer * @throws {TesseractArgumentError} If `buffer` is not a non-empty Buffer. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If leptonica cannot decode `buffer`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ setInputImage(buffer: Buffer): Promise; /** * Returns the current input image bytes. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If no input image is available. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getInputImage(): Promise>; /** * Returns source image Y resolution. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getSourceYResolution(): Promise; /** * Returns the tessdata path used by the engine. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If datapath is unavailable. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getDataPath(): Promise; /** * Sets output base name used by renderer-based outputs. * @param {string} outputName The output base name. * @throws {TesseractArgumentError} If `outputName` is not a string. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If `outputName` is empty. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ setOutputName(outputName: string): Promise; /** * Clears global library-level caches (for example language dictionaries). * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ clearPersistentCache(): Promise; /** * Clears adaptive classifier state between pages/documents. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ clearAdaptiveClassifier(): Promise; /** * Get a copy of the internal thresholded image from Tesseract. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If no thresholded image is available. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getThresholdedImage(): Promise>; /** * Returns the scale factor for thresholded/component images. * May return `0` if no thresholder is active. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getThresholdedImageScaleFactor(): Promise; /** * Initialize the engine with the given options. * @param {TesseractInitOptions} options Initialization options. * @throws {TesseractArgumentError} If option types are invalid. * @throws {TesseractRangeError} If `options.oem` is out of range. * @throws {TesseractRuntimeError} If native init fails. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ init(options: TesseractInitOptions): Promise; /** * Initialize the engine for page analysis only. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ initForAnalysePage(): Promise; /** * Run page layout analysis. * @param {boolean} mergeSimilarWords Whether to merge similar words during analysis. * @throws {TesseractArgumentError} If `mergeSimilarWords` is not a boolean. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If analysis fails or returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ analyseLayout(mergeSimilarWords: boolean): Promise; /** * Starts a multipage processing session. * @deprecated use `document.begin()` * @throws {TesseractArgumentError} If options are missing/invalid. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If session already exists or renderer setup fails. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ beginProcessPages(options: TesseractBeginProcessPagesOptions): Promise; /** * Adds one encoded page to the active multipage session. * @deprecated use `document.addPage()` * @param {TesseractAddProcessPageOptions} options Page options. * @throws {TesseractArgumentError} If `options` is missing/invalid. * @throws {TesseractArgumentError} If `options.buffer` is not a non-empty Buffer. * @throws {TesseractArgumentError} If `options.filename` is provided but is not a string. * @throws {TesseractArgumentError} If `options.progressCallback` is provided but is not a function. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If no session is active, decode fails, or page processing fails. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ addProcessPage(options: TesseractAddProcessPageOptions): Promise; /** * Finalizes the current multipage session and returns the output PDF path. * @deprecated use `document.finish()` * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If no session is active or finalization fails. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ finishProcessPages(): Promise; /** * Aborts the active multipage session and resets related state. * @deprecated use `document.abort()` * @throws {TesseractWorkerError} If the worker is closing/stopped. */ abortProcessPages(): Promise; /** * Returns the current multipage processing status. * @deprecated use `document.status()` * @throws {TesseractArgumentError} If called with unexpected arguments. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getProcessPagesStatus(): Promise; /** * Sets a debug configuration variable. * @param {DebugConfigurationVariableNames} name Debug variable name. * @param {DebugOnlyConfigurationVariables[DebugConfigurationVariableNames]} value Debug variable value. * @returns `false` if lookup/set failed. * @throws {TesseractArgumentError} If `name`/`value` are invalid types. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If `name`/`value` are empty. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ setDebugVariable(name: Name, value: DebugOnlyConfigurationVariables[Name]): Promise; /** * Set a configuration variable. * @param {SetConfigurationVariableNames} name Variable name. * @param {SetVariableConfigVariables[SetConfigurationVariableNames]} value Variable value. * @returns `false` if lookup/set failed. * @throws {TesseractArgumentError} If `name`/`value` are invalid types. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If `name`/`value` are empty. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ setVariable(name: Name, value: SetVariableConfigVariables[Name]): Promise; /** * Get a configuration variable as integer. * @param {SetNumberConfigurationVariableNames} name Numeric variable name. * @throws {TesseractArgumentError} If `name` has an invalid type. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If variable was not found. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getIntVariable(name: SetNumberConfigurationVariableNames): Promise; /** * Get a configuration variable as boolean (0/1). * @param {SetBoolConfigurationVariableNames} name Boolean variable name. * @throws {TesseractArgumentError} If `name` has an invalid type. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If variable was not found. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getBoolVariable(name: SetBoolConfigurationVariableNames): Promise; /** * Get a configuration variable as double. * @param {SetNumberConfigurationVariableNames} name Numeric variable name. * @throws {TesseractArgumentError} If `name` has an invalid type. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If variable was not found. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getDoubleVariable(name: SetNumberConfigurationVariableNames): Promise; /** * Get a configuration variable as string. * @param {SetStringConfigurationVariableNames} name String variable name. * @throws {TesseractArgumentError} If `name` has an invalid type. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If variable was not found. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getStringVariable(name: SetStringConfigurationVariableNames): Promise; /** * Set the image to be recognized. * @param {Buffer} buffer Image data buffer. * @throws {TesseractArgumentError} If `buffer` is not a non-empty Buffer. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If decoding fails or decoded data is invalid. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ setImage(buffer: Buffer): Promise; /** * Set the page segmentation mode (PSM). * @param {PageSegmentationMode} psm Page segmentation mode. * @throws {TesseractArgumentError} If `psm` is not a number. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRangeError} If `psm` is outside valid mode range. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ setPageMode(psm: PageSegmentationMode): Promise; /** * Restrict recognition to a rectangle. * @param {TesseractSetRectangleOptions} options Rectangle options. * @throws {TesseractArgumentError} If rectangle options are missing/invalid. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ setRectangle(options: TesseractSetRectangleOptions): Promise; /** * Set the source resolution in PPI. * @param {number} ppi Source resolution in PPI. * @throws {TesseractArgumentError} If `ppi` is missing or not a number. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ setSourceResolution(ppi: number): Promise; /** * Runs OCR recognition. * @param {(info: ProgressChangedInfo) => void} progressCallback Optional progress callback. * @throws {TesseractArgumentError} If `progressCallback` is provided but not a function. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If native recognition fails. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ recognize(progressCallback?: (info: ProgressChangedInfo) => void): Promise; /** * Detect orientation and script (OSD). * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If OSD detection fails. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ detectOrientationScript(): Promise; /** * Returns mean text confidence. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ meanTextConf(): Promise; /** * Returns all word confidences. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ allWordConfidences(): Promise; /** * Make an XML-formatted string with PAGE markup from the internal data structures. * @param {(info: ProgressChangedInfo) => void} progressCallback callback to monitor the progress * @param {number} pageNumber pageNumber is a 0-based page index * @throws {TesseractArgumentError} If callback/page number types are invalid. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If PAGE generation fails or returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getPAGEText(progressCallback?: (info: ProgressChangedInfo) => void, pageNumber?: number): Promise; /** * Make a box file for LSTM training from the internal data structures. * Constructs coordinates in the original image - not just the rectangle. * @param {number} pageNumber pageNumber is a 0-based page index that will appear in the box file. * @throws {TesseractArgumentError} If `pageNumber` has invalid type. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If LSTM box text generation returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getLSTMBoxText(pageNumber?: number): Promise; /** * The recognized text is returned as a string which is coded in the same format as a box file used in training. * Constructs coordinates in the original image - not just the rectangle. * @param {number} pageNumber page_number is a 0-based page index that will appear in the box file. * @throws {TesseractArgumentError} If `pageNumber` has invalid type. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If box text generation returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getBoxText(pageNumber?: number): Promise; /** * The recognized text is returned as a string which is coded in the same format as a WordStr box file used in training. * @param {number} pageNumber pageNumber is a 0-based page index that will appear in the box file. * @throws {TesseractArgumentError} If `pageNumber` has invalid type. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If WordStr box generation returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getWordStrBoxText(pageNumber?: number): Promise; /** * The recognized text is returned as a string which is coded as UTF8 * @param {number} pageNumber pageNumber is a 0-based page index that will appear in the osd file. * @throws {TesseractArgumentError} If `pageNumber` has invalid type. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If OSD text generation returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getOSDText(pageNumber?: number): Promise; /** * Get recognized text as UTF-8. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If UTF-8 extraction returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getUTF8Text(): Promise; /** * Get hOCR output. * @param {Function} progressCallback Optional progress callback. * @param {number} pageNumber Optional page number (0-based). * @throws {TesseractArgumentError} If callback/page number types are invalid. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If hOCR generation returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getHOCRText(progressCallback?: (info: ProgressChangedInfo) => void, pageNumber?: number): Promise; /** * Get TSV output. * @param {number} pageNumber Optional page number (0-based). * @throws {TesseractArgumentError} If `pageNumber` has invalid type. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If TSV generation returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getTSVText(pageNumber?: number): Promise; /** * Get UNLV output. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If UNLV generation returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getUNLVText(): Promise; /** * Get ALTO XML output. * @param {number} pageNumber Optional page number (0-based). * @throws {TesseractArgumentError} If `pageNumber` has invalid type. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If ALTO generation returns null. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getALTOText(pageNumber?: number): Promise; /** * Get languages used at initialization. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractRuntimeError} If initialization languages are unavailable. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getInitLanguages(): Promise; /** * Get languages currently loaded. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getLoadedLanguages(): Promise; /** * Get available languages from tessdata. * NOTE: this only will return anything after `init` was called before with a valid selection of languages * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ getAvailableLanguages(): Promise; /** * Clear internal recognition results/state. * @throws {TesseractRuntimeError} If called before `init(...)`. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ clear(): Promise; /** * Release native resources and destroy the instance. * @throws {TesseractWorkerError} If the worker is closing/stopped. */ end(): Promise; } export type NativeTesseract = TesseractInstance; export type TesseractConstructor = new () => TesseractInstance;