title: Property does not exist on interface
body: <p>I'm confused about how interfaces work in TypeScript.</p>
  
  <p>Here's a chunk of code: </p>
  
  <pre><code>interface test1 {
  }
  
  class test2 implements test1
  {
      public foo;
  }
  
  let test: test1 = new test2();
  
  test.foo = 'test';
  </code></pre>
  
  <p>It will not compile and give the error "Property foo does not exist on type test1. So does that mean that when you implement an interface in TypeScript, you can only use the properties and methods declared in the interface?</p>
  
  <p>I'm confused because i'm used to PHP and this will not cause any error in PHP.</p>