title: TypeScript constructor - ambient contexts error
body: <p>How do I create a constructor in TypeScript?</p>
  <p>Looked at a bunch of guides, but the syntax must've changed. Here's my latest attempt:</p>
  <h3>car.d.ts</h3>
  <pre><code>declare class Car {
      constructor(public engine: string) {
          this.engine = engine + &quot;foo&quot;;
      }
  }
  </code></pre>
  <h2>Error:</h2>
  <blockquote>
  <p>An implementation cannot be called in ambient contexts.</p>
  </blockquote>