martyjs / marty

A Javascript library for state management in React applications
http://martyjs.org
MIT License
1.09k stars 76 forks source link

Add a TypeScript definition #345

Closed blakeembrey closed 9 years ago

blakeembrey commented 9 years ago

Thanks for taking a look at this PR! I've been using Marty with TypeScript for a little while and had to write out my own type definition for it. This file was originally based on 0.9, but I updated it according to the change log and my application to 0.10. It's possible there's still some parts missing.

Now, for some caveats of this. Currently the third-party definition system for TypeScript is fragmented with most people trying to publish to and consume a centralised repository. I'm currently working on the next version of TSD which will solve this issue at its core. For now, people will need to know (as mentioned in the README) that this definition requires React and Flux. If you wish to avoid this, you can change the types to any but that will ignore type information around those interfaces.

Feel free to make a note of any issues you notice in the definition :smile: I'll be sure to keep it up to date for you and, when the next TSD version comes out, fix the caveats that exist. When the new version is released, I'll come back to this and refactor the definition into marty-lib and consume inside this library.

jhollingworth commented 9 years ago

This is awesome! I've added a few small comments

blakeembrey commented 9 years ago

@jhollingworth I corrected your notes and removed Flux since it's not being exposed anymore.

jhollingworth commented 9 years ago

:+1: Thanks :)