I have the following generic function and I want to replace any with < T >.
export const deleteFile = async (item: any, propName: string) => {
const url = item[propName];
await deleteFileByUrl(url);
return omit<any>(item, propName);
};
I struggle to define a T which has a [propName]: string property and then return a type T without that property.