mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-03 08:40:12 +00:00
[gapi] Add typings for token session_state (#36121)
* Add typings for token session_state * Add getToken() to gapi.client
This commit is contained in:
committed by
Daniel Rosenwasser
parent
7691ed800f
commit
2335bc0528
12
types/gapi/index.d.ts
vendored
12
types/gapi/index.d.ts
vendored
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user