@arc-publishing/sdk-identity
Version:
JS Identity SDK for working with Identity API
39 lines (38 loc) • 1.43 kB
TypeScript
/// <reference types="gapi.auth2" />
/// <reference types="google.accounts" />
export interface GoogleSignInRenderOptions {
width?: number;
height?: number;
longtitle?: boolean;
theme?: string;
onSuccess?: GoogleSignInCallback;
onFailure?: GoogleSignInCallback;
scope?: Array<'profile' | 'email' | 'swg_entitlements' | string>;
}
export interface GoogleSignInCallback {
(reason?: string): void;
}
export type GoogleUser = Pick<gapi.auth2.GoogleAuth, 'currentUser'>;
export interface LegacyGoogleSettings {
auth2?: typeof gapi.auth2;
authInstance?: gapi.auth2.GoogleAuth;
clientId?: string;
onSuccess?: Function;
onFailure?: Function;
useCustomButton?: boolean;
}
export declare function isLegacyGoogleSetting(object: any): object is LegacyGoogleSettings;
export declare function isGoogleCredentialResponse(object: any): object is google.accounts.id.CredentialResponse;
export interface FacebookLoginResponse {
authResponse: FacebookAuthResponse;
status: string;
}
export interface FacebookAuthResponse {
accessToken: string;
expiresIn: number;
signedRequest: string;
userID: string;
}
export type FacebookAuthStatus = 'connected' | 'not_authorized' | 'unknown';
export type SocialSignOnProviders = 'facebook' | 'google' | 'apple';
export declare function isFacebookLoginResponse(object: FacebookLoginResponse | Error): object is FacebookLoginResponse;