title: Typescript interface default values
body: <p>I have the following interface in TypeScript:</p>
  
  <pre><code>interface IX {
      a: string,
      b: any,
      c: AnotherType
  }
  </code></pre>
  
  <p>I declare a variable of that type and I initialize all the properties</p>
  
  <pre><code>let x: IX = {
      a: 'abc',
      b: null,
      c: null
  }
  </code></pre>
  
  <p>Then I assign real values to them in an init function later</p>
  
  <pre><code>x.a = 'xyz'
  x.b = 123
  x.c = new AnotherType()
  </code></pre>
  
  <p>But I don't like having to specify a bunch of default null values for each property when declaring the object when they're going to just be set later to real values. Can I tell the interface to default the properties I don't supply to null? What would let me do this:</p>
  
  <pre><code>let x: IX = {
      a: 'abc'
  }
  </code></pre>
  
  <p>without getting a compiler error. Right now it tells me</p>
  
  <blockquote>
    <p>TS2322: Type '{}' is not assignable to type
    'IX'.  Property 'b' is missing in type '{}'.</p>
  </blockquote>