23 lines
382 B
TypeScript
23 lines
382 B
TypeScript
|
class Abstract {
|
||
|
protected constructor() {
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class Concrete extends Abstract {
|
||
|
}
|
||
|
|
||
|
type Constructor<T = {}> = new (...args: any[]) => T;
|
||
|
|
||
|
function Mixin<TBase extends Constructor>(Base: TBase) {
|
||
|
return class extends Base {
|
||
|
};
|
||
|
}
|
||
|
|
||
|
class Empty {
|
||
|
}
|
||
|
|
||
|
class CrashTrigger extends Mixin(Empty) {
|
||
|
public trigger() {
|
||
|
new Concrete();
|
||
|
}
|
||
|
}
|