How to have multiple possible types for function argument

Is it possible to have an input to typescript function with more than one possible input type?
myFunction(arg:objectA | objectB)?

Yes. You can. Can pass multiple objects in function, just like in Java. Can use these object values for condition check, calculations. Even typescrit support method overloading and method overridding like in Java.