title: Add property to HtmlElement
body: <p>[[WARNING]]: It looks like the question <a href="https://stackoverflow.com/questions/52590162/typescript-add-type-property-to-htmlelement">TypeScript: add type property to HtmlElement</a> but I need to add a function to an Element Object but not add an attribute to a Node.</p>
  <p>I try to make JavaScript to TypeScript but I am new with TypeScript, I try to add a new
  function to <code>el.clickOutsideEvent</code>, but ts do not allow me to do like this:</p>
  <pre class="lang-js prettyprint-override"><code>Vue.directive('click-outside', {
    bind: function (el: HTMLElement, binding: Object, vnode: VNode) {
      // stack-overflow: https://stackoverflow.com/a/42389266/13031497
      el.clickOutsideEvent = function (event: MouseEvent): void {
        if (!(el == event.target) ||
              event.target instanceof Node &amp;&amp; el.contains(event.target)) {
          vnode.context[binding.expression](event);
        }
      }
      // ugly, but fix the bug:
      // 2020/11/20 - Peterlits Zo
      // When I click the the ellipsis-h buttom, it do not change anything.
      // I find that itself call this function auto, so I add this after times.
      setTimeout(() =&gt; {
        document.body.addEventListener('click', el.clickOutsideEvent)
      }, 50)
    },
    unbind: function (el: HTMLElement) {
      document.body.removeEventListener('click', el.clickOutsideEvent)
    },
  })
  </code></pre>
  <p>It tell me that: <code>Property 'clickOutsideEvent' does not exist on type 'HTMLElement'.</code> and something else.</p>
  <p>What should I do for it?</p>