electron/atom/renderer/api/lib/ipc.coffee
2015-01-27 10:47:11 -08:00

20 lines
475 B
CoffeeScript

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...]
ipc.sendSync = (args...) ->
JSON.parse binding.sendSync('ipc-message-sync', [args...])
ipc.sendToHost = (args...) ->
binding.send 'ipc-message-host', [args...]
# Deprecated.
ipc.sendChannel = ipc.send
ipc.sendChannelSync = ipc.sendSync
module.exports = ipc