mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Update gapi.d.ts
I am using Google+ Sign-In on one of my applications and I needed to add a couple of definitions into this file. The update is based on https://developers.google.com/+/web/signin/reference#javascript_api.
This commit is contained in:
39
gapi/gapi.d.ts
vendored
39
gapi/gapi.d.ts
vendored
@@ -65,6 +65,45 @@ declare module gapi.auth {
|
||||
* @param token The token to set.
|
||||
*/
|
||||
export function setToken(token: GoogleApiOAuth2TokenObject): void;
|
||||
/**
|
||||
* Initiates the client-side Google+ Sign-In OAuth 2.0 flow.
|
||||
* When the method is called, the OAuth 2.0 authorization dialog is displayed to the user and when they accept, the callback function is called.
|
||||
* @param params
|
||||
*/
|
||||
export function signIn(params: {
|
||||
/**
|
||||
* Your OAuth 2.0 client ID that you obtained from the Google Developers Console.
|
||||
*/
|
||||
clientid?: string;
|
||||
/**
|
||||
* Directs the sign-in button to store user and session information in a session cookie and HTML5 session storage on the user's client for the purpose of minimizing HTTP traffic and distinguishing between multiple Google accounts a user might be signed into.
|
||||
*/
|
||||
cookiepolicy?: string;
|
||||
/**
|
||||
* A function in the global namespace, which is called when the sign-in button is rendered and also called after a sign-in flow completes.
|
||||
*/
|
||||
callback?: Function;
|
||||
/**
|
||||
* If true, all previously granted scopes remain granted in each incremental request, for incremental authorization. The default value true is correct for most use cases; use false only if employing delegated auth, where you pass the bearer token to a less-trusted component with lower programmatic authority.
|
||||
*/
|
||||
includegrantedscopes?: boolean;
|
||||
/**
|
||||
* If your app will write moments, list the full URI of the types of moments that you intend to write.
|
||||
*/
|
||||
requestvisibleactions?: any;
|
||||
/**
|
||||
* The OAuth 2.0 scopes for the APIs that you would like to use as a space-delimited list.
|
||||
*/
|
||||
scope?: any;
|
||||
/**
|
||||
* If you have an Android app, you can drive automatic Android downloads from your web sign-in flow.
|
||||
*/
|
||||
apppackagename?: string;
|
||||
}): void;
|
||||
/**
|
||||
* Signs a user out of your app without logging the user out of Google. This method will only work when the user is signed in with Google+ Sign-In.
|
||||
*/
|
||||
export function signOut(): void;
|
||||
}
|
||||
|
||||
declare module gapi.client {
|
||||
|
||||
Reference in New Issue
Block a user