Add types for lifecycle events.

Expanded the documentation to (hopefully) address these things.