flume
flume copied to clipboard
Add first typescript definitions
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.
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.
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')?
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.
Updated the types using your feedback, thanks!
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 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.
Is this PR will be merged any time soon?
@PhilGarb @chrisjpatty this would be a great addition, any chance it can be merged back with the master?
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.
Bump! Would love to have types available here! Thanks for all the great work so far, having a blast learning the lib.
I'd recommend submitting this to DefinitelyTyped (https://github.com/DefinitelyTyped/DefinitelyTyped) in the mean time
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.