diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index e02747ac5d..f574d05f2d 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -112,7 +112,7 @@ declare namespace request { send(data?: string | object): this; set(field: string, val: string): this; set(field: object): this; - timeout(ms: number): this; + timeout(ms: number | { deadline?: number, response?: number }): this; type(val: string): this; unset(field: string): this; use(fn: Plugin): this; diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index 9e8dc0aa96..a6d07c3eaa 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -207,6 +207,7 @@ req.abort(); // Request timeouts req.timeout(100); +req.timeout({ response: 5000, deadline: 60000 }); const reqUrl: string = req.url; const reqMethod: string = req.method;