lukaszkurantdev / react-native-fast-opencv

A powerful port of OpenCV for React Native.
https://lukaszkurantdev.github.io/react-native-fast-opencv/
MIT License
66 stars 7 forks source link

Type Error on Base Import "Could not find a declaration file for module 'react-native-fast-opencv'." #18

Closed GMoon777 closed 3 weeks ago

GMoon777 commented 1 month ago

Hi, amazing work with this, just wanted to check as I can see many mentions of TypeScript in this repo.

Are we expecting to not have a declaration file when importing OpenCV from react-native-fast-opencv

import { OpenCV } from "react-native-fast-opencv";
"Could not find a declaration file for module 'react-native-fast-opencv'."

Thanks.

GMoon777 commented 1 month ago

I added "types": "./lib/typescript/module/src/index.d.ts" to the react-native-fast-opencv package.json and all the types are working now. Not sure why my project couldn't detect them without this addition.

lukaszkurantdev commented 4 weeks ago

@GMoon777 Probably it's related to your project TS configuration (some excludes?), the error does not occur on a clean project.

GMoon777 commented 3 weeks ago

@lukaszkurantdev Thanks for getting back to me, it must be my typescript configuration then. I'll close this.