vue3-google-signin
Version:
Google Sign-in for Vue3 with Google Identity Service
39 lines (38 loc) • 1.77 kB
TypeScript
import type { CodeClientConfig, TokenResponse } from '../interfaces/oauth2';
/**
* Helper method for [google.accounts.oauth2.hasGrantedAllScopes](https://developers.google.com/identity/oauth2/web/reference/js-reference#google.accounts.oauth2.hasGrantedAllScopes)
*
* @export
* @param {TokenResponse} tokenResponse - A valid access token
* @param {string} firstScope - first scope
* @param {...string[]} restScopes - other scopes
* @return {*} {boolean}
*/
export declare function hasGrantedAllScopes(tokenResponse: TokenResponse, firstScope: string, ...restScopes: string[]): boolean;
/**
* Helper method for [google.accounts.oauth2.hasGrantedAnyScopes](https://developers.google.com/identity/oauth2/web/reference/js-reference#google.accounts.oauth2.hasGrantedAnyScopes)
*
* @export
* @param {TokenResponse} tokenResponse - A valid access token
* @param {string} firstScope - first scope
* @param {...string[]} restScopes - other scopes
* @return {*} {boolean}
*/
export declare function hasGrantedAnyScopes(tokenResponse: TokenResponse, firstScope: string, ...restScopes: string[]): boolean;
/**
* Helper method for [google.accounts.oauth2.revoke](https://developers.google.com/identity/oauth2/web/reference/js-reference#google.accounts.oauth2.revoke)
*
* @export
* @param {string} accessToken
* @param {() => void} [done]
*/
export declare function revokeAccessToken(accessToken: string, done?: () => void): void;
export type ImplicitFlowOptions = Omit<CodeClientConfig, "redirect" | "callback" | "ux_mode">;
/**
* Get the OAuth2 redirect URL for login with implicit flow
*
* @export
* @param {ImplicitFlowOptions} options
* @return {string}
*/
export declare function buildCodeRequestRedirectUrl(options: ImplicitFlowOptions): string;