Typescript defs for close are missing third argument
See original GitHub issueReconnectingWebsocket
extends WebSocket
but doesn’t redefine the close
method to take the third “options” parameter.
Closing a reconnecting websocket like this:
rws.close(1000, '', opts);
Results in a typescript error; Expected 0-2 arguments, but got 3
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Typescript third party definition file - class missing method ...
I am attempting to use the createAccount() method and the typescript compiler is giving me an error. I'd like to be able to...
Read more >Documentation - More on Functions - TypeScript
Functions are the basic building block of any application, whether they're local functions, imported from another module, or methods on a class.
Read more >Typescript: missing type definitions. · Issue #8642 - GitHub
I am opening this issue to report missing types when I notice that. Here is the first: Cookie options type does not have...
Read more >typescript-cheatsheet - GitHub Pages
In TypeScript any argument of a function may be assigned a type no matter how ... the union types because they have a...
Read more >TypeScript Programming with Visual Studio Code
Signature help. As you write a TypeScript function call, VS Code shows information about the function signature and highlights the parameter that you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I got the same issue with reconnecting-websocket v3.2.2:
Here is my code:
Luckily there is a workaround:
Source: https://github.com/wireapp/wire-web-packages/pull/114
@pladaria I checked the “close” function of v4.2.0 and it is defined to accept only 2 parameters (“code” and “reason”), so I guess there is no more support for a third (“options”) parameter?