Open vntw opened 3 weeks ago
can confirm the workaround works for me
Would either of you like to contribute this via PR?
There may be a way we can massage the types to not need this an just use JImp
as a type. I don't have too much time to figure that out tough
Expected Behavior
Before v1, it was possible to pass around
Jimp
as a type and throw in the results ofJimp.read
/Jimp.create
/new Jimp
. Example without TS errors:See https://codesandbox.io/p/sandbox/g56q6v?file=%2Findex.mts
Current Behavior
1330 already added an improvement via the
JimpInstance
type, but it seems like it doesn't work the same way (interchangeably).See https://codesandbox.io/p/sandbox/jimp-test-249ch8-pk8qdr?file=%2Findex.mts
Workaround for now is to use
Awaited<ReturnType<typeof Jimp.read>>
Failure Information (for bugs)
Steps to Reproduce
Ref. https://github.com/jimp-dev/jimp/issues/1328#issuecomment-2337770442