title: Type definition in object literal in TypeScript
body: <p>In TypeScript classes it's possible to declare types for properties, for example:</p>
  
  <pre><code>class className {
    property: string;
  };
  </code></pre>
  
  <p>How do declare the type of a property in an object literal?</p>
  
  <p>I've tried the following code but it doesn't compile:</p>
  
  <pre><code>var obj = {
    property: string;
  };
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <blockquote>
    <p>The name 'string' does not exist in the current scope</p>
  </blockquote>
  
  <p>Am I doing something wrong or is this a bug?</p>