angular-docs-cn/packages/http/src
Alex Rickabaugh c2d31fb01e fix(http): move destructuring inside {Request,Response}Options ctor
Previously the RequestOptions/ResponseOptions classes had constructors
with a destructured argument hash (represented by the
{Request,Response}OptionsArgs type). This type consists entirely of
optional members.

This produces a .d.ts file which includes the constructor declaration:

constructor({param, otherParam}?: OptionsArgs);

However, this declaration doesn't type-check properly. TypeScript
determines the actual type of the hash parameter to be OptionsArgs | undefined,
which it then concludes does not have a `param` or `otherParam` member.

This is a bug in TypeScript ( https://github.com/microsoft/typescript/issues/10078 ).
As a workaround, destructuring is moved inside the method, where it does not produce
broken artifacts in the .d.ts.

Fixes #16663.
2017-06-09 14:34:39 -07:00
..
backends fix(http): Update types for TypeScript nullability support 2017-04-18 12:07:33 -07:00
base_request_options.ts fix(http): move destructuring inside {Request,Response}Options ctor 2017-06-09 14:34:39 -07:00
base_response_options.ts fix(http): move destructuring inside {Request,Response}Options ctor 2017-06-09 14:34:39 -07:00
body.ts fix(http): introduce encodingHint for text() for better ArrayBuffer support 2017-05-05 14:20:36 -04:00
enums.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
headers.ts fix(http): Update types for TypeScript nullability support 2017-04-18 12:07:33 -07:00
http.ts fix(http): Update types for TypeScript nullability support 2017-04-18 12:07:33 -07:00
http_module.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
http_utils.ts fix(http): introduce encodingHint for text() for better ArrayBuffer support 2017-05-05 14:20:36 -04:00
index.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
interfaces.ts fix(http): Update types for TypeScript nullability support 2017-04-18 12:07:33 -07:00
static_request.ts fix(http): introduce encodingHint for text() for better ArrayBuffer support 2017-05-05 14:20:36 -04:00
static_response.ts fix(http): Update types for TypeScript nullability support 2017-04-18 12:07:33 -07:00
url_search_params.ts fix(http): Update types for TypeScript nullability support 2017-04-18 12:07:33 -07:00
version.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00