Adding type annotations to the library would be helpful for those into type checking. This can avoid type errors. I can create separate PRs for this as it is simple enough :-) Do you think this is a good idea?