For next patch: move types into typescript, out of comments.