mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 01:31:45 +00:00
Add support for got.extend
This commit is contained in:
@@ -266,6 +266,10 @@ got('/examples/angularjs', { baseUrl: 'http://todomvc.com' });
|
||||
got('http://todomvc.com', { headers: { foo: 'bar'} });
|
||||
got('http://todomvc.com', { cookieJar: new tough.CookieJar() });
|
||||
|
||||
// Test extension
|
||||
got.extend({ method: 'POST' })('/example');
|
||||
got.extend({ method: 'POST' }).extend({ headers: {} }).stream('/example');
|
||||
|
||||
// Test retry options.
|
||||
got('http://todomvc.com', { retry: 2 });
|
||||
got('http://todomvc.com', {
|
||||
|
||||
Vendored
+2
@@ -4,6 +4,7 @@
|
||||
// Linus Unnebäck <https://github.com/LinusU>
|
||||
// Konstantin Ikonnikov <https://github.com/ikokostya>
|
||||
// Stijn Van Nieuwenhuyse <https://github.com/stijnvn>
|
||||
// Matthew Bull <https://github.com/wingsbob>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -72,6 +73,7 @@ declare const got: got.GotFn &
|
||||
Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', got.GotFn> &
|
||||
{
|
||||
stream: got.GotStreamFn & Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', got.GotStreamFn>;
|
||||
extend: (options: got.GotJSONOptions | got.GotFormOptions<string> | got.GotFormOptions<null> | got.GotBodyOptions<string> | got.GotBodyOptions<null>) => typeof got;
|
||||
RequestError: typeof RequestError;
|
||||
ReadError: typeof ReadError;
|
||||
ParseError: typeof ParseError;
|
||||
|
||||
Reference in New Issue
Block a user