aurelia / http-client

A simple, restful, message-based wrapper around XMLHttpRequest.
MIT License
62 stars 59 forks source link

Added remaining members of HttpResponseMessage. #81

Closed KarlDirck closed 9 years ago

KarlDirck commented 9 years ago

While content() was included in the HttpResponseMessage interface in TypeScript, While using the class, I feel compelled to check isSuccess (or the statusCode) before consuming the response 'content'. While I was there, I flushed out that class interface.

bryanrsmith commented 9 years ago

Thanks, @KarlDirck. Our .d.ts files are generated from the source, so unfortunately we can't manually modify them. Would you be willing to transfer these changes over to the src/http-response-message.js file where they will be picked up by our generator? You should be able to accomplish the same result by moving some of the properties out of the ctor and into ES7 style class properties.

KarlDirck commented 9 years ago

@bryanrsmith I figured that. I didn't have time yesterday to rework the JS, but I will try to find time to rework them this weekend.

KarlDirck commented 9 years ago

@bryanrsmith Is there a way to use jsDoc comments (unlikely) or another means to carry the types from es7 to TypeScript? It seems the resulting *.d.ts uses any for all properties.

EisenbergEffect commented 9 years ago

If it isn't carrying the properly typed props into the d.ts files, then we may have an issue with our generator. But, I was pretty sure that worked if they were specified.

KarlDirck commented 9 years ago

If you can you provide an example, I'll find some time to implement it in a fork (and subsequent pull request.) As far as I can tell jsDoc comments don't support types, so you must have some extension as I see no docs explaining such a feature.