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

Return type of public static method from exported class has or is using private name 'BaseWithPlugins' #1

Closed
gr2m opened this issue Oct 29, 2019 · 3 comments · Fixed by #2
Labels
bug Something isn't working help wanted Extra attention is needed released

Comments

@gr2m
Copy link
Owner

gr2m commented Oct 29, 2019

running tsc index.ts --declaration currently throws an error

> tsc index.ts --declaration

index.ts:25:10 - error TS4052: Return type of public static method from exported class has or is using private name 'BaseWithPlugins'.

25   static plugin<T extends TestPlugin | TestPlugin[]>(plugin: T) {
            ~~~~~~

I'm not sure how to fix that problem yet, help much appreciated!

@gr2m gr2m added bug Something isn't working help wanted Extra attention is needed labels Oct 29, 2019
@karol-majewski
Copy link
Collaborator

Do this:

- class BaseWithPlugins extends this {
+ const BaseWithPlugins = class extends this {

but don't ask me why this works because I have no idea. 🙏

@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@trusktr
Copy link

trusktr commented Dec 21, 2019

I've opened a request to fix issues like these in TypeScript by bringing declaration files to parity with language features. microsoft/TypeScript#35822

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed released
Projects
None yet
3 participants