Merging ambient class and interface declaration

The instance side of an ambient class declaration can be extended using an interface declaration The class constructor object is unmodified. For example:

  1. declare class Foo {
  2. public x : number;
  3. }
  4. interface Foo {
  5. y : string;
  6. }
  7. function bar(foo : Foo) {
  8. foo.x = 1; // OK, declared in the class Foo
  9. foo.y = "1"; // OK, declared in the interface Foo
  10. }