Already been mentioned, but you would have to be in reasonable fear for you own safety.
The scenario of burgler in shed is quite broad, there are many more circumstances to consider. Was he armed? Did he come for you? Were they alone? Even what time of day was it?
Essentially any injury you inflic on them is instantly assault. It is weather you could raise the nessesary defence. Two key points are, you would have to be in the firm belief you were about to be assaulted yourself AND you should only use reasonable force.
See the recent case of that businessman who was jailed for assaulting a burgular. Quite rightly too.