TypeScript has been kind of abused (`as any`); I am so sorry, we should use it in a better way: * get rid of unnecessary `any` and type assertions * add additional interfaces to enable TS-based code contracts