electron/lib/browser/api/message-channel.ts

13 lines
413 B
TypeScript
Raw Normal View History

2020-03-20 20:28:31 +00:00
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
const { createPair } = process._linkedBinding('electron_browser_message_port');
export default class MessageChannelMain {
port1: MessagePortMain;
port2: MessagePortMain;
constructor () {
2020-03-20 20:28:31 +00:00
const { port1, port2 } = createPair();
this.port1 = new MessagePortMain(port1);
this.port2 = new MessagePortMain(port2);
}
}