How can you determine the class type or instance type using a constructor function?
EDIT: Given only the prototype, how can you identify the class type? Refer to the example with decorators.
Class User {}
// It's really disappointing that I have to do this
User.prototype/* Object */.constructor/* Function */
Example using a property decorator:
// This is my code
// I struggle to retrieve the class/instance type from T...
const Prop = <T>({ constructor }: T) => {}
// User's code
class User {
@Prop
photos
}
Thank you