May's announcement that she will resign on June 7 puts an end to months of speculation over her future because of her handling of Brexit.