flowtype - Is there any way to type Immutable Map of another type? -
eg. have type external library (mapboxgl.style) , want create new immutable.map type based on type.
so type cover internal properties of original type within immutable.map.
here code:
const plainstyle: mapboxgl.style = <...>; const style: ??? = immutable.map(plainstyle); style.get('name'): string style.get('sources'): immutable.map<string, object>
it sounds fromjs trick.
something like:
const style = immutable.fromjs(plainstyle)
Comments
Post a Comment