import type { AuthError } from '@supabase/supabase-js'; import type { UserMetadata } from './auth'; export interface AccountLinkingResult { success: boolean; error: AuthError | null; newUserId?: string; } export interface LinkAnonymousAccountOptions { anonymousUserId: string; email: string; password: string; firstName?: string; lastName?: string; preserveUserData?: boolean; } export interface LinkOAuthAccountOptions { anonymousUserId: string; provider: 'google' | 'apple'; oauthUserId: string; preserveUserData?: boolean; } /** * Link anonymous account to email/password account * This converts an anonymous user to a permanent email user */ export declare function linkAnonymousToEmail(options: LinkAnonymousAccountOptions): Promise; /** * Link anonymous account to OAuth account * This is more complex as it requires coordinating with OAuth flow */ export declare function linkAnonymousToOAuth(options: LinkOAuthAccountOptions): Promise; /** * Check if user can be linked (is anonymous and meets requirements) */ export declare function canLinkAnonymousAccount(userId: string): Promise<{ canLink: boolean; reason?: string; error: AuthError | null; }>; /** * Get anonymous account linking status and metadata */ export declare function getAnonymousAccountInfo(userId: string): Promise<{ isAnonymous: boolean; canBeLinked: boolean; metadata: UserMetadata; error: AuthError | null; }>; //# sourceMappingURL=accountLinking.d.ts.map