For example I have an array data
const Arr = [
{
name: 'setTitle',
method: (title: string) => {
return title;
}
},
{
name: 'getName',
method: () => {
return 'hello world';
}
}
];
I want get type like this
type Result = {
setTitle: (title: string) => string;
getName: () => string
}
How to derive it directly from typescript?