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

Improve parameter types of the preprocess and encode functions in libSquoosh #1141

Merged
merged 4 commits into from
Sep 8, 2021

Conversation

ergunsh
Copy link
Contributor

@ergunsh ergunsh commented Sep 3, 2021

As far as I understand, two of the most important functions of our API are preprocess and encode. For them, in #1110, we were taking their types as any which doesn't provide a good developer experience for a TS developer.

This PR adds the concrete types for those function parameters.

In addition to that, default encode options for JXL was not containing some required parameters, so jxl: {} was throwing an error. I removed the unrelated parameters and added the ones that is required.

I think, after this PR we can expose the types to users and I'll create a PR for that as well :)

Copy link
Collaborator

@surma surma left a comment

Choose a reason for hiding this comment

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

That looks pretty good! Thanks so much!

Should we merge this into dev or into @styfle’s PR in #1110?

@ergunsh
Copy link
Contributor Author

ergunsh commented Sep 8, 2021

We can directly merge this into dev 🥳

@surma surma merged commit 1ab9e8b into GoogleChromeLabs:dev Sep 8, 2021
@ergunsh ergunsh deleted the improve-exposed-types branch September 8, 2021 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants