chore: add types and some comments.