Make difficult TypeScript types precise and compiler-clean.
Recent revisions are kept. Restoring one creates a new revision.