I have a setTimeout callback but when i put this inside another function, I'm getting an error with tsc
:
function delayedSnapshot() {
setTimeout( function() {
var filename = "/Users/dc/dump/heapdump.heapsnapshot";
heapdump.writeSnapshot(function(err, filename) {
console.log("dump written to", filename);
});
process.exit(1);
}, 5000);
}
>> error TS2384: Overload signatures must all be ambient or non-ambient.
If i remove the outer wrapping delayedSnapshot
it will compile fine however.
I found something here on what ambient means but it doesn't seem relevant.
http://www.typescriptlang.org/Handbook#modules-working-with-other-javascript-libraries
can someone explain how I stop this error from happening but still keep my wrapper to control the callback firing or not?