-
-
Notifications
You must be signed in to change notification settings - Fork 760
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
fix types #535
fix types #535
Conversation
@VojtechStep any idea how to fix the buffer thing? this could probably close #459 |
cb: GenericCallback<number, T, Jimp> | ||
): this; | ||
cb: GenericCallback<number, any, Jimp> | ||
): number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should actually return void
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one for sure returns a number though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the function doesn't have a return statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're reading the diff wrong. line 523 is a part of rgbaToInt
not appendConstructorOption
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh 100% you're right, sorry about that 🤦♂️
jimp.d.ts
Outdated
rotate( | ||
deg: number, | ||
mode: number | boolean | undefined | null, | ||
cb?: Jimp.ImageCallback<T> | ||
mode: number | boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems I've made a mistake before, the type of mode should be string | boolean
and it should be optional
jimp.d.ts
Outdated
composite( | ||
src: Jimp, | ||
x: number, | ||
y: number, | ||
options: Jimp.BlendModel, | ||
cb?: Jimp.ImageCallback<T> | ||
options: Jimp.BlendMode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we provide a default value for options
, it should be marked as optional
@hipstersmoothie Regarding the Buffer thing, I'm not sure how to approach it. We should add
|
Hmm. Better left to a different PR then. May just have to put something in the readme on how to configure it properly |
* fix types * fix more build errors * code reviews
You forgot to make this callback optional: static rgbaToInt(
r: number,
g: number,
b: number,
a: number,
cb: GenericCallback<number, any, Jimp>
): number; |
@nrkn please make a pr. |
What's Changing and Why
code review from @VojtechStep
What else might be affected
just types
Tasks
jimp.d.ts