How to import Tesseract into Angular2 (TypeScript)

I am trying to import Tesseract into Angular2 (TypeScript). I see that it is saved in the node_modules folder, but when using

import { Tesseract } from '@types/tesseract.js';

He says:

[ts] Module '' c: / Users / black / Projects / projectCLI / tess / node_modules/@types/tesseract.js/index "'does not have an exported Tesseract member.

There is a Tesseract namespace in the index.d.ts file.

Is there any other way to import this or are we looking at it wrong?

I used npm install --save-dev @types/tesseract.jsto install typescript Tesseract.

If there are any demo tutorials using tesseract, can you link them here?

in advance for your help.

+4
1

javascript:
npm install tesseract.js --save

@types:
npm install @types/tesseract.js --save-dev

, : import * as Tesseract from 'tesseract.js'

,

@types .
, . import * as aliasname from tessreact.js, aliasname.functionname. .

+5

Source: https://habr.com/ru/post/1671439/


All Articles