-
Notifications
You must be signed in to change notification settings - Fork 642
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
Make IModelType exported to avoid TS Errors #256
Comments
Same with ISimpleType (if I add a property like x: types.number) and ISnapshottable (if I add a property that is based in another model such as obj: AreaProperties) actually |
Hi, thanks for reporting! They are now exported as well on the main package and should be out with next release! :) |
seems to work :) the only annoying thing is WebStorm trying to optimize out the "unused" imports, but I guess that's a WebStorm problem (and using // noinspection ES6UnusedImports fixes it) |
Ok actually another one when using types.map import { IExtendedObservableMap } from 'mobx-state-tree/dist/types/complex-types/map' PS: are maps required to have strings as keys or can they be numbers? |
I updated the master branch, please check if its ok so I will cut a minor release :) They only support strings as now due to a mobx limitation to support IE. |
Looking good! (though I didn't test all possible types so far) Damned IE :) Am I right that the json serialization (snapshot) of a map then is a plain object? |
@xaviergonz Yep, it is! |
@xaviergonz Please note to always import from |
@mattiamanzati btw, we could more often use |
@mweststrate thanks, I wanted to, but I didn't have much of a choice :) I plan to fix the imports in my code as soon as the fix is out in npm |
While trying a simple test with TS 2.4.1:
I got a typescript error saying:
TS4023: Exported variable 'AreaProperties' has or is using name 'IModelType' from external module "....../node_modules/mobx-state-tree/dist/types/complex-types/object" but cannot be named.
The fix is easy (but right now kind of ugly), I need to add an import like this:
import { IModelType } from 'mobx-state-tree/dist/types/complex-types/object';
and then the error will disappear, but I'd rather import it from 'mobx-state-tree' directly.
The text was updated successfully, but these errors were encountered: