Skip to content
New issue

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

Cannot export class descending from eventemitter3 #8089

Closed
ndarilek opened this issue Apr 14, 2016 · 5 comments
Closed

Cannot export class descending from eventemitter3 #8089

ndarilek opened this issue Apr 14, 2016 · 5 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@ndarilek
Copy link

I'm trying to accomplish this but am told:

src/index.ts(3,35): error TS4020: Extends clause of exported class 'Test' has or is using private name 'EventEmitter'.

I'm new to Typescript, so in an attempt to do the right thing I went out and read a bunch of docs. My understanding was that I needed to somehow export EventEmitter so the module has everything it needs available publicly. So I tried every export form I could think of, but nothing worked.

I did even more research and discovered DefinitelyTyped/DefinitelyTyped#7439. This is exactly what I'm experiencing, along with a second test repo which seems to indicate that this problem goes away with an older declaration. This all leaves me wondering, as a new Typescript user, where the issue lies.

Later I found #6307, asked for guidance there, and was told to file another issue. So, here it is. :) Is this an issue in the official eventemitter3 declaration that they need to fix, or is it a TS bug? I'll note that everything seems to work as long as I don't export the class that descends from EventEmitter, so if there was a problem with the declaration then I'd expect that to surface regardless of whether I exported the subclass.

Thanks. Using Typescript 1.8.9.

@RyanCavanaugh
Copy link
Member

Can you include the self-contained repro as well? Thanks!

@ndarilek
Copy link
Author

ndarilek commented Apr 14, 2016 via email

@mhegazy
Copy link
Contributor

mhegazy commented Apr 14, 2016

looks like it is fixed in latest. can you give typescript@next a try.

@mhegazy mhegazy closed this as completed Apr 14, 2016
@mhegazy mhegazy added Fixed A PR has been merged for this issue Bug A bug in TypeScript labels Apr 14, 2016
@mhegazy mhegazy added this to the TypeScript 2.0 milestone Apr 14, 2016
@ndarilek
Copy link
Author

ndarilek commented Apr 14, 2016 via email

@mhegazy
Copy link
Contributor

mhegazy commented Apr 14, 2016

thanks for verifying.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants