electron/atom/renderer/api/lib/ipc.coffee

23 lines
542 B
CoffeeScript
Raw Normal View History

2015-11-09 13:18:57 +00:00
deprecate = require 'deprecate'
binding = process.atomBinding 'ipc'
v8Util = process.atomBinding 'v8_util'
# Created by init.coffee.
ipc = v8Util.getHiddenValue global, 'ipc'
ipc.send = (args...) ->
binding.send 'ipc-message', [args...]
2013-04-23 13:52:19 +00:00
ipc.sendSync = (args...) ->
JSON.parse binding.sendSync('ipc-message-sync', [args...])
2013-04-23 13:52:19 +00:00
ipc.sendToHost = (args...) ->
binding.send 'ipc-message-host', [args...]
2014-12-17 19:09:11 +00:00
# Deprecated.
2015-11-09 13:18:57 +00:00
deprecate.rename ipc, 'sendChannel', 'send'
deprecate.rename ipc, 'sendChannelSync', 'sendSync'
module.exports = ipc