2015-11-09 13:18:57 +00:00
|
|
|
deprecate = require 'deprecate'
|
2015-11-10 07:12:07 +00:00
|
|
|
ipcRenderer = require 'ipc-renderer'
|
|
|
|
{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.
|
|
|
|
deprecate.warn 'ipc module', 'ipcRenderer module'
|
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
|