You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to typescript and I'm wondering why not typescript add the class shape interface likes example below?
interfaceInstanceInterface{foo: string;bar(): string;}interfaceClassInterface{// the constructor shapenew(foo: string): InstanceInterface;// default static methodbaz(): void{console.log('I come from interface.')}}// We get hints guiding us to implement the constructor and static properties and static methods.classCls: ClassInterfaceimplementsInstanceInterface{constructor(foo: string){this.foo=foo}staticbaz(): void{console.log('I override the interface baz.')}foo: stringbar(): string{returnthis.foo}}
As I know, Java8 added the static method defining and default implements.