title: Typescript local storage compatibility
body: <p>Does Typescript somehow compatible with local storage? I set item via:</p>
  
  <pre><code> localStorage.setItem('someString', JSON.stringify(MyTypescriptObject));
  </code></pre>
  
  <p>which stores object as plain string. For example:</p>
  
  <pre><code> private _id: string;
  
   get id(): string {
     return this._id;
   }
   set id(value: string) {
     this._id = value;
   }
  </code></pre>
  
  <p>and when I get it via:</p>
  
  <pre><code>return &lt;MyTypescriptObject&gt;JSON.parse(localStorage.getItem('someString'));
  </code></pre>
  
  <p>I get: </p>
  
  <pre><code>{_id: "1"...}
  </code></pre>
  
  <p>If they are not compatible, I don't see any reason to use Typescript. Even worse, I have to rework all my current code in order to remove it.</p>