From 2335bc05288fd1abe784bdd9fb6ddeb76357529f Mon Sep 17 00:00:00 2001 From: chivesrs Date: Thu, 27 Jun 2019 16:08:12 -0400 Subject: [PATCH] [gapi] Add typings for token session_state (#36121) * Add typings for token session_state * Add getToken() to gapi.client --- types/gapi/index.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/types/gapi/index.d.ts b/types/gapi/index.d.ts index 7ab0dfd1e6..027309e857 100644 --- a/types/gapi/index.d.ts +++ b/types/gapi/index.d.ts @@ -20,12 +20,19 @@ interface GoogleApiOAuth2TokenObject { * The duration, in seconds, the token is valid for. Only present in successful responses */ expires_in: string; + session_state: GoogleApiOAuth2TokenSessionState; /** * The Google API scopes related to this token */ state: string; } +interface GoogleApiOAuth2TokenSessionState { + extraQueryParams: { + authuser: string, + }; +} + /** * Fix for #8215 * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/8215 @@ -230,6 +237,11 @@ declare namespace gapi.client { * @param apiKey The API key to set */ export function setApiKey(apiKey: string): void; + /** + * Retrieves the OAuth 2.0 token for the application. + * @return The OAuth 2.0 token. + */ + export function getToken(): GoogleApiOAuth2TokenObject; /** * Sets the authentication token to use in requests. * @param token The token to set.