worklog-reminder
73 строки · 3.0 Кб
1import path from 'path';2import { app } from 'electron';3import EventDict from './Domain/Dictionary/EventDict';4import OpenInShellHandler from './Application/Event/RendererHandler/OpenInShellHandler';5import ShowMainWindowHandler from './Application/Event/RendererHandler/ShowMainWindowHandler';6import SyncIsWindowVisible from './Application/Event/RendererHandler/SyncIsWindowVisible';7import AppReadyHandler from './Application/Event/MainHandler/AppReadyHandler';8import UserAgentHandler from './Application/Event/MainHandler/UserAgentHandler';9import WindowAllClosedHandler from './Application/Event/MainHandler/WindowAllClosedHandler';10import ActivateHandler from './Application/Event/MainHandler/ActivateHandler';11import HideMacOsDockHandler from './Application/Event/MainHandler/HideMacOsDockHandler';12import InstallReactExt from './Application/Event/MainHandler/InstallReactExt';13import CheckForUpdatesHandler from './Application/Event/MainHandler/CheckForUpdatesHandler';14import ShowWindowShortcutHandler from './Application/Event/MainHandler/ShowWindowShortcutHandler';15import SyncIsAgentEnabled from './Application/Event/RendererHandler/SyncIsAgentEnabled';16import SyncIsDevHandler from './Application/Event/RendererHandler/SyncIsDevHandler';17import SetAgentEnabledHandler from './Application/Event/RendererHandler/SetAgentEnabledHandler';18import RestoreWindowPositionHandler from './Application/Event/RendererHandler/RestoreWindowPositionHandler';19
20const APP_ROOT = app.getAppPath();21
22export default {23assetsDir: path.join(APP_ROOT, '.webpack', 'static'),24eventHandlers: {25// App events from main thread26app: {27// This method will be called when Electron has finished28// initialization and is ready to setHandlers browser windows.29// Some APIs can only be used after this event occurs.30[EventDict.APP_READY]: [31new UserAgentHandler(),32new AppReadyHandler(),33new HideMacOsDockHandler(),34new InstallReactExt(),35new CheckForUpdatesHandler(),36new ShowWindowShortcutHandler(),37],38[EventDict.APP_ACTIVATE]: [39new ActivateHandler(),40],41// Quit when all windows are closed, except on macOS. There, it's common42// for applications and their menu bar to stay active until the user quits43// explicitly with Cmd + Q.44[EventDict.APP_WINDOW_ALL_CLOSED]: [45new WindowAllClosedHandler(),46],47},48renderer: {49// Events from renderer50[EventDict.OPEN_IN_SHELL]: [51new OpenInShellHandler(),52],53[EventDict.SHOW_MAIN_WINDOW]: [54new ShowMainWindowHandler(),55],56[EventDict.SYNC_IS_WINDOW_VISIBLE]: [57new SyncIsWindowVisible(),58],59[EventDict.SYNC_IS_AGENT_ENABLED]: [60new SyncIsAgentEnabled(),61],62[EventDict.SET_AGENT_ENABLED]: [63new SetAgentEnabledHandler(),64],65[EventDict.SYNC_IS_DEV]: [66new SyncIsDevHandler(),67],68[EventDict.RESTORE_WINDOW_POSITION]: [69new RestoreWindowPositionHandler(),70],71},72},73};74