I've been diving into the Class Types section of the Typescript Handbook and I'm facing a bit of confusion when it comes to defining an interface for a Class. While I grasp that an interface can define the "instance" side of the Class, I'm uncertain about how to describe the "static" side using an interface.
Let's consider this example:
interface IPerson {
name: string;
getName(): string;
}
class Person implements IPerson {
public name: string;
constructor(name: string) {
this.name = name;
}
public getName() {
return this.name;
}
}
In this scenario, how would you adjust IPerson
to also encompass the constructor function?