I have tried to add a declaration file and a few other things but nothing is working so far:
I basically want to set visible to be a function on the HTML Element object. This is what I have and the linter has visible underlined saying Property 'visible' does not exist on type 'Element'. What am I doing wrong?
Element.prototype.visible = function() {
return (!window.getComputedStyle(this)
|| window.getComputedStyle(this).getPropertyValue('display') == ''
|| window.getComputedStyle(this).getPropertyValue('display') != 'none')
}
I'm using Typescript 3.8