You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've cloned this repo, made a docker build for opencv 4.10 wasm, fixed issue with the generateCvProps as imports and initialization of opencv was incorrect and I finally generated types which were all almost useless
Fix for generateCvProps
const { cv: cvLoader } = require('../.'); // will use index.js and opencv.js
const Module = {};
const cv = cvLoader(Module);
Running it with bash command like so
#!/bin/bash
# assume you are in ./utils
node generateCvProps.js
npx tsc --declaration --allowJs --emitDeclarationOnly --outDir ../types ../types/opencv.ts
Gave me the following output on types:
/** function */
export var IntVector: any;
/** function */
export var CharVector: any;
......
So generateCvProps doesn't even produce interfaces, it just plain key -> values pair with a bit of comment on top of it.
Can you explain how to generate types in production?
The text was updated successfully, but these errors were encountered:
@echamudi there is actually a pretty good flag in emcc ( opencv for js is build with it) -lembind --emit-tsd which creates typescript .d.ts for files ( not sure how to use it if we need to generate type definitions from cpp whole folder )
I'm currently working on the docker file which should create both openCV.js, opencv_js.wasm and type definitions for it
in here https://github.com/studentutu/opencv-wasm-node
If you can lend a hand in helping me generate types from emcc, it would be great
@UrielCh could you help with generating types from opencv? Your opencv4nodejs has all the types for opencv, could lend a hand in that? How to generate those types?
I've cloned this repo, made a docker build for opencv 4.10 wasm, fixed issue with the generateCvProps as imports and initialization of opencv was incorrect and I finally generated types which were all almost useless
Fix for generateCvProps
Running it with bash command like so
Gave me the following output on types:
So generateCvProps doesn't even produce interfaces, it just plain key -> values pair with a bit of comment on top of it.
Can you explain how to generate types in production?
The text was updated successfully, but these errors were encountered: