JSteunou / webstomp-client

Stomp client over websocket for browsers
Apache License 2.0
299 stars 59 forks source link

Update Frame typings #54

Closed roddolf closed 6 years ago

roddolf commented 7 years ago

I update the typings to include the properties of a Frame, and Message to inherit these properties.

I also expose the connected flag in the Client class. I don't know if the other properties are meant to be private, but at least I think this property is useful, so that is the only one I added.

JSteunou commented 7 years ago

@noelblaschke @mitkpl @JimiC as you are all concerned by the index.ts, are you ok with that ?

JimiC commented 7 years ago

I'm currently out of town. Will get back to you on Monday. From a sneak peek I had at it, I may have some objections.

JimiC commented 6 years ago

As I'm back earlier, I did the review and expressed my proposed changes.

roddolf commented 6 years ago

Added changes for the Client class.

In the case of the Frame class, think this should be left generic since it can receive any of the headers' interfaces already declared and more. So I returned the ExtendedHeaders to the Message interface.

roddolf commented 6 years ago

Also changed the disconnectCallback as optional since the code allow it.

JimiC commented 6 years ago

@roddolf

And while we are doing changes, if I recall correct new tslint rules dictate that Array<string> types should be declared as string[]. So, if it's not much to ask could you change that as well?

JimiC commented 6 years ago

OK. Last thing. As discussed here we should also expose the debug function. So could you also add debug(...args: any[]): void; in Client?

JimiC commented 6 years ago

And your name and email in "// Definitions by: " section. You deserve some credits.

roddolf commented 6 years ago

Ready, thanks @JimiC

Just, if the other pull request is merged, the definitions of the marshall method must be updated too, right?

JimiC commented 6 years ago

Yes. But the other PR is debatable.

JimiC commented 6 years ago

@JSteunou We are done here. Sorry for making your life miserable today. The fact though that other devs are iterating over the types is an indication that your library is gaining popularity among the typescript community. Joy.