TLDR: Use Mojom Union in TypeScript and C++ - add union to mojom file - in frontend, get union value with if statement - in backend, create mojom pointer object with union type function - check and get union value with u...