JSteunou / webstomp-client

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

Fix strictNullChecks incompatibility #49

Closed noelblaschke closed 7 years ago

noelblaschke commented 7 years ago

The ConnectionHeaders interface does not work with strict: true or strictNullChecks: true.

Though this point needs further investigation on TypeScript itself, this should help to have type suggestions on ConnectionHeaders in strict mode.

If this isn't consistent enough the only solution (afaik) is to remove the optional keys and the undefined key definition. In this case you will lose the type suggestion:

export interface ConnectionHeaders {
  [key: string]: string;
}

Related to: https://github.com/Microsoft/TypeScript/issues/17277

If you agree to these changes, dont forget to bump the version 🥇

JSteunou commented 7 years ago

I agree to the changes because I trust you guys to maintain your own typescript stuff.

If you can enlight me on this one #47 also it would be great!