matthewp / robot

πŸ€– A functional, immutable Finite State Machine library

Home Page:https://thisrobot.life

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeScript support

TehShrike opened this issue Β· comments

I was feeling too guilty to open a "TypeScript herp derp?" issue when I found this project, but then I found this tweet, so here we are.

There are two main ways to add types – convert the source to TypeScript, and generate the JS and type file from that, or leave the source as the current JS, and add an index.d.ts with separate tests for the types.

Do you feel a preference for one or the other for this project?

I think I'd like to keep the project in JS as long as I can πŸ˜€. Since the project is so small I don't think it will be as much of an issue to maintain a definition file. So yeah, I'll start on this soon. Thanks for the issue!

Hey @matthewp!

First of all, great library - looking forward to playing around with it some more. Have you made any progress on these types? πŸ™

I haven't yet, no. Will be through a index.d.ts file. Happy to take contributions.

This was added in #63 and is available in robot3 0.2.8