mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-03 19:42:27 +08:00
Fix parse_response type and use lookup type
This commit is contained in:
committed by
GitHub
parent
118fe088f6
commit
bef6849dac
10
types/needle/index.d.ts
vendored
10
types/needle/index.d.ts
vendored
@@ -42,7 +42,7 @@ declare namespace core {
|
||||
/**
|
||||
* Alias for open_timeout
|
||||
*/
|
||||
timeout?: number;
|
||||
timeout?: RequestOptions['open_timeout'];
|
||||
|
||||
/**
|
||||
* Returns error if data transfer takes longer than X milisecs,
|
||||
@@ -56,7 +56,7 @@ declare namespace core {
|
||||
/**
|
||||
* Alias for follow_max
|
||||
*/
|
||||
follow?: number;
|
||||
follow?: RequestOptions['follow_max'];
|
||||
|
||||
/**
|
||||
* Enables multipart/form-data encoding. Defaults to false.
|
||||
@@ -155,7 +155,7 @@ declare namespace core {
|
||||
/**
|
||||
* Alias for decode_response
|
||||
*/
|
||||
decode?: boolean;
|
||||
decode?: ResponseOptions['decode_response'];
|
||||
|
||||
/**
|
||||
* Whether to parse XML or JSON response bodies automagically.
|
||||
@@ -163,11 +163,11 @@ declare namespace core {
|
||||
* You can also set this to 'xml' or 'json' in which case Needle
|
||||
* will only parse the response if the content type matches.
|
||||
*/
|
||||
parse_response?: boolean;
|
||||
parse_response?: boolean | 'json' | 'xml';
|
||||
/**
|
||||
* Alias for parse_response
|
||||
*/
|
||||
parse?: boolean;
|
||||
parse?: ResponseOptions['parse_response'];
|
||||
|
||||
/**
|
||||
* Whether to parse response’s Set-Cookie header.
|
||||
|
||||
Reference in New Issue
Block a user