Corrected TypeScript type definitions so that both HTTP and HTTPS servers are supported #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Hey @thedillonb and thanks for your work on
http-shutdown
!I use it as part of the Serenity/JS project to allow people to manage local test servers.
I noticed that the change introduced in version 1.2.1 breaks backwards compatibility and prevents TypeScript code from passing a HTTPs server to
http-shutdown
.In order to address that issue, the type of the
Server
object needs to be changed fromhttp.Server
tonet.Server
.That's because in the inheritance chain, the
net.Server
type is the first common element:https.Server -> tls.Server -> net.Server -> events.EventEmitter
http.Server -> net.Server -> events.EventEmitter
Please let me know if your happy with this PR or if you'd like me to provide any additional details!
I've tested
http-shutdown
to death in the context of Serenity/JS, so am fairly confident that the only issue that needs addressing is the type definitions :-)All the best,
Jan