According to the document http://flowtype.org/docs/functions.html you need to specify the type of function parameters and the return value: (P1: T1, .., Pn: Tn) => U
So, suppose your afterDoneSomething takes a number and returns a number, it should be annotated as
function doSomething(path:string, afterDoneSomething: (x: number) => number)
source share