Add types for lifecycle events.

Agree with that, it's also hard to see how TCPSocket connect is a valid lifecycle handler.