• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1declare namespace InternalMessagingBinding {
2  class MessageChannel {
3    port1: MessagePort;
4    port2: MessagePort;
5  }
6
7  class MessagePort {
8    private constructor();
9    postMessage(message: any, transfer?: any[] | null): void;
10    start(): void;
11    close(): void;
12    ref(): void;
13    unref(): void;
14  }
15
16  class JSTransferable {}
17}
18
19
20declare function InternalBinding(binding: 'messaging'): {
21  DOMException: typeof import('internal/per_context/domexception').DOMException;
22  MessageChannel: typeof InternalMessagingBinding.MessageChannel;
23  MessagePort: typeof InternalMessagingBinding.MessagePort;
24  JSTransferable: typeof InternalMessagingBinding.JSTransferable;
25  stopMessagePort(port: typeof InternalMessagingBinding.MessagePort): void;
26  checkMessagePort(port: unknown): boolean;
27  drainMessagePort(port: typeof InternalMessagingBinding.MessagePort): void;
28  receiveMessageOnPort(port: typeof InternalMessagingBinding.MessagePort): any;
29  moveMessagePortToContext(port: typeof InternalMessagingBinding.MessagePort, context: any): typeof InternalMessagingBinding.MessagePort;
30  setDeserializerCreateObjectFunction(func: (deserializeInfo: string) => any): void;
31  broadcastChannel(name: string): typeof InternalMessagingBinding.MessagePort;
32};
33