robertknight / tesseract-wasm

JS/WebAssembly build of the Tesseract OCR engine for use in browsers and Node

Home Page:https://robertknight.github.io/tesseract-wasm/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Types are missing for `tesseract-wasm/node`

MatteoGauthier opened this issue · comments

Hey I just noticed a TS error when used with node

import { createOCRClient } from "tesseract-wasm/node";
Cannot find module 'tesseract-wasm/node' or its corresponding type declarations.ts(2307)

Thanks for the report. The types in this package are currently only for the "root" tesseract-wasm import. Making types work for tesseract-wasm/node will involve using TS's support for the exports field in package.json to specify where to find types, per https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing.