title: Safe way to extract property names
body: <p>I'm looking for a way to get an object property name with typechecking that allows to catch possible regressions after refactoring. </p>
  
  <p>Here's an example: the component where I have to pass the property names as strings and it will be broken if I'll try to change the property names in the model.</p>
  
  <pre><code>interface User {
     name: string;
     email: string;
  }
  
  class View extends React.Component&lt;any, User&gt; {
  
     constructor() {
        super();
        this.state = { name: "name", email: "email" };
     }
  
     private onChange = (e: React.FormEvent) =&gt; {
        let target = e.target as HTMLInputElement;
        this.state[target.id] = target.value;
        this.setState(this.state);
     }
  
     public render() {
        return (
           &lt;form&gt;
              &lt;input
                 id={"name"}
                 value={this.state.name}
                 onChange={this.onChange}/&gt;
              &lt;input
                 id={"email"}
                 value={this.state.email}
                 onChange={this.onChange}/&gt;
              &lt;input type="submit" value="Send" /&gt;
           &lt;/form&gt;
        );
     }
  }
  </code></pre>
  
  <p>I'd appreciate if there's any nice solution to solve this issue.</p>