If you knew some specific key for an interested Type you can do it via in operator:
function move(pet: Fish | Bird) {
if ("swim" in pet) {
return pet.swim(); //pet is Fish
}
return pet.fly(); //pet is Bird
}
As for me much easier than an additional function with stuff.
That what I was looking for.
Docs.