@luii/node-tesseract-ocr 2.1.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ name: "node-tesseract-ocr",
3
+ napi_versions: [10],
4
+ };
@@ -28,6 +28,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.NativeTesseract = exports.Tesseract = exports.LogLevels = exports.PageSegmentationModes = exports.OcrEngineModes = exports.Language = void 0;
31
+ const node_fs_1 = require("node:fs");
32
+ const promises_1 = require("node:fs/promises");
33
+ const node_os_1 = __importDefault(require("node:os"));
34
+ const node_path_1 = __importDefault(require("node:path"));
35
+ const node_stream_1 = require("node:stream");
36
+ const promises_2 = require("node:stream/promises");
37
+ const node_zlib_1 = require("node:zlib");
38
+ const proper_lockfile_1 = require("proper-lockfile");
39
+ const utils_1 = require("./utils");
31
40
  /**
32
41
  * All available languages for tesseract
33
42
  * @readonly
@@ -242,15 +251,6 @@ exports.LogLevels = {
242
251
  FATAL: "50000",
243
252
  OFF: "2147483647",
244
253
  };
245
- const node_fs_1 = require("node:fs");
246
- const promises_1 = require("node:fs/promises");
247
- const node_os_1 = __importDefault(require("node:os"));
248
- const node_path_1 = __importDefault(require("node:path"));
249
- const node_stream_1 = require("node:stream");
250
- const promises_2 = require("node:stream/promises");
251
- const node_zlib_1 = require("node:zlib");
252
- const proper_lockfile_1 = require("proper-lockfile");
253
- const utils_1 = require("./utils");
254
254
  const TESSDATA4_BEST = (lang) => `https://cdn.jsdelivr.net/npm/@tesseract.js-data/${lang}/4.0.0_best_int/`;
255
255
  const TESSDATA4 = (lang) => `https://cdn.jsdelivr.net/npm/@tesseract.js-data/${lang}/4.0.0/`;
256
256
  const DEFAULT_CACHE_DIR = node_path_1.default.join(node_os_1.default.homedir(), ".cache", "node-tesseract-ocr", "tessdata");
@@ -267,6 +267,18 @@ exports.NativeTesseract = NativeTesseract;
267
267
  class Tesseract extends NativeTesseract {
268
268
  constructor() {
269
269
  super();
270
+ Object.defineProperty(this, "document", {
271
+ enumerable: true,
272
+ configurable: true,
273
+ writable: true,
274
+ value: {
275
+ begin: this.beginProcessPages.bind(this),
276
+ addPage: this.addProcessPage.bind(this),
277
+ finish: this.finishProcessPages.bind(this),
278
+ abort: this.abortProcessPages.bind(this),
279
+ status: this.getProcessPagesStatus.bind(this),
280
+ }
281
+ });
270
282
  }
271
283
  init() {
272
284
  const _super = Object.create(null, {