typescript union type check interface