Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dyoshikawa
Copy link
Contributor

@dyoshikawa dyoshikawa commented Nov 23, 2022

The decodeFromImage() function accepts a string type as an argument. And this works as expected. However, when use TypeScript, actually setting the string type causes a type definition error.

Example:

const qrCodeBase64Str = 'data:image/png;base64...'
const qrCodeDecoder = new QrCodeDecoder()
qrCodeDecoder.decodeFromImage(qrCodeBase64Str).then((result) => console.log(result))
// => Error: "Argument of type 'string' is not assignable to parameter of type 'HTMLImageElement'."

This PR prevents the type definition error from occurring.

@yugasun yugasun merged commit 0b7edb3 into yugasun:master Nov 23, 2022
@dyoshikawa dyoshikawa deleted the fix-type-def-of-decode-from-image-param branch November 23, 2022 07:23
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

Successfully merging this pull request may close these issues.

2 participants