/** * COOP-safe OAuth popup communication bridge. * * When Cross-Origin-Opener-Policy severs window.opener, postMessage and popup.closed * checks fail. This module uses localStorage + storage events and BroadcastChannel * as reliable fallbacks that work across same-origin popup windows. */ export declare const OAUTH_STATE_KEY = "social_login_oauth_pending"; export declare const OAUTH_POPUP_SESSION_KEY = "social_login_oauth_popup"; export declare const OAUTH_RESULT_KEY_PREFIX = "social_login_oauth_result_"; export declare const OAUTH_DELIVERED_KEY = "social_login_oauth_delivered"; export declare const POPUP_WINDOW_NAMES: Set; export type OAuthBridgeMessage = Record & { type: 'oauth-response' | 'oauth-error'; }; export declare function getOAuthResultKey(nonce: string): string; export declare function getBroadcastChannelName(provider: string, nonceOrState: string): string; export declare function markOAuthPopup(nonce: string): void; export declare function clearOAuthPopupMarker(): void; export declare function hasOAuthRedirectParams(): boolean; export declare function isOAuthPopupContext(): boolean; export declare function shouldAutoFinishOAuthRedirect(): boolean; /** * Deliver OAuth result from popup to opener via all available channels. */ export declare function deliverOAuthResult(provider: string, nonceOrState: string | undefined, message: OAuthBridgeMessage): void; export interface OAuthResultListener { onResponse: (data: Record) => void; onError: (error: string, code?: string) => void; } /** * Listen for OAuth results from popup via postMessage, BroadcastChannel, and localStorage. * Returns a cleanup function. */ export declare function listenForOAuthResult(provider: string, nonceOrState: string, handlers: OAuthResultListener): () => void;