MCPcopy
hub / github.com/nukeop/nuclear / #withHost

Method #withHost

packages/plugin-sdk/src/api/playback.ts:15–21  ·  view source on GitHub ↗
(fn: (host: PlaybackHost) => T)

Source from the content-addressed store, hash-verified

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());

Callers 15

getStateMethod · 0.95
playMethod · 0.95
pauseMethod · 0.95
stopMethod · 0.95
toggleMethod · 0.95
seekToMethod · 0.95
subscribeMethod · 0.95
getVolumeMethod · 0.95
setVolumeMethod · 0.95
isMutedMethod · 0.95
setMutedMethod · 0.95
isShuffleEnabledMethod · 0.95

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected