title: Watch route changes in Vue.js with Typescript
body: <p>I'd like to detect changes in my URL in a Vue.js application using TypeScript. In JavaScript this can be done as follows:</p>
  
  <pre><code>watch: {
    '$route': {
       handler: 'onUrlChange',
       immediate: true,
       deep: true
     }
  },
  
  onUrlChange(newUrl){
     // Some action
  }
  </code></pre>
  
  <p>How could I do the same in TypeScript?</p>