Mobx: TypeScript declarations?

Created on 19 Apr 2016  Â·  4Comments  Â·  Source: mobxjs/mobx

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!

Most helpful comment

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

All 4 comments

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

Thanks, not sure how I missed that!

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 [email protected]:

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
https://github.com/mobxjs/mobx/issues/203#issuecomment-212051341

@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!)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cafreeman picture cafreeman  Â·  4Comments

kmalakoff picture kmalakoff  Â·  4Comments

joey-lucky picture joey-lucky  Â·  3Comments

etinif picture etinif  Â·  3Comments

bichotll picture bichotll  Â·  3Comments