[gapi] Add typings for token session_state (#36121)

* Add typings for token session_state

* Add getToken() to gapi.client
This commit is contained in:
chivesrs
2019-06-27 16:08:12 -04:00
committed by Daniel Rosenwasser
parent 7691ed800f
commit 2335bc0528

12
types/gapi/index.d.ts vendored
View File

@@ -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.