Advanced. You are correct that standard declaration merging is static. The solution here is to use Generics combined with Intersection Types (&) to create a type-safe "mixin" function.
This function won't change the original class declaration, but it will return a new class constructor whose instances are correctly typed to include both the original class and the mixin object. Help that helps.