Add QRCodeEncoder type definitions with main branch integration #91
+286
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses the missing
cv.QRCodeEncoderTypeScript definitions by adding comprehensive type support for QRCodeEncoder functionality. This PR has been updated to merge improvements from main branch (PR #92 and PR #97), which added better QRCodeDetector and QRCodeDetectorAruco implementations in separate files and fixed the boxPoints type definition.Issue Summary
Users reported that while
cv.QRCodeDetectorworks correctly and QRCodeEncoder constants likecv.QRCodeEncoder_CORRECT_LEVEL_Qare available, thecv.QRCodeEncoderclass itself was missing from the TypeScript definitions, causing compilation errors.Investigation Results
After thorough investigation of the OpenCV.js runtime, I discovered:
QRCodeEncoder_CorrectionLevel,QRCodeEncoder_EncodeMode, etc.) are availableChanges Made
1. Merged Main Branch Improvements (Two Merges)
src/types/opencv/QRCodeDetector.ts: Comprehensive QRCodeDetector with detectMulti, decodeMulti methodssrc/types/opencv/QRCodeDetectorAruco.ts: Full QRCodeDetectorAruco with parameters supportboxPointstype definition to match runtime behavior #97: Incorporated boxPoints type definition fix and additional improvementsboxPointstype to match runtime behavior2. QRCodeEncoder TypeScript Definitions
Added comprehensive type definitions to
src/types/opencv/objdetect.ts:3. Test Coverage
4. Documentation
Created
doc/QRCode-Support.mdwith:Runtime Behavior
Benefits
boxPointstype definition to match runtime behavior #97), and QRCodeEncoder support from this PRFixes #58.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.