Passing object and type between Electron main process and renderer process simply via preload script.