import type { TurboModule } from 'react-native' import { TurboModuleRegistry } from 'react-native' export interface GoogleSignInUser { id: string name: string | null givenName: string | null familyName: string | null photo: string | null email: string } export interface GoogleSignInResult { user: GoogleSignInUser idToken: string serverAuthCode: string | null scopes: string[] } export interface GoogleTokens { idToken: string accessToken: string } export interface GoogleSignInConfig { iosClientId?: string webClientId?: string scopes?: string[] hostedDomain?: string openIDRealm?: string profileImageSize?: number googleServicePlistPath?: string accountName?: string offlineAccess?: boolean forceCodeForRefreshToken?: boolean } export interface GoogleSignInOptions { loginHint?: string } export interface AddScopesOptions { scopes: string[] } export interface Spec extends TurboModule { /** * Configures Google Sign-In with the provided options */ configure(config: GoogleSignInConfig): Promise /** * Attempts to sign in silently using previously stored credentials */ signInSilently(): Promise /** * Initiates the sign-in flow with UI */ signIn(options: GoogleSignInOptions): Promise /** * Adds additional scopes to the current user */ addScopes(options: AddScopesOptions): Promise /** * Signs out the current user */ signOut(): Promise /** * Revokes access and signs out */ revokeAccess(): Promise /** * Checks if a user is currently signed in */ isSignedIn(): Promise /** * Gets the current signed-in user information */ getCurrentUser(): Promise /** * Gets fresh tokens for the current user */ getTokens(): Promise /** * Clears the cached access token (Android only) */ clearCachedAccessToken(token: string): Promise /** * Checks if Play Services are available (Android only) */ playServicesAvailable(showPlayServicesUpdateDialog: boolean): Promise /** * Returns constants for button sizes, colors, and error codes */ getConstants(): { BUTTON_SIZE_ICON: number BUTTON_SIZE_STANDARD: number BUTTON_SIZE_WIDE: number BUTTON_COLOR_LIGHT: number BUTTON_COLOR_DARK: number SIGN_IN_CANCELLED: string SIGN_IN_REQUIRED: string IN_PROGRESS: string PLAY_SERVICES_NOT_AVAILABLE: string } } export default TurboModuleRegistry.getEnforcing('PortalGoogleSignIn')