Closed
Description
type Constructor<T> = new (...args: any[]) => T;
export const Timestamped = <CT extends Constructor<object>>(Base: CT) => {
return class extends Base {
timestamp = new Date();
};
}
Expected: It just works
Actual: It doesn't work - I get an error on Base
in the extends clause stating that object
is not a class or interface type.
This makes little sense given that this is a better restriction than {}
.