teslamotors/informed

Missing Typescript Definitions

Aryaman73 opened this issue · 7 comments

Hey! It seems like the index.d.ts file is out of date (a comment in the file mentions Informed v2.0.0). Notably, this means that the Multistep component (here) is seemingly unusable in a TS project:

image

The only solution for this that I could find is to disable TS (and esLint) in the file, which isn't ideal.

I know that this is also the case with the Relevant component, and that the maintainer of this project doesn't use Typescript too much (link), but I was wondering if there was any progress made on the TS definitions since then?


As a side note, there seems to be a mistake in the example in the documentation here in the code example at the bottom of the page. It's missing a closing </div>:
image

Hi :), I have the same problem too. I'm working on it and will make a PR for it.

@Bezmehrabi awesome! 🥳 I'd love to have a look/test it out once you're done.

Im going to redo them soon. I just need to get help from a TS person lol

hello, I've been busy unfortunately but I did some work because we needed the type definition to be fixed for our own needs. :)
the current type definition has a lot of problems. for example, field name type is a lot more complex than just [key: k in keyof V] because of nested values.

react-hook-form has some great type utils for this kind of types.
and I suggest using them :).

it's been a long time...but I finally did it xD

Those types are too complex. I will not merge them. ( I will work on adding missing types now that V4 is out ) But I WONT make them complex

There is another issue open for missign types going to track there #392