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

Export ColorActionName enum #1205

Merged
merged 3 commits into from
Feb 24, 2023
Merged

Export ColorActionName enum #1205

merged 3 commits into from
Feb 24, 2023

Conversation

daniellwdb
Copy link
Contributor

@daniellwdb daniellwdb commented Feb 22, 2023

What's Changing and Why

This PR fixes #987 by exporting an enum with all possible values for the color method's apply parameters. I chose to use an enum because this makes refactoring easier compared to having plain strings. Originally the ColorActionName type was missing some values.

What else might be affected

This is a breaking change for projects using TypeScript because they would have to reference the enum directly and use their values.

Some possible fix for backwards compatibility (>TS4.1):

++ type ColorActionNameValue = `${ColorActionName}`

type ColorAction = {
-- apply: ColorActionName;
++ apply: ColorActionName | ColorActionNameValue;

If older versions need to be supported I can try to look into it.

Tasks

  • Add tests
  • Update Documentation
  • Update jimp.d.ts
  • Add SemVer Label

@hipstersmoothie hipstersmoothie added the patch Increment the patch version when merged label Feb 24, 2023
@hipstersmoothie hipstersmoothie merged commit 3236973 into jimp-dev:main Feb 24, 2023
@github-actions
Copy link
Contributor

🚀 PR was released in v0.22.6 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image saturate / desaturate appear on the doc, but not on the module...
2 participants