In this case when you migrate the typescript classes all your variables names must suddenly be prefixed with this keyword.
Problem is that this in callbacks is going to be the window object.
So you need to convert functions (being passed as an argument into another function ... i.e. a callback) that look like:
Into arrow functions: