From 916c404aabf071a64bcfe5f8ea62fc57e98b1445 Mon Sep 17 00:00:00 2001 From: John Cao Date: Wed, 30 Aug 2017 12:11:29 -0700 Subject: [PATCH 1/2] Update grantOfflineAccess Update grantOfflineAccess with OfflineAccessOptions --- types/gapi.auth2/index.d.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/types/gapi.auth2/index.d.ts b/types/gapi.auth2/index.d.ts index a8e84d478b..1af7d1464a 100644 --- a/types/gapi.auth2/index.d.ts +++ b/types/gapi.auth2/index.d.ts @@ -42,11 +42,7 @@ declare namespace gapi.auth2 { /** * Get permission from the user to access the specified scopes offline. */ - grantOfflineAccess(options?: { - scope?: string; - prompt?: "select_account" | "consent"; - app_package_name?: string; - }): any; + grantOfflineAccess(options?: OfflineAccessOptions): Promise<{code: string}>; /** * Attaches the sign-in flow to the specified container's click handler. @@ -106,6 +102,18 @@ declare namespace gapi.auth2 { */ scope?: string; } + + + /** + * Definitions by: John + * Interface that represents the different configuration parameters for the GoogleAuth.grantOfflineAccess(options) method. + * Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2offlineaccessoptions + */ + interface OfflineAccessOptions { + scope?: string; + prompt?: "select_account" | "consent"; + app_package_name?: string; + } /** * Interface that represents the different configuration parameters for the gapi.auth2.init method. From 617648bf881ba20a2e0bf61f2a6c5f0b92a88ede Mon Sep 17 00:00:00 2001 From: John Cao Date: Wed, 30 Aug 2017 12:33:51 -0700 Subject: [PATCH 2/2] remove whitespaces --- types/gapi.auth2/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/gapi.auth2/index.d.ts b/types/gapi.auth2/index.d.ts index 1af7d1464a..4cdef77a80 100644 --- a/types/gapi.auth2/index.d.ts +++ b/types/gapi.auth2/index.d.ts @@ -102,7 +102,6 @@ declare namespace gapi.auth2 { */ scope?: string; } - /** * Definitions by: John @@ -113,7 +112,7 @@ declare namespace gapi.auth2 { scope?: string; prompt?: "select_account" | "consent"; app_package_name?: string; - } + } /** * Interface that represents the different configuration parameters for the gapi.auth2.init method.