title: How do I declare a TypeScript variable as volatile?
body: <p>I am working with the <a href="https://en.wikipedia.org/wiki/Micro_Bit" rel="nofollow noreferrer">BBC Micro Bit</a> and am creating an extension for Make Code in TypeScript.</p>
  
  <p>I have the following event that gets triggered by a wheel encoder on my robot. Inside the event, I increment a couple of variables. In the Arduino language, I would declare such variables as "volatile" indicating that the variable could be changed by an interrupt, thus ensuring that I was working with the most recent value in the variable.</p>
  
  <pre><code>control.onEvent(EventBusSource.MICROBIT_ID_IO_P0, EventBusValue.MICROBIT_PIN_EVT_RISE, function () {
      _lTicks += 1;
      _lerrTicks += 1;
      if (_lTicks % _partialTurn == 0) {
          _lTicks = 0;
          _lTurns += .0625;
      }
  })
  </code></pre>
  
  <p>Does TypeScript have an equivalent "volatile" keyword when declaring a variable? If so, how is it implemented?</p>