|
Hmm, I tried this but it gives me syntax errors:
interface Class {
new (args:any): any;
}
class Animal implements Class {
constructor(public name) { }
move(meters) {
alert(this.name + " moved " + meters + "m.");
}
}
The syntax error is on the 'class Animal' line. It says:
Class 'Animal' declares interface 'Class' but does not implement it: Type 'Class' requires a construct signature, but Type 'Animal' lacks one
new(name: any) => Animal
Did I misunderstand your suggestion?
BTW, this gave me a syntax error:
new (... args): any;
Cheers,
- Bernd
|