Uh oh!
There was an error while loading. Please reload this page.
Merged Declarations for Classes and Interfaces - #3333
Conversation
This reverts commit 813d227.
msftclas
commented
Jun 1, 2015
Hi @aozgaa, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
There was a problem hiding this comment.
This isn't exported, so you don't need this.
There was a problem hiding this comment.
Nit: Can you put single quotes around node just so this reads easier? Thanks!
There was a problem hiding this comment.
If you do the other change I suggested (https://github.com/Microsoft/TypeScript/pull/3333/files#r31552915), then this goes away, and ClassExcludes becomes (Value | Type) & ~(ValueModule | Interface)
There was a problem hiding this comment.
why not just letting classes and interfaces merge, and reporting an error later on in CheckClassDeclaration for instance if the class is not ambient? just like we do with merging order for module/class and module/class being in different files.
There was a problem hiding this comment.
should not this be inAmbientContext instead?
JsonFreeman
commented
Jun 4, 2015
👍 |
aozgaa
commented
Jun 17, 2015
Thoughs @mhegazy, @ahejlsberg ? |
There was a problem hiding this comment.
Remove the leading space if you get the chance.
DanielRosenwasser
commented
Jun 18, 2015
There are apparently some issues with the build - you probably need to fix up baselines that don't agree with the merge. |
aozgaa
commented
Jun 18, 2015
@DanielRosenwasser The error codes needed to be changed as part of merging the upstream fixes and this broke some of the baselines. No other errors occurred. They've been added now :). |
mhegazy
commented
Jun 23, 2015
👍 |
1 similar comment
DanielRosenwasser
commented
Jun 23, 2015
👍 |
Merged Declarations for Classes and Interfaces
DanielRosenwasser
commented
Aug 13, 2015
This should be added to the |
heycalmdown
commented
Oct 4, 2015
How does this work with imported module? When I have like this application.ts import*asamqpfrom'amqplib';// I want to merge declaration with `interface amqp.ExchangeOptions`interfaceExchangeOptions{'x-recent-history-length' : number;}interfaceamqp.ExchangeOptions{'x-recent-history-length' : number;}Which one should work? |
JsonFreeman
commented
Oct 5, 2015
Neither one of those would work here. You'd need to do the following: declare module 'amqplib'{interfaceExchangeOptions{'x-recent-history-length' : number;}} |
heycalmdown
commented
Oct 7, 2015
Thanks! |
masaeedu
commented
Jan 14, 2016
@JsonFreeman Is there an equivalent for external modules? |
mhegazy
commented
Jan 14, 2016
nbransby
commented
Apr 9, 2016
This doesn't appear to be possible but feels like it should: interfaceFoo{readonlyname: string}classFoo{constructor(name: string){this.name=name;//error}} |
DanielRosenwasser
commented
Apr 9, 2016
@nbransby thanks, I'll open an issue for you. |
This implements the proposal in #3332.