function createdAt<T extends {new (...args: any[]) : {}}>(constructor: T){
return class extends constructor {
createdAt = new Date()
}
}
<T extends {new (...args: []): {}}>
function createdAt<T extends {new (...args: any[]) : {}}>(constructor: T){
return class extends constructor {
createdAt = new Date()
}
}
class A {
constructor() {
}
}
createdAt(A);