Obtaining a method's parameter types using ReflectAPI is simple:
Reflect.getMetadata('design:paramtypes', target, propertyKey);
However, the challenge arises when trying to retrieve a function's parameter types as it constantly returns undefined. I tested this with various example functions:
const foo = (bar: Bar) => void 0;
function foo(bar: Bar) {}
export function foo(bar: Bar) {}
I also discovered that TypeScript only generates metadata when a class and method are decorated. So, how can one obtain a function's metadata?