Closed
Description
Ambient class declarations implementing an interface require the user to repeat the type members declared in the interface.
For example with the interface
interface IFoo {
bar: string;
qux(): number;
}
an ambient declaration of Foo
as
declare class Foo implements IFoo {}
fails with Class 'Foo' incorrectly implements interface 'IFoo'. Property 'bar' is missing in type 'Foo'
, while the following works as expected, but duplicates all declarations:
declare class Foo implements IFoo {
bar: string;
qux(): number;
}
While it should be possible to specialise when declaring an ambient class, it would be very convenient if unchanged type members would not need to be redeclared.