The Republican said he had won after forecasts predicted a comfortable victory over Democrat Kamala Harris.