(fn: (host: PlaybackHost) => T)
| 13 | } |
| 14 | |
| 15 | #withHost<T>(fn: (host: PlaybackHost) => T): T { |
| 16 | const host = this.#host; |
| 17 | if (!host) { |
| 18 | throw new Error('Playback host not available'); |
| 19 | } |
| 20 | return fn(host); |
| 21 | } |
| 22 | |
| 23 | getState(): Promise<PlaybackState> { |
| 24 | return this.#withHost((host) => host.getState()); |
no test coverage detected