Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript declarations? #203

Closed
jamiewinder opened this issue Apr 19, 2016 · 4 comments
Closed

TypeScript declarations? #203

jamiewinder opened this issue Apr 19, 2016 · 4 comments

Comments

@jamiewinder
Copy link
Member

Are there any mobx declaration files (i.e. mobx.d.ts) anywhere? I don't mind writing some if not, though being written in TypeScript itself I'm surprised I haven't found them in the usual sources (typings, DefinitelyTyped etc.)

Thanks!

@andykog
Copy link
Member

andykog commented Apr 19, 2016

mobx.d.ts generated by tsc is included in npm package: https://npmcdn.com/mobx/lib/mobx.d.ts
When you working with sources, you don't need d.ts, as mobx itself is written in typescript

@jamiewinder
Copy link
Member Author

Thanks, not sure how I missed that!

@mweststrate
Copy link
Member

You can directly import {observable} from 'mobx' indeed, without
installing or even specifying or importing any further d.ts file path. It's
a really awesome feature of TS 1.6 and higher. Sadly only few packages use
it so far...

Op di 19 apr. 2016 om 20:13 schreef jamiewinder notifications@github.com:

Thanks, not sure how I missed that!


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#203 (comment)

@jamiewinder
Copy link
Member Author

@mweststrate - I've just looked up the feature you're referring to and I can see why it isn't working for me; I'm using jspm so it isn't able to resolve the d.ts file (since it sits in jspm_packages/npm/mobx, not the expected node_modules). Thanks for the hint!

(thanks for the library btw - I've only just started with it!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants