Created
April 1, 2017 00:18
-
-
Save appsforartists/dd8f07e0c7c78f14e08e4c2647737fd2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Constructor<T> = new(...args: any[]) => T; | |
export interface B { | |
fromB(): void; | |
} | |
export function withB<T extends Constructor<object>>(superclass: T): Constructor<B> { | |
return class B extends superclass { | |
fromB() { | |
} | |
}; | |
} | |
export class A extends withB(C) { | |
} | |
export class C { } | |
const a = new A(); | |
a.fromB(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment