Consider a.d.ts (which compiles fine in isolation) without any error:
declare module "foo" {
interface Foo {
a: number;
}
var _:Foo;
export = _;
}
And b.d.ts that plans to add stuff to module foo's Foo interface:
/// <reference path="./a"/>
declare module "foo" {
interface Foo {
b: number;
}
}
With this we have two errors:
a.d.ts gets an error on export = "An export assignment cannot be used in a module with other exported elements.
b.d.ts doesn't actually manage to add to the interface Foo as demonstrated by a test file test.ts:
/// <reference path="./a"/>
/// <reference path="./b"/>
import foo = require("foo");
foo.b = 123; // ERROR: Property b to not exist on type Foo
Discovered in DefinitelyTyped : DefinitelyTyped/DefinitelyTyped#4101 /cc @vvakame
Consider
a.d.ts(which compiles fine in isolation) without any error:And
b.d.tsthat plans to add stuff to modulefoo'sFoointerface:With this we have two errors:
a.d.tsgets an error onexport ="An export assignment cannot be used in a module with other exported elements.b.d.tsdoesn't actually manage to add to theinterface Fooas demonstrated by a test filetest.ts:Discovered in DefinitelyTyped : DefinitelyTyped/DefinitelyTyped#4101 /cc @vvakame