Open
Description
TypeScript Version: 2.1.5
Code
// A *self-contained* demonstration of the problem follows...
// ===== file Foo.ts =====
export default class Foo {
hello() {
console.log('Foo');
}
}
// ===== file Bar.ts =====
import Foo from './Foo';
declare module './Foo' {
interface Foo {
add(x, y);
}
}
// ERROR: 'add' does not exist in type Foo.
Foo.prototype.add = function (x, y) { return x + y; };
let f = new Foo();
f.hello();
f.add(3, 4); // ERROR: 'add' does not exist in type Foo.
Expected behavior:
If the class Foo is exported without default in file Foo.ts, and then import {Foo} from './Foo',
it works correctly as example in doc http://www.typescriptlang.org/docs/handbook/declaration-merging.html
Hope import Foo same as import {Foo} behaviors.
Actual behavior:
ERROR message showed.