interface Inter{
str:string
}
function func(){
let v:Inter={
str:'abc'
};
return v;
}
func()//Is there a way to ensure that the type of value returned from `func` is {str:'abc'} without explicitly declaring it in the code?
The expected return type of func is {str:'abc'}
, but I want to achieve this without directly stating {str:'abc'}
in the code.