(target: Window, origin = '*')
| 10 | private listeners = new Map<BridgeEventType, Set<BridgeEventHandler>>(); |
| 11 | |
| 12 | public constructor(target: Window, origin = '*') { |
| 13 | this.target = target; |
| 14 | this.origin = origin; |
| 15 | |
| 16 | this.on = this.on.bind(this); |
| 17 | this.emit = this.emit.bind(this); |
| 18 | this.dispose = this.dispose.bind(this); |
| 19 | this.handle = this.handle.bind(this); |
| 20 | |
| 21 | window.addEventListener('message', this.handle, { |
| 22 | signal: this.abort.signal, |
| 23 | }); |
| 24 | } |
| 25 | |
| 26 | public emit(event: BridgeEvent) { |
| 27 | this.target.postMessage(event, this.origin); |
nothing calls this directly
no outgoing calls
no test coverage detected