President Trump has spent months waging an unusually aggressive campaign to reshape how states run elections.