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

Callback for Jimp.rgbaToInt should be optional #888

Closed
HanKruiger opened this issue May 15, 2020 · 0 comments
Closed

Callback for Jimp.rgbaToInt should be optional #888

HanKruiger opened this issue May 15, 2020 · 0 comments

Comments

@HanKruiger
Copy link
Contributor

I'm getting the following TypeScript error:
Screenshot 2020-05-15 at 17 44 35

even though I should be able to use the method as such (from the README):

Jimp.rgbaToInt(r, g, b, a); // e.g. converts 255, 255, 255, 255 to 0xFFFFFFFF

I think the error occurs because of a missing ? in the typings:

rgbaToInt:
https://github.com/oliver-moran/jimp/blob/585c1aba7ef2967eb948486b047ba766d761d9f0/packages/core/types/jimp.d.ts#L102

I think that's the issue, because for, for example, intToRGBA the callback is optional:
https://github.com/oliver-moran/jimp/blob/585c1aba7ef2967eb948486b047ba766d761d9f0/packages/core/types/jimp.d.ts#L104

Relatively new to TypeScript, so I definitely could be missing something.

Cheers!

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

2 participants