We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version: 1.8.10 & 2.0.0@beta
I follow the example in Module Augmentation and write below code. The only different is that I use export statement in someclass.ts.
someclass.ts
// someclass.ts class SomeClass { } export {SomeClass} // augmented.ts import { SomeClass } from "./someclass"; declare module "./someclass" { interface SomeClass { hello(): void; } } SomeClass.prototype.hello = function() { return this; } // consumer.ts import { SomeClass } from "./someclass"; import "./augmented"; new SomeClass().hello();
It gives compile error:
augmented.ts(7,1): error TS2304: Cannot find name 'SomeClass'. consumer.ts(3,5): error TS2304: Cannot find name 'SomeClass'. someclass.ts(6,1): error TS2484: Export declaration conflicts with exported declaration of 'SomeClass'
I change back someclass.ts to use declaration export, then compile success.
// someclass.ts export class SomeClass { }
Suppose two export forms should behave the same. Is it a bug?
The text was updated successfully, but these errors were encountered:
Duplicate of #9127
Sorry, something went wrong.
No branches or pull requests
TypeScript Version: 1.8.10 & 2.0.0@beta
I follow the example in Module Augmentation and write below code. The only different is that I use export statement in
someclass.ts
.It gives compile error:
I change back
someclass.ts
to use declaration export, then compile success.Suppose two export forms should behave the same. Is it a bug?
The text was updated successfully, but these errors were encountered: