Skip to content

Instantly share code, notes, and snippets.

@NaridaL
Created May 6, 2017 04:17
Show Gist options
  • Save NaridaL/052300d2df673ade7dd050682b5d8ded to your computer and use it in GitHub Desktop.
Save NaridaL/052300d2df673ade7dd050682b5d8ded to your computer and use it in GitHub Desktop.
// A.ts
abstract class A {
public static create(t: boolean) {
//noinspection TsLint
const b = new D();
return t ? new B() : new C();
}
abstract foo(): string
abstract bar(): string
con(): string {
return 'con'
}
}
export default A
// B.ts
import A from './A';
export default class B extends A {
foo() {
return 'B here';
}
bar(): string {
return null;
}
}
// D.ts
import B from './B';
const a = new B().con()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment