unified-video-framework
Version:
Cross-platform video player framework supporting iOS, Android, Web, Smart TVs (Samsung/LG), Roku, and more
60 lines • 1.82 kB
TypeScript
import { PaywallConfig } from '@unified-video/core';
export type EmailAuthControllerOptions = {
getOverlayContainer: () => HTMLElement | null;
onAuthSuccess: (userId: string, sessionToken: string, accessData?: any) => void;
onAuthCancel: () => void;
onShow?: () => void;
onClose?: () => void;
};
export type AuthResponse = {
success: boolean;
message?: string;
data?: {
sessionToken?: string;
refreshToken?: string;
userId?: string;
expiresIn?: number;
};
error?: string;
};
export type AuthStep = 'email' | 'otp' | 'loading' | 'error' | 'success';
export declare class EmailAuthController {
private config;
private opts;
private overlayEl;
private currentStep;
private currentEmail;
private resendTimer;
private resendCooldown;
private otpAttempts;
private requestStartTime;
constructor(config: PaywallConfig | null, opts: EmailAuthControllerOptions);
updateConfig(config: PaywallConfig | null): void;
isAuthenticated(): boolean;
getAuthenticatedUserId(): string | null;
openAuthModal(): void;
closeAuthModal(): void;
private ensureOverlay;
private createHeader;
private setStep;
private renderEmailStep;
private renderOtpStep;
private renderLoadingStep;
private renderErrorStep;
private renderSuccessStep;
private requestOtp;
private verifyOtp;
private storeSessionToken;
private getStoredSessionToken;
private storeAuthTokens;
private startResendCooldown;
private clearResendTimer;
private handleCancel;
private showInputError;
private showSuccessMessage;
private showErrorMessage;
private isValidEmail;
logout(): Promise<void>;
destroy(): void;
}
//# sourceMappingURL=EmailAuthController.d.ts.map