typewiz
typewiz copied to clipboard
Check whether an existing named type is available to apply
Given file
type T0 = {foo: string, bar: boolean};
function magic(param) {
return param;
}
magic({foo: 'hello world', bar: true});
We would like to use T0 as the type, because it's available and it matches our runtime type.
Actual:
//snip
function magic(param: Object) { // or at best {foo: string, bar: boolean}
// snip
Expected:
// snip
function magic(param: T0) {
// snip
#goodnessSquad
That'd be awesome!