-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Support for Mix-in classes: can not export mixing function from a module #15313
Comments
Duplicate of #15066. |
This issue seems to have been already addressed or is unactionable at the moment. I am auto-closing it for now. |
Thanks very much. I used it with typescript version 2.6.1. It works like a charm. Even allows to extend later the mixed classes. |
Yes, it works, but the problem that i need to have a constructor. This mixing works only on classes. EcmaScript6 now has a Proxy object, which can be used to add properties, methods to a given object, thus adding members to the interface. I can not use this mixing function in this case. Types union does not work either, because T | U type is not the same as T extends U. |
I've found that typescript has intersection types Type1 & Type2. I did not noticed it before. It is perfect for mixing. |
TypeScript Version: 2.2
Code
Expected behavior:
Should be no error. The function returns a class which implements interface. It should be treated by compiler as original Base class which supports ITagged interface. Otherwise this mixing is useless.
Actual behavior:
Error Build:Return type of exported function has or is using private name '(Anonymous class)'
The text was updated successfully, but these errors were encountered: