infer
infer copied to clipboard
Generating type annotations
Is infer
able to generate type annotations for JavaScript functions?
It would be useful to have a tool that could transform a JavaScript function like this:
function distance_formula(x1,y1,x2,y2){
return Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
}
and generate type annotations like this (using TypeScript syntax):
function distance_formula(x1:number,y1:number,x2:number,y2:number):number{
return Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
}