You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before v1, it was possible to pass around Jimp as a type and throw in the results of Jimp.read/Jimp.create/new Jimp. Example without TS errors:
importJimpfrom"jimp"constimg1=awaitJimp.read("")constimg2=awaitJimp.create("")constimg3=newJimp("")functiontest(j: Jimp){}test(img1)// workstest(img2)// workstest(img3)// works
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. #1328 (comment)
The text was updated successfully, but these errors were encountered: