diff --git a/qwest/qwest-tests.ts b/qwest/qwest-tests.ts index 7d023d28cf..67e2de21b8 100644 --- a/qwest/qwest-tests.ts +++ b/qwest/qwest-tests.ts @@ -75,4 +75,8 @@ qwest.get('foo', null, { timeout: 2000, attempts: 7 }) -qwest.get('foo', null, {}) \ No newline at end of file +qwest.get('foo', null, {}) + +qwest.get('foo', null, {}).complete(() => { + //done +}) \ No newline at end of file diff --git a/qwest/qwest.d.ts b/qwest/qwest.d.ts index 31a4e1db6f..d0442975ed 100644 --- a/qwest/qwest.d.ts +++ b/qwest/qwest.d.ts @@ -58,13 +58,13 @@ declare module Qwest { interface Promise { /** Request is successful */ - then(callback: (xhr: XMLHttpRequest, response: any) => any): Promise; + then(callback: (response: any) => any): Promise; /** Request has failed */ - catch(callback: (xhr: XMLHttpRequest, response: any) => any): Promise; + catch(callback: (e: any, response: any) => any): Promise; /** Always run */ - complete(callback: (response: any) => any): Promise; + complete(callback: () => any): Promise; } interface Options {