flow
flow copied to clipboard
Make it easier to add all definitions under a namespace
The current way of defining namespaced global type declarations is unnecessarily verbose. For example, defining React$Node, we have to use React$Node everywhere in the same definition file. This doesn't scale well for external libraries or standards, such as GeoJSON, that need to reference other types they also define.
TypeScript has a simple solution to this issue. Adding the following line at the top of the file places all declarations under the same namespace:
export as namespace GeoJSON;
This leads to clean and readable libdef files. Is it possible to add this feature to Flow?
Coming from typescript this is a sorely missed feature.