In JavaScript, I can overwrite a function:
function testf() {
console.log('old function')
}
testf = function() {
console.log("new function");
}
How can I do this in TypeScript? I'm writing a WebP polyfill and would like to overwrite the global createImageBitmap function, but tsc complains:
Cannot assign to 'createImageBitmap' because it is not a variable.