* Add support for abstract constructor types * Add backwards-compatible overloads for creating/updating constructor types * Reverting use of 'abstract' in lib/es5.d.ts due to eslint issues * Update baseline due to reverting lib * Add error for failing to mark an mixin class as abstract * Fix declaration/quick info for abstract construct signatures
25 lines
686 B
TypeScript
25 lines
686 B
TypeScript
// @target: esnext
|
|
// @declaration: true
|
|
|
|
interface Mixin1 {
|
|
mixinMethod(): void;
|
|
}
|
|
|
|
abstract class AbstractBase {
|
|
abstract abstractBaseMethod(): void;
|
|
}
|
|
|
|
function Mixin2<TBase extends abstract new (...args: any[]) => any>(baseClass: TBase) {
|
|
// must be `abstract` because we cannot know *all* of the possible abstract members that need to be
|
|
// implemented for this to be concrete.
|
|
abstract class MixinClass extends baseClass implements Mixin1 {
|
|
mixinMethod(): void {}
|
|
static staticMixinMethod(): void {}
|
|
}
|
|
return MixinClass;
|
|
}
|
|
|
|
class DerivedFromAbstract2 extends Mixin2(AbstractBase) {
|
|
abstractBaseMethod() {}
|
|
}
|