Add type annotations for some methods and properties in the module API.