How to write Flow libdefs for libraries with deeper paths



I’m testing out Flow for typing our JavaScript, and I want to create a libdef for an internal library. It’s imported like this:

import withValidation from 'internally-shared-libs/decorators/withValidation';

The documentation doesn’t really address how to create library definitions for deep paths like this - only top level ones.

Where do I put the libdef file? What do I call it? And how would it look (ignoring the actual implementation of the libdef, of course)?

Thanks in advance for any help on this!