US President Donald Trump has warned that impeaching him would damage the Democratic Party, after Republicans suffered major losses in the midterm elections.