/** * Web OAuth Implementation * Handles OAuth flows for web platforms (React/Next.js) */ import { AuthClient } from './auth-client'; export interface WebOAuthConfig { popupMode?: boolean; redirectMode?: boolean; popupOptions?: { width?: number; height?: number; centerScreen?: boolean; }; } export interface WebOAuthResult { success: boolean; user?: any; tokens?: any; error?: string; } export declare class WebOAuthHandler { private oauthHandler; private authClient; private config; constructor(authClient: AuthClient, config?: WebOAuthConfig); private setupEventHandlers; /** * Start OAuth flow with popup */ loginWithPopup(provider: string): Promise; /** * Start OAuth flow with redirect */ loginWithRedirect(provider: string): void; /** * Handle OAuth callback (for redirect flow) */ handleCallback(provider: string): Promise; /** * Login with Google (popup) */ loginWithGoogle(): Promise; /** * Login with GitHub (popup) */ loginWithGitHub(): Promise; /** * Login with Microsoft (popup) */ loginWithMicrosoft(): Promise; /** * Login with Google (redirect) */ loginWithGoogleRedirect(): void; /** * Login with GitHub (redirect) */ loginWithGitHubRedirect(): void; /** * Login with Microsoft (redirect) */ loginWithMicrosoftRedirect(): void; /** * Open OAuth popup window */ private openPopup; /** * Get the OAuth callback script for popup * This should be included in the OAuth callback page */ static getCallbackScript(): string; /** * React Hook for OAuth */ static createUseAuth(): () => { isAuthenticated: boolean; user: null; loading: boolean; login: (provider: string) => Promise; logout: () => Promise; }; /** * Next.js API route handler */ static createNextAuthHandler(authClient: AuthClient): { GET(request: Request): Promise; }; /** * Get available OAuth providers */ getAvailableProviders(): string[]; /** * Check if user is authenticated */ isAuthenticated(): boolean; /** * Get current user */ getCurrentUser(): any; /** * Logout */ logout(): Promise; } export default WebOAuthHandler; //# sourceMappingURL=oauth-web.d.ts.map