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

Typings #50

Closed
hennessyevan opened this issue Jul 5, 2019 · 10 comments · Fixed by #64
Closed

Typings #50

hennessyevan opened this issue Jul 5, 2019 · 10 comments · Fixed by #64

Comments

@hennessyevan
Copy link

Would it be possible to get some typescript typings for this package, either in the repo or on definitely typed?

@sherwinski
Copy link
Contributor

Hey @hennessyevan, we've been getting more requests for this (and our other JS projects) lately, so it's definitely something we're planning to look into in the near future. I don't have an exact timeline at the moment but I'll be sure to update you when we get to it.

@gatherben
Copy link

+1 on typings!

@guanzo
Copy link

guanzo commented Jun 3, 2020

There should be typings for the param argument to buildURL.

I'm sorry but this is just lazy params?: {}.

The set of valid values are finite and well defined, there should be explicit types.

This is what your typings should look like. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-imgix/index.d.ts

@sherwinski
Copy link
Contributor

Hey @guanzo,

I agree that params deserves better typings. As a team, we are planning to pull in imgix-url-params as a dependency from which these definitions can be robustly constructed. This will help account for changes to the rendering API, as well as any new parameters that get added. To that end, params was assigned a very rudimentary type just to start out, but we expect to start work on pulling in these definitions in the near future. Hope that helps.

@guanzo
Copy link

guanzo commented Jun 3, 2020

Ok great, thanks for clarifying. Sorry I called you guys lazy!

@ericdeansanchez
Copy link
Contributor

🎉 This issue has been resolved in version 0.3.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@robinjonsson
Copy link

The typings for buildURL is still missing.
https://github.com/imgix/js-core/blob/v3.3.0-beta.1/src/index.mjs#L43

@sherwinski
Copy link
Contributor

Hey @robinjonsson, the typings should be included in the project's index.d.ts file.

Screen Shot 2021-04-09 at 12 52 34 PM

@robinjonsson
Copy link

Hi @sherwinski, I meant that the params argument is still pointing to an empty object. It would be great if params had the correct types.

@sherwinski
Copy link
Contributor

Ah sorry about that, I misunderstood your first comment. Apologies for the delays on this feature, but we have finally set aside time to build this out later this year.

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 a pull request may close this issue.

6 participants