This seems like a bit of an old question, but anyway I stumbled upon it and skipped this other answer that I bring.
From TypeScript 1.4, it seems that you can declare several possible types for a function parameter as follows:
class UtilsClass { selectDom(element: string | HTMLElement):Array<HTMLElement> {
This is due to the new TypeScript concept of "union-types".
Here you can see more.
Blasfemizer
source share