export type { GetTokensResponse, OneTapAuthorizationResult, OneTapConfigureParams, OneTapResponse, OneTapResponseType, OneTapSuccessData, OneTapUser, } from './specs/nitro-google-signin.nitro'; /** String literals for {@link OneTapResponseType}. */ export declare const OneTapResponseTypes: { readonly success: "success"; readonly noSavedCredentialFound: "noSavedCredentialFound"; readonly cancelled: "cancelled"; }; /** @internal Placeholder for API parity — sign-in methods take no arguments. */ export type OneTapSignInParams = Record; /** @internal Placeholder for API parity — sign-in methods take no arguments. */ export type OneTapCreateAccountParams = Record; /** @internal Placeholder for API parity — sign-in methods take no arguments. */ export type OneTapExplicitSignInParams = Record; /** Error code strings thrown by native sign-in and authorization flows. */ export declare const statusCodes: { /** Credential Manager / Google Sign-In request failed (not user cancel). */ readonly ONE_TAP_START_FAILED: "ONE_TAP_START_FAILED"; /** Android — Play Services missing or outdated. */ readonly PLAY_SERVICES_NOT_AVAILABLE: "PLAY_SERVICES_NOT_AVAILABLE"; /** No Activity / view controller, or sign-in called before `configure()`. */ readonly IN_PROGRESS: "IN_PROGRESS"; /** User must sign in first. */ readonly SIGN_IN_REQUIRED: "SIGN_IN_REQUIRED"; /** User cancelled an authorization or sign-in flow. */ readonly SIGN_IN_CANCELLED: "SIGN_IN_CANCELLED"; /** * Android OAuth misconfiguration (wrong/missing SHA-1, package name, or * Android client ID used as `webClientId`). Thrown when Credential Manager / * AuthorizationClient surfaces a developer error — not for silent `cancelled` * responses (see troubleshooting for production `cancelled` after account pick). */ readonly DEVELOPER_ERROR: "DEVELOPER_ERROR"; }; export type StatusCode = (typeof statusCodes)[keyof typeof statusCodes]; /** Error thrown by native sign-in, Play Services checks, and authorization flows. */ export declare class GoogleSignInError extends Error { /** One of {@link statusCodes}. */ code: StatusCode; /** Optional metadata (e.g. Play Services status on Android). */ userInfo?: Record; constructor(code: StatusCode, message: string, userInfo?: Record); } /** * Type guard for errors with a `code` and `message` (including native bridged errors). * * @example * ```ts * try { * await GoogleOneTapSignIn.checkPlayServices() * } catch (e) { * if (isErrorWithCode(e) && e.code === statusCodes.PLAY_SERVICES_NOT_AVAILABLE) { * // prompt user to update Play Services * } * } * ``` */ export declare function isErrorWithCode(error: unknown): error is Pick; /** * Narrows a {@link OneTapResponse} to success with non-null `data`. * * @example * ```ts * if (isSuccessResponse(response)) { * const { user, idToken, serverAuthCode } = response.data * } * ``` */ export declare function isSuccessResponse(response: import('./specs/nitro-google-signin.nitro').OneTapResponse): response is import('./specs/nitro-google-signin.nitro').OneTapResponse & { type: 'success'; data: import('./specs/nitro-google-signin.nitro').OneTapSuccessData; }; /** `true` when the user has no saved Google credential for this app. */ export declare function isNoSavedCredentialFoundResponse(response: import('./specs/nitro-google-signin.nitro').OneTapResponse): boolean; /** `true` when the user dismissed the sign-in UI (not thrown — check the response). */ export declare function isCancelledResponse(response: import('./specs/nitro-google-signin.nitro').OneTapResponse): boolean; //# sourceMappingURL=types.d.ts.map