unsplash / unsplash-js

🤖 Official JavaScript wrapper for the Unsplash API
https://www.npmjs.com/package/unsplash-js
MIT License
2.15k stars 157 forks source link

Create and export the `response` type. #207

Open Michael-Liendo opened 1 year ago

Michael-Liendo commented 1 year ago

I recommend being able to use the types of the responses to request an image without having to call the method.

Michael-Liendo commented 1 year ago

If you agree with the implementation of this issue, I could contribute with it. 😄

In my case I use the types of the images and the author and to use it in a place outside of where the request is made I cannot, and I have to create them by myself, that's why the recommendation.

Magellol commented 1 year ago

Would you mind providing a small code snippet to illustrate your idea? I'm not sure I fully understand.

Michael-Liendo commented 1 year ago

Would you mind providing a small code snippet to illustrate your idea? I'm not sure I fully understand.

It would be just to create the types of the response of an image.

something like this: image

but more types about the responses, and export for use