(args: string[])
| 138 | |
| 139 | return this; |
| 140 | } |
| 141 | |
| 142 | postMessage(data: unknown): void { |
| 143 | if (this.closed) { |
| 144 | return; |
| 145 | } |
| 146 | this.sendToRenderer({ |
| 147 | type: "message-port-message", |
| 148 | portId: this.portId, |
| 149 | data, |
| 150 | }); |
| 151 | } |
| 152 | |
| 153 | start(): void {} |
| 154 | |
| 155 | close(): void { |
| 156 | if (!this.markClosed()) { |
| 157 | return; |
| 158 | } |
| 159 | this.sendToRenderer({ |
| 160 | type: "message-port-close", |
| 161 | portId: this.portId, |
| 162 | }); |
| 163 | } |
| 164 | |
| 165 | receiveMessage(data: unknown): void { |
| 166 | if (this.closed) { |
| 167 | return; |
| 168 | } |
| 169 | const listeners = this.listeners.get("message"); |
| 170 | if (!listeners || listeners.size === 0) { |
| 171 | return; |
no test coverage detected