Skip to content
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

Better types #5

Open
morozovsk opened this issue Aug 16, 2020 · 4 comments
Open

Better types #5

morozovsk opened this issue Aug 16, 2020 · 4 comments

Comments

@morozovsk
Copy link

Hi.
I found miranda project.
I think you can use these types for better syntax highlighting: https://github.com/cancerberoSgx/mirada/tree/c8721d6bbe004e31ec7578b30443c01274528a3f/mirada/src/types/opencv

@echamudi
Copy link
Owner

Hello @morozovsk ,

Thanks for the suggestion!

Previously, I attempted to take the typings from that project (in this branch). But unfortunately, I found some errors in the typings, for example: MatVector and Mat types.

These errors make some false alarms in valid codes, so I haven't merged the that branch to the master yet.

@peteruhnak
Copy link

If you are looking for types that are closer to the generated opencv.js/wasm , I'm currently working on generating typescript types directly from opencv codebase https://github.com/peteruhnak/opencv-ts (with the intention for this to eventually be part of opencv itself).
Feel free to copy the lib/typings and lib/index.d.ts to your library/project to test it out and report any typing issues in the linked repo.

@echamudi
Copy link
Owner

@peteruhnak that's interesting! I'll keep track of the project.

@studentutu
Copy link

studentutu commented Jun 22, 2024

@echamudi
just update the index.d.ts as follows ( it will export all types from underlying OpenCV without any additional hassle)

import type * as openCV from './types/';
export type * as openCV from './types/';

/**
 * OpenCV Object
 */
export declare const cv: typeof openCV;

/**
 * Translate error number from OpenCV into a meaningful message
 * @param cvObject OpenCV object
 * @param err OpenCV error number 
 */
export function cvTranslateError(cvObject: typeof openCV, err: any): string | Error | undefined;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants