import { IPCInvokeHandler } from '../../shared/IPCHandler' ; import { googleAuth } from './GoogleAuth' ; /**
 * Handles the 'google-login' event.
 */ class GoogleLoginHandler implements IPCInvokeHandler < 'google-login' > { event : 'google-login' = 'google-login' ; returns async handler ( ) { return new Promise < boolean > ( resolve => { googleAuth . generateAuthToken ( ) . then ( ( isLoggedIn ) => resolve ( isLoggedIn ) ) ; } ) ; } } export const googleLoginHandler = new GoogleLoginHandler ( ) ; /**
 * Handles the 'google-login' event.
 */ class GoogleLogoutHandler implements IPCInvokeHandler < 'google-logout' > { event : 'google-logout' = 'google-logout' ; returns async handler ( ) { return new Promise < undefined > ( resolve => { googleAuth . deleteStoredToken ( ) . then ( ( ) => resolve ( undefined ) ) ; } ) ; } } export const googleLogoutHandler = new GoogleLogoutHandler ( ) ; /**
 * Handles the 'get-auth-status' event.
 */ class GetAuthStatusHandler implements IPCInvokeHandler < 'get-auth-status' > { event : 'get-auth-status' = 'get-auth-status' ; returns handler ( ) { return new Promise < boolean > ( resolve => { googleAuth . attemptToAuthenticate ( ) . then ( isAuthenticated => resolve ( isAuthenticated ) ) ; } ) ; } } export const getAuthStatusHandler = new GetAuthStatusHandler ( ) ;