-
Notifications
You must be signed in to change notification settings - Fork 970
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
reconnecting-websockets.d.ts does not compile #44
Comments
I'm not familiar with typescript. Do you know the fix? |
Thank you for the very fast fix! It works as expected. |
The problem is actually not solved. Unfortunately my Reference.ts was still referencing the older version that did not include the error. That's why I thought it was resolved. The ts compiler throws an error because of the question mark in line 39 of the reconnecting-websockets.d.ts (maxReconnectAttempts). It is illegal to use optional attributes in classes. They are only allowed in interfaces. Please change that. Since I use bower and cannot define the used version, I have to exclude reconnecting-websocket from the bower dependencies as long as it is not fixed properly. |
I would suggest to use a Typescript interface instead of a Typescript class. That should fix the error and it should be possible since you are only describing the interface (or type). |
This typescript file is making it harder to contribute to this project. Many contributions forget about it altogether, those that don't often don't know how to test it as they're not familiar with typescript. My preference would be to remove it from this repository and allow other maintainers to keep it up to date in downstream forks if they want it. Thoughts? Keep or delete? /cc @drewnoakes |
That would be fine for me. |
I've just learned about https://github.com/borisyankov/DefinitelyTyped - a 3rd party repository of typescript definitions. If there's need for this file, it can be recreated there. |
We actually use DefinetlyTyped. Thank you very much for solving the issue. Deletion of the file is perfect. |
Seems reasonable. Relying on Definitely Typed is a decent approach. Only [via phone]
|
The reconnecting-websockets.d.ts does not compile anymore after the inclusion of "public maxReconnectAttempts?: number;" into the code.
At least the TS 1.4.1 compiler complains with the following message:
"error TS1112: A class member cannot be declared optional."
The text was updated successfully, but these errors were encountered: