typewiz icon indicating copy to clipboard operation
typewiz copied to clipboard

Check whether an existing named type is available to apply

Open MadaraUchiha opened this issue 7 years ago • 1 comments

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

MadaraUchiha avatar Mar 21 '18 17:03 MadaraUchiha

That'd be awesome!

urish avatar Mar 23 '18 23:03 urish