Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NaridaL/08160f049a41c72cb54892f38eef6a86 to your computer and use it in GitHub Desktop.
Save NaridaL/08160f049a41c72cb54892f38eef6a86 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