imagekit-react icon indicating copy to clipboard operation
imagekit-react copied to clipboard

Rewrite SDK in Typescript

Open arpitdalal opened this issue 2 years ago • 13 comments

Are there any types for this? Are they in progress?

arpitdalal avatar Feb 03 '22 13:02 arpitdalal

Hi @arpitdalal , not at the moment. We plan to rewrite this SDK in TS in this quarter.

imagekitio avatar Feb 03 '22 13:02 imagekitio

oh nice! I can help by rewriting some components to TS on a new branch and making a PR

arpitdalal avatar Feb 03 '22 13:02 arpitdalal

Thanks. Can you share a rough idea of how do you plan to do this without making any changes in test cases under tests folder? We did this in Node js sdk to avoid any regression.

imagekitio avatar Feb 03 '22 14:02 imagekitio

I went through the codebase of the Node.js SDK, what extra did you do so the tests didn't break? I mean your jest tests for this SDK don't rely on any data types, they just expect something and that component either from a .jsx or a .tsx returns the same thing.

arpitdalal avatar Feb 03 '22 15:02 arpitdalal

I am sorry if I am missing something here.

arpitdalal avatar Feb 03 '22 15:02 arpitdalal

No that's it actually. You can start the work and submit the PR. However I should mention that we will try to pick review and testing on best effort basis at the moment.

imagekitio avatar Feb 03 '22 15:02 imagekitio

Okay, that's great! I am sorry, I couldn't quite understand wdym by "we will try to pick review and testing on best effort basis at the moment."?

arpitdalal avatar Feb 03 '22 16:02 arpitdalal

I meant review and test the PR.

imagekitio avatar Feb 03 '22 16:02 imagekitio

oh okay, yes that's totally fine.

arpitdalal avatar Feb 03 '22 17:02 arpitdalal

@arpitdalal did you make any progress with this?

dg-robinson avatar Apr 21 '22 12:04 dg-robinson

I have not unfortunately

arpitdalal avatar Apr 21 '22 12:04 arpitdalal

I created a .d.ts for my app that is based on the types in some of their other libraries: https://gist.github.com/pip8786/cb4249d52a5f05d4a7d64ac38df80abe

Seems to work for my use case.

pip8786 avatar May 20 '22 20:05 pip8786

I made a very small typescript hook wrapper for imagekit-javascript that I've been using. It doesn't have as much functionality as this library, but I wasn't really using IKImage or IKUpload anyway, and preferred to use my own implementations.

imagekit-react-hook

bruceharrison1984 avatar Jul 30 '22 19:07 bruceharrison1984

Version 2.0.0 is written in Typescript.

imagekitio avatar Sep 29 '22 09:09 imagekitio