title: Create web notification with timeout
body: <p>How do I create a TypeScript web notification with a set timeout?</p>
  
  <p>I created the following code but doesn't work in closing the notification before the default timeout:</p>
  
  <pre><code>export function createNotification(title: string, body: string) {
      let now: Date = new Date(Date.now());
      let date = now.add(5).seconds();
  
      let options = {
          body: body,
          requireInteraction: false,
          timestamp: date
      };
      new Notification(title, options);
  }
  </code></pre>
  
  <p>As a test I want to create a notification in TypeScript which lasts five seconds, overriding the browsers default behaviour. I can't see any further options listed in the TypeScript typings file which would be helpful to me:</p>
  
  <p><a href="https://i.stack.imgur.com/zziy1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zziy1.png" alt="ES2017 Notification Options"></a></p>
  
  <p>I'm using for developing and testing this software using Chrome, although I use Firefox as my main browser. So any solutions which works correctly in Chrome, but doesn't include hacks or browser specific code would be fine.</p>