-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing "languages" attributes on default export #887
Comments
I agree this is a good suggestion, and would reduce errors like the one you linked. However, I believe this is a breaking change so the soonest this could be implemented is Tesseract.js v6.0. Making this change would break code for (1) TypeScript users specifying a custom language and (2) TypeScript users specifying multiple languages by concatenating them with I will update the documentation to remove anything referencing the concatenation method for specifying multiple languages. |
Tesseract.js version 5.0.4
Describe the bug
The
languages
constant object is missing from definition despite being exported in the index.jsTo Reproduce
Steps to reproduce the behavior:
tesseract.js
import { languages } from 'tesseract.js';
Please attach any input image required to replicate this behavior.
Expected behavior
The expected behavior is to have access to
languages
in TypeScript codebase and avoid these kind of issueAlso, it will help to be more TypeSafe and to create some validators rules with Zod/Yup/Joi/... by passing this object directly as source of truth.
Device Version:
Additional context
My current workaround to fix this issue is to create a
tesseract.d.ts
file in my project and add this block:But it would be better to generate the definition directly from project and by importing the JSDoc on the languages constants
Thank you.
The text was updated successfully, but these errors were encountered: