WARNING: Highly experimental proof of concept!
Automatically generate Flow libdefs from source code
Flow types are not supported by all library consumers, so we strip them when we compile a library and publish it on npm. But some consumers are interested in Flow types. So we publish additional libdefs, either via flow-typed
or .js.flow
files (I prefer the latter). But composing these library definitions entails duplication: Handpicking the already-defined types of the exported APIs to derive a Flow interface. Can this be automated?
Context: