flume icon indicating copy to clipboard operation
flume copied to clipboard

Add first typescript definitions

Open WeersProductions opened this issue 3 years ago • 12 comments

Hi there!

A few notes about this PR:

  • I'm no expert in typescript at all. I use Flume to generate json files that I read using C++ (which obviously is completely different). I know how to use Typescript, but I've never created definitions like this.
  • A lot of types are still missing. While all component definitions are created, they're not typed.
  • I'm still new to the project. I might be making obvious mistakes due being unfamiliar with the project. Please let me know!

Definitions for index.js should be done. Be sure to verify that you can use them properly in your (typescript) project. Let me know if something is missing and feel free to add more types.

WeersProductions avatar Oct 07 '20 14:10 WeersProductions

Nice work. I have been starting with Typescript myself so if you need any support I could help. Your current work looks good to me. Although I am wondering why you are providing types for the components? I don't think they are part of the user facing API.

PhilGarb avatar Oct 07 '20 15:10 PhilGarb

Good point! Those were part of the autogenerated type definitions. I've removed them. I think all public types are available now (with some properties set to 'any')?

WeersProductions avatar Oct 07 '20 17:10 WeersProductions

I think most of the any's make sense, because the properties are so flexible that we really cannot assume the type. I left you some comments.

PhilGarb avatar Oct 08 '20 07:10 PhilGarb

Updated the types using your feedback, thanks!

WeersProductions avatar Oct 08 '20 13:10 WeersProductions

Hey sorry it took me so long. I have added some more comments and have tried using the types in a project. They seem to work fine for me so far. However I am unsure how to proceed. @chrisjpatty are you open to the idea of types as part of the project? I think they could be quite helpful and would be a great addition on top of the many runtime checks you have already. Otherwise I would move this to DefinitelyTyped.

PhilGarb avatar Nov 06 '20 07:11 PhilGarb

@PhilGarb Definitely! Sorry I haven't chimed in here yet, and thanks to both you and @WeersProductions for working on these. I definitely want these to be made available for Typescript users when you think they're ready to merge in.

chrisjpatty avatar Nov 06 '20 22:11 chrisjpatty

Is this PR will be merged any time soon?

rzcoder avatar Jun 21 '21 14:06 rzcoder

@PhilGarb @chrisjpatty this would be a great addition, any chance it can be merged back with the master?

joeledwardson avatar Jul 13 '21 22:07 joeledwardson

I have not looked at this for a while. It is not really up to me to merge this. I have used them on a separate branch and they seemed to be correct.

PhilGarb avatar Jul 14 '21 09:07 PhilGarb

Bump! Would love to have types available here! Thanks for all the great work so far, having a blast learning the lib.

AntoineTB avatar Jan 29 '22 05:01 AntoineTB

I'd recommend submitting this to DefinitelyTyped (https://github.com/DefinitelyTyped/DefinitelyTyped) in the mean time

percentcer avatar May 20 '22 20:05 percentcer

There's now a beta release with typescript types v1.0.0-0. The types have a couple bugs at the moment but I'm working those out as we speak.

chrisjpatty avatar May 20 '22 23:05 chrisjpatty