From 376e27131e3ec6a2336bbd2fe3dae2809a213458 Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Wed, 20 Aug 2014 10:22:05 +1000 Subject: [PATCH] Adding promises to GAPI --- gapi/gapi.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gapi/gapi.d.ts b/gapi/gapi.d.ts index 8a9206663e..d9d6fb90b4 100644 --- a/gapi/gapi.d.ts +++ b/gapi/gapi.d.ts @@ -141,6 +141,23 @@ declare module gapi.client { statusText: string; } ) => any):void; + /** + * HttpRequest supports promises. + */ + then(success:(response:{ + result:T; + body:string; + headers?: any[]; + status?: number; + statusText?: string + })=>void, + failure:(response:{ + result:T; + body:string; + headers?: any[]; + status?: number; + statusText?: string + })=>void): void; } /** * Represents an HTTP Batch operation. Individual HTTP requests are added with the add method and the batch is executed using execute.