Adding Methods to a Union of Classes in TypeScript - Effect Community