Constraining dark matter through 21-cm observations