I have a tiny code implementation in Typescript where I have a class either implementing an interface or extending a class.
interface ITest {
run(id: number): void
}
abstract class Test implements ITest {
abstract run(id);
}
class TestExtension extends Test
{
constructor() {
super();
}
public run(id) { }
}
class TestImplementation implements ITest {
constructor() {
}
public run(id) { }
}
Both shows wrong Intellisense where I expected id to by of type 'number':
(method) TestExtension.run(id: any): void
(method) TestImplementation.run(id: any): void
I can of course set method implementation to be public(id: number) { }
but I don't see why I have to do this.
Can someone enlighten me, please?