I'm converting coffeescripts to typescript and have trouble with one simple delay type function.
The coffeescript:
ise.utils.delay = (->
timer = 0
(callback, ms) ->
clearTimeout timer
timer = setTimeout(callback, ms)
)()
The produced javascript:
ise.utils.delay = (function() {
var timer;
timer = 0;
return function(callback, ms) {
clearTimeout(timer);
return timer = setTimeout(callback, ms);
};
})();
When I enter the produced js into a typescript file I get a compile error.
I can't figure out what is wrong.