Update type docs to 0.4-dev

Building upon #8658, this PR contains updates to the type documentation for 0.4-dev.

With this PR and #8658, the doctests now pass on 0.4-dev.

Submitting as separate PR since the proposed changes might be more controversial.