typescript check if object is interface type