Let's say we have following code:
interface SomethingLike {
ping(): boolean;
}
declare namespace Api {
class Something implements SomethingLike {
constructor(descriptor: string);
ping(): boolean;
}
}
In this particular case Something
implements SomethingLike. Now let's rename SomethingLike to Something:
interface Something {
ping(): boolean;
}
declare namespace Api {
class Something implements Something {
constructor(descriptor: string);
ping(): boolean;
}
}
In this case class Something actually does not implements interface but rather implements ... itself in that sense that the heritage clause is resolved as class something (you can check this by invoking or just use go to definition in either Webstorm or Visual Studio Code).
The very fact that class in Typescript can implement itself surprises me a lot, however my question is - how can still I inherit from an eponymous classlike entity out of namespace?