2015-11-12 10:28:04 +00:00
|
|
|
{ipcRenderer, deprecate} = require 'electron'
|
2015-11-10 07:12:07 +00:00
|
|
|
{EventEmitter} = require 'events'
|
2015-11-09 13:18:57 +00:00
|
|
|
|
2015-11-10 07:12:07 +00:00
|
|
|
# This module is deprecated, we mirror everything from ipcRenderer.
|
2015-11-26 03:06:56 +00:00
|
|
|
deprecate.warn 'ipc module', 'require("electron").ipcRenderer'
|
2013-04-23 04:18:07 +00:00
|
|
|
|
2015-11-10 07:12:07 +00:00
|
|
|
# Routes events of ipcRenderer.
|
|
|
|
ipc = new EventEmitter
|
|
|
|
ipcRenderer.emit = (channel, event, args...) ->
|
|
|
|
ipc.emit channel, args...
|
|
|
|
EventEmitter::emit.apply ipcRenderer, arguments
|
2014-12-17 19:09:11 +00:00
|
|
|
|
2015-01-27 02:42:43 +00:00
|
|
|
# Deprecated.
|
2015-11-10 07:12:07 +00:00
|
|
|
for method of ipcRenderer when method.startsWith 'send'
|
|
|
|
ipc[method] = ipcRenderer[method]
|
2015-11-09 13:18:57 +00:00
|
|
|
deprecate.rename ipc, 'sendChannel', 'send'
|
|
|
|
deprecate.rename ipc, 'sendChannelSync', 'sendSync'
|
2013-04-23 04:18:07 +00:00
|
|
|
|
2015-01-27 02:42:43 +00:00
|
|
|
module.exports = ipc
|