import { ipcMain , ipcRenderer } from 'electron' ; Deprected export class AppRuntime { public static get ( ) { if ( ipcRenderer ) { return 'electron-renderer' ; } else if ( ipcMain ) { return 'electron-main' ; } else { return 'browser' ; } } /**
     * A higher level runtime type (electron or browser)
     */ public static type ( ) { switch ( this . get ( ) ) { case 'electron-renderer' : return 'electron' ; case 'electron-main' : return 'electron' ; case 'browser' : return 'browser' ; } } public static isElectron ( ) { return this . get ( ) . startsWith ( 'electron-' ) ; } public static isBrowser ( ) { return this . get ( ) === 'browser' ; } } export type AppRuntimeName = 'electron-renderer' | 'electron-main' | 'browser' ; export type AppRuntimeType = 'electron' | 'browser' ;