Add types for lifecycle events.

Ok, once these types are checked in, I'll add a lifecycle.md in a separate PR (or I can do it here if you insist)