import { app , BrowserWindow } from 'electron' ; import path from 'path' ; import { registerTitlebarIpc } from '@misc/window/titlebarIPC' ; declare const APP_WINDOW_WEBPACK_ENTRY ; declare const APP_WINDOW_PRELOAD_WEBPACK_ENTRY ; let appWindow ; returns { BrowserWindow } export function createAppWindow ( ) { appWindow = new BrowserWindow ( { width : 800 , height : 600 , backgroundColor : '#1f252c' , show : false , autoHideMenuBar : true , frame : false , titleBarStyle : 'hidden' , icon : path . resolve ( 'assets/images/appIcon.ico' ) , webPreferences : { nodeIntegration : false , nativeWindowOpen : true , contextIsolation : true , nodeIntegrationInWorker : false , nodeIntegrationInSubFrames : false , preload : APP_WINDOW_PRELOAD_WEBPACK_ENTRY , } , } ) ; appWindow . loadURL ( APP_WINDOW_WEBPACK_ENTRY ) ; appWindow . on ( 'ready-to-show' , ( ) => appWindow . show ( ) ) ; registerMainIPC ( ) ; appWindow . on ( 'close' , ( ) => { appWindow = null ; app . quit ( ) ; } ) ; return appWindow ; } /**
 * Register Inter Process Communication
 */ function registerMainIPC ( ) { /**
     * Here you can assign IPC related codes for the application window
     * to Communicate asynchronously from the main process to renderer processes.
     */ registerTitlebarIpc ( appWindow ) ; }