// @flow import * as React from 'react'; import type { ViewProps } from 'ViewPropTypes'; export type ConfigureParams = $ReadOnly<{| iosClientId?: string, offlineAccess?: boolean, webClientId?: string, scopes?: string[], loginHint?: string, hostedDomain?: string, forceConsentPrompt?: boolean, accountName?: string, |}>; export type GoogleSigninButtonProps = $ReadOnly<{| ...ViewProps, size?: number, color?: string, disabled?: boolean, onPress?: () => any, |}>; declare export class GoogleSigninButton extends React$Component { static Size: { Icon: number, Standard: number, Wide: number, }; static Color: { Auto: string, Light: string, Dark: string, }; } export type HasPlayServicesParams = $ReadOnly<{| showPlayServicesUpdateDialog: boolean, |}>; export type User = {| user: {| id: string, name: ?string, // full name email: string, photo: ?string, // url familyName: ?string, givenName: ?string, |}, scopes: string[], // on iOS this is empty array if no additional scopes are defined idToken: string, /** * Not null only if a valid webClientId and offlineAccess: true was * specified in configure(). */ serverAuthCode: ?string, |}; // Android Status codes: https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInStatusCodes type StatusCodes = $ReadOnly<{ SIGN_IN_CANCELLED: string, IN_PROGRESS: string, PLAY_SERVICES_NOT_AVAILABLE: string, SIGN_IN_REQUIRED: string, }>; declare export var statusCodes: StatusCodes; // the functions are not static in fact, but the module exports a // singleton instance of the class; not the class itself // using static keyword works well for this case declare export class GoogleSignin { static hasPlayServices: (params?: HasPlayServicesParams) => Promise; static configure: (params?: ConfigureParams) => void; static signInSilently: () => Promise; static signIn: () => Promise; static signOut: () => Promise; static revokeAccess: () => Promise; static isSignedIn: () => Promise; static getCurrentUser(): Promise; static clearCachedToken(token: string): Promise; static getTokens(): Promise<{ idToken: string, accessToken: string }>; }