creating a dynamic union in typescript.

thanks to automatic type narrowing, a properly discriminated union is an incredibly powerful tool to model data in typescript. unfortunately, as the model grows more complex, it becomes increasingly easy to disrupt the key discriminators of the union - and equally becomes a point of contention for vcs conflicts.