title: Convert a variable to T in TypeScript generic methods?
body: <p>I have the following <code>typescript</code> class, to get a model from <code>localStorage</code></p>
  
  <pre><code>export class LocalStorageHelper {
      public static GetItemValue&lt;T&gt;(key: string): T {
          let value: string = localStorage.getItem(key);
          // if(typeof T == 'string') return value;
          // return (Convert JSON.parse(value) To T)
      }
  }
  </code></pre>
  
  <p>How can I do something like comment lines in TypeScript?</p>