imgix / js-core

A JavaScript client library for generating image URLs with imgix
https://www.imgix.com
BSD 2-Clause "Simplified" License
122 stars 20 forks source link

Typescript types for `params` #308

Open sylcastaing opened 2 years ago

sylcastaing commented 2 years ago

Hello team,

All my company's projects that use Imgix are written in typescript. Before, we use react-imgix with @types/react-imgix.

In @types/react-imgix there are type for all Imgix Params types. Not pretty but it's good for IDE autocompletation and help very much my team.

What do you think about port the types of imgixParams to js-core ?

It can be usefull to have, in the future, embed types pointing to js-core typing for all others projets (react-imgix, angular, etc..)

I can, of course, make a PR for this !

sylcastaing commented 2 years ago

Oh, I read the angular projet code and typing of params is generated with imgix-url-params project.

It may be a solution.

frederickfogerty commented 2 years ago

Salut @sylcastaing, just letting you know that I didn't miss this, and we're still discussing this internally. Of course we'd love a PR for this if you have the time!

frederickfogerty commented 2 years ago

Hi @sylcastaing 👋 we would love to have some type params for imgixParams in js-core. The way we would like to implement it would be to add a .d.ts file to https://github.com/imgix/imgix-url-params, in the dist folder, and then import those definitions here, and also in react and angular. We prefer the react-style typings, so we will be looking to copy those over. If this sounds like something you're interested in helping out with, let me know!