title: How to use typeof with anonymous types in TypeScript?
body: <p>I read this <a href="https://blog.mariusschulz.com/2016/05/31/type-queries-and-typeof-in-typescript" rel="nofollow noreferrer">article</a> and I don't quite understand a real world use case and what I can use typeof for. I realise they're for anonymous types but does anyone have any ideas for real world use case?</p>
  
  <p>Thank you!</p>
  
  <p>Here's the code from the article for quick viewing.</p>
  
  <pre><code>let rectangle1 = { width: 100, height: 200 };
  
  // Obtain the type of `rectangle1` and call it `Rectangle`
  type Rectangle = typeof rectangle1;
  
  let rectangle2: Rectangle;
  </code></pre>