Skip to content

Ensure JxlOptions matches the options jxl() accepts - #4602

Merged
lovell merged 1 commit into
lovell:mainfrom
ramin-010:jxl-type-options
Sep 13, 2026
Merged

lovell merged 1 commit into
lovell:mainfrom
ramin-010:jxl-type-options

Conversation

@ramin-010

@ramin-010 ramin-010 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

I found this while comparing the JSDoc with the type definitions for the different format options. JxlOptions was missing AnimationOptions, even though JXL supports animation at runtime, so TypeScript was rejecting things like jxl({ loop: 3 }) and jxl({ delay: [100, 200] }). I added AnimationOptions to JxlOptions and added two type tests for these cases.

I also noticed the effort comment says 3–9, while the runtime check and JSDoc both allow 1–9, so I fixed that as well. Both changes are in the same interface/type mismatch, so I kept them together, but I can split the effort change into a separate PR if preferred.

@lbesecker195 lbesecker195 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against lib/output.mjs: jxl() validates effort as an integer between 1 and 9 and calls trySetAnimationOptions, so the type definition was missing AnimationOptions and understated the effort range. Type test added. LGTM.

@lovell
lovell merged commit 0d19d4a into lovell:main Sep 13, 2026
32 checks passed
@lovell

lovell commented Sep 13, 2026

Copy link
Copy Markdown
Owner

@ramin-010 Thank you very much for fixing this.

@lovell lovell added this to the v0.35.5 milestone Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants