xxxxxxxxxx
interface You {
name: string;
value: number;
}
interface FooYou {
name: 'foo';
}
interface ConcreteFooYou extends You, FooYou {
concrete: boolean;
}
xxxxxxxxxx
function applyMixins(derivedCtor: any, baseCtors: any[]) {
baseCtors.forEach(baseCtor => {
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
if (name !== 'constructor') {
derivedCtor.prototype[name] = baseCtor.prototype[name];
}
});
});
}