Mixed
Type parameters
Properties
Value
new ( args: ConstructorParameters<Base> ) => Mixin & InstanceType<Base> & { [ K in keyof Base ]?: }
Helper type that creates constructor types from a base class and a mixin interface.
interface MyMixinInterface {
mixinMethod(): void;
}
function MyMixin<Base extends Constructor>( base: Base ): Mixed<Base, MyMixinInterface> {
// ...
}
class BaseClass {
baseMethod(): void {
// ...
}
}
const MixedClass = MyMixin( BaseClass );
// Contains both `mixinMethod()` and `baseMethod()`.
const myObject = new MixedClass();
myObject.mixinMethod();
myObject.baseMethod();
Base : extends ConstructorA type of constructor of a class to apply mixin to.
MixinAn interface representing mixin.
prototype : Mixin & InstanceType<Base>module:utils/mix~Mixed#prototype new ( args: ConstructorParameters<Base> ) => Mixin & InstanceType<Base> & { [ K in keyof Base ]?: }