From 043288c68ebef1b3c4c11cb1b96a04f8129405ae Mon Sep 17 00:00:00 2001 From: Slavo Vojacek Date: Fri, 22 May 2015 17:23:41 +0100 Subject: [PATCH] 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. --- gapi/gapi.d.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gapi/gapi.d.ts b/gapi/gapi.d.ts index d9d6fb90b..8c50826d4 100644 --- a/gapi/gapi.d.ts +++ b/gapi/gapi.d.ts @@ -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 {