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

Typescript definition - Wrong hash() return type #745

Closed
soimy opened this issue Jun 3, 2019 · 2 comments · Fixed by #746
Closed

Typescript definition - Wrong hash() return type #745

soimy opened this issue Jun 3, 2019 · 2 comments · Fixed by #746
Labels
released This issue/pull request has been released.

Comments

@soimy
Copy link
Contributor

soimy commented Jun 3, 2019

Expected Behavior

According to the API document, we shall just use

let hashString: string = image.hash();

Or according to the jimp.d.ts

image.hash(hash => {
    hashString = hash;
};

Current Behavior

image.hash() return Jimp object. And the callback function return a type null | Error

  • Jimp Version: 0.6.4
  • Operating System: macOS 10.14.5
  • Node version: node v11.3.0
@soimy soimy changed the title Typescript definition - Confusing .hash() & .pHash() Typescript definition - Confusing hash() & pHash() Jun 3, 2019
@soimy
Copy link
Contributor Author

soimy commented Jun 3, 2019

Seems that it's a bug in jimp.d.ts where hash() should return string not this.
Manually change the file solves the problem.

@soimy soimy changed the title Typescript definition - Confusing hash() & pHash() Typescript definition - Wrong hash() return type Jun 6, 2019
hipstersmoothie pushed a commit that referenced this issue Aug 17, 2019
* Fix: hash() type-definition wrong return type

* Fix: hash() remove Error return type
@hipstersmoothie
Copy link
Collaborator

🚀 Issue was released in v0.6.5 🚀

@hipstersmoothie hipstersmoothie added the released This issue/pull request has been released. label Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants