@bridgething/client 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +27 -0
- package/dist/dispatch.generated.d.ts +805 -0
- package/dist/dispatch.generated.d.ts.map +1 -0
- package/dist/dispatch.generated.js +3861 -0
- package/dist/dispatch.generated.js.map +1 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +245 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,805 @@
|
|
|
1
|
+
import type { BridgeThingMeta, BrightnessState, LogEntry, Notification, NowPlayingUpdate, OtaError, OtaProgress, PhoneCall, Position, StreamBegin, StreamChunk, StreamEnd, StreamError, WebappError, WebappInfo, WireError } from '@bridgething/lib';
|
|
2
|
+
import type { AmbientLightUpdate, AssetCleared, AssetGet, AssetGot, AssetNotFound, AssetPreload, AssetReady, BluetoothInterface, BluetoothPairingResult, BluetoothPin, BluetoothStatus, CapabilitiesSnapshot, ConfigChanged, ConfigGet, ConfigGetReply, ConfigListReply, ConnectBluetooth, ConnectedDevice, DeviceNicknameReply, DiagnosticsReply, DisplaySetLevel, DisplaySetMode, Earcon, FavoriteChanged, FavoritesSet, FavoritesSetMany, FavoritesToggle, ForgetBluetooth, GeoErrorReply, GeoGetOnce, GeoGetOnceReply, GeoUnwatch, GeoWatch, GeoWatchReply, HardwareStateReply, KVDelete, KVGet, KVPut, LibraryBrowse, LibraryBrowseReply, LibraryErrorReply, LibraryFavoritesContains, LibraryFavoritesContainsReply, LibraryFavoritesList, LibraryFavoritesListReply, LibraryRecommendations, LibraryRecommendationsReply, LibrarySearch, LibrarySearchReply, LogsSubscribe, LogsSubscribeReply, LogsTail, LogsTailReply, LogsUnsubscribe, MicMute, MicUnmute, NetFetch, NetFetchErrorReply, NetFetchReply, NetStreamCancel, NetStreamOpen, NetWsClose, NetWsClosed, NetWsErrorEvent, NetWsErrorReply, NetWsMessage, NetWsOpen, NetWsOpenReply, NetWsSend, NotificationInvoke, NotificationRemoved, PairedDevicesMap, PeerSnapshotMap, PhoneAcceptAction, PhoneCallAction, PhoneCallEnded, PhoneCommunicationsReply, PhoneDtmfAction, PhoneEndAction, PhoneErrorReply, PhoneInitiateAction, PhoneMuteAction, PhoneStateReply, PlayUri, PlayerErrorReply, PlayerQueueReply, PlayerStateReply, QueueUri, SeekTo, SetBluetoothAlias, SetCrossfade, SetMute, SetRepeat, SetShuffle, SetSpeed, SetVolume, SkipPrev, SkipToIndex, StorageResponse, TimeSnapshot, Tts, TtsCancel, TtsEnded, TtsStarted, VoiceState, VoiceStateReply, VolumeChanged, WebappActivate, WebappActiveChanged, WebappActiveReply, WebappCurrentReply, WebappIcon, WebappIconReply, WebappListReply, WebappUninstalled } from '@bridgething/lib/client';
|
|
3
|
+
import { BridgethingClient } from './index';
|
|
4
|
+
export type TypedRequestResult<R, E> = {
|
|
5
|
+
ok: true;
|
|
6
|
+
response: R;
|
|
7
|
+
} | {
|
|
8
|
+
ok: false;
|
|
9
|
+
kind: 'domain';
|
|
10
|
+
error: E;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
kind: 'protocol';
|
|
14
|
+
error: WireError;
|
|
15
|
+
};
|
|
16
|
+
export type AssetInboundHandlers = {
|
|
17
|
+
got: (msg: AssetGot) => void;
|
|
18
|
+
notFound: (msg: AssetNotFound) => void;
|
|
19
|
+
ready: (msg: AssetReady) => void;
|
|
20
|
+
cleared: (msg: AssetCleared) => void;
|
|
21
|
+
};
|
|
22
|
+
export type AudioInboundHandlers = {
|
|
23
|
+
ttsStarted: (msg: TtsStarted) => void;
|
|
24
|
+
ttsEnded: (msg: TtsEnded) => void;
|
|
25
|
+
volumeChanged: (msg: VolumeChanged) => void;
|
|
26
|
+
};
|
|
27
|
+
export type BluetoothInboundHandlers = {
|
|
28
|
+
status: (msg: BluetoothStatus) => void;
|
|
29
|
+
connectedDevice: (msg: ConnectedDevice) => void;
|
|
30
|
+
interface: (msg: BluetoothInterface) => void;
|
|
31
|
+
pairingResult: (msg: BluetoothPairingResult) => void;
|
|
32
|
+
pin: (msg: BluetoothPin) => void;
|
|
33
|
+
pairedDevices: (msg: PairedDevicesMap) => void;
|
|
34
|
+
};
|
|
35
|
+
export type CapabilitiesInboundHandlers = {
|
|
36
|
+
update: (msg: CapabilitiesSnapshot) => void;
|
|
37
|
+
snapshot: (msg: CapabilitiesSnapshot) => void;
|
|
38
|
+
};
|
|
39
|
+
export type ConfigInboundHandlers = {
|
|
40
|
+
get: (msg: ConfigGetReply) => void;
|
|
41
|
+
list: (msg: ConfigListReply) => void;
|
|
42
|
+
changed: (msg: ConfigChanged) => void;
|
|
43
|
+
};
|
|
44
|
+
export type GeoInboundHandlers = {
|
|
45
|
+
position: (msg: Position) => void;
|
|
46
|
+
watchReply: (msg: GeoWatchReply) => void;
|
|
47
|
+
getOnceReply: (msg: GeoGetOnceReply) => void;
|
|
48
|
+
errorReply: (msg: GeoErrorReply) => void;
|
|
49
|
+
};
|
|
50
|
+
export type HardwareInboundHandlers = {
|
|
51
|
+
ambientLightUpdate: (msg: AmbientLightUpdate) => void;
|
|
52
|
+
brightnessChanged: (msg: BrightnessState) => void;
|
|
53
|
+
stateReply: (msg: HardwareStateReply) => void;
|
|
54
|
+
};
|
|
55
|
+
export type LibraryInboundHandlers = {
|
|
56
|
+
browseReply: (msg: LibraryBrowseReply) => void;
|
|
57
|
+
searchReply: (msg: LibrarySearchReply) => void;
|
|
58
|
+
recommendationsReply: (msg: LibraryRecommendationsReply) => void;
|
|
59
|
+
favoritesListReply: (msg: LibraryFavoritesListReply) => void;
|
|
60
|
+
favoritesContainsReply: (msg: LibraryFavoritesContainsReply) => void;
|
|
61
|
+
libraryErrorReply: (msg: LibraryErrorReply) => void;
|
|
62
|
+
favoriteChanged: (msg: FavoriteChanged) => void;
|
|
63
|
+
};
|
|
64
|
+
export type NetInboundHandlers = {
|
|
65
|
+
fetchReply: (msg: NetFetchReply) => void;
|
|
66
|
+
fetchErrorReply: (msg: NetFetchErrorReply) => void;
|
|
67
|
+
wsOpenReply: (msg: NetWsOpenReply) => void;
|
|
68
|
+
wsErrorReply: (msg: NetWsErrorReply) => void;
|
|
69
|
+
wsMessage: (msg: NetWsMessage) => void;
|
|
70
|
+
wsClosed: (msg: NetWsClosed) => void;
|
|
71
|
+
wsErrorEvent: (msg: NetWsErrorEvent) => void;
|
|
72
|
+
streamBegin: (msg: StreamBegin) => void;
|
|
73
|
+
streamChunk: (msg: StreamChunk) => void;
|
|
74
|
+
streamEnd: (msg: StreamEnd) => void;
|
|
75
|
+
streamError: (msg: StreamError) => void;
|
|
76
|
+
};
|
|
77
|
+
export type NotificationsInboundHandlers = {
|
|
78
|
+
posted: (msg: Notification) => void;
|
|
79
|
+
updated: (msg: Notification) => void;
|
|
80
|
+
removed: (msg: NotificationRemoved) => void;
|
|
81
|
+
};
|
|
82
|
+
export type PhoneInboundHandlers = {
|
|
83
|
+
callStarted: (msg: PhoneCall) => void;
|
|
84
|
+
callUpdated: (msg: PhoneCall) => void;
|
|
85
|
+
callEnded: (msg: PhoneCallEnded) => void;
|
|
86
|
+
communicationsChanged: (msg: PhoneCommunicationsReply) => void;
|
|
87
|
+
stateReply: (msg: PhoneStateReply) => void;
|
|
88
|
+
errorReply: (msg: PhoneErrorReply) => void;
|
|
89
|
+
};
|
|
90
|
+
export type PlayerInboundHandlers = {
|
|
91
|
+
snapshot: (msg: PlayerStateReply) => void;
|
|
92
|
+
delta: (msg: NowPlayingUpdate) => void;
|
|
93
|
+
queueChanged: (msg: PlayerQueueReply) => void;
|
|
94
|
+
stateReply: (msg: PlayerStateReply) => void;
|
|
95
|
+
queueReply: (msg: PlayerQueueReply) => void;
|
|
96
|
+
errorReply: (msg: PlayerErrorReply) => void;
|
|
97
|
+
};
|
|
98
|
+
export type SystemInboundHandlers = {
|
|
99
|
+
version: (msg: BridgeThingMeta) => void;
|
|
100
|
+
diagnosticsReply: (msg: DiagnosticsReply) => void;
|
|
101
|
+
logsTailReply: (msg: LogsTailReply) => void;
|
|
102
|
+
logsSubscribeReply: (msg: LogsSubscribeReply) => void;
|
|
103
|
+
logEntry: (msg: LogEntry) => void;
|
|
104
|
+
otaProgress: (msg: OtaProgress) => void;
|
|
105
|
+
otaError: (msg: OtaError) => void;
|
|
106
|
+
deviceNickname: (msg: DeviceNicknameReply) => void;
|
|
107
|
+
deviceNicknameChanged: (msg: DeviceNicknameReply) => void;
|
|
108
|
+
};
|
|
109
|
+
export type TimeInboundHandlers = {
|
|
110
|
+
changed: (msg: TimeSnapshot) => void;
|
|
111
|
+
snapshot: (msg: TimeSnapshot) => void;
|
|
112
|
+
};
|
|
113
|
+
export type VoiceInboundHandlers = {
|
|
114
|
+
stateChanged: (msg: VoiceState) => void;
|
|
115
|
+
stateReply: (msg: VoiceStateReply) => void;
|
|
116
|
+
};
|
|
117
|
+
export type WebappInboundHandlers = {
|
|
118
|
+
listReply: (msg: WebappListReply) => void;
|
|
119
|
+
currentReply: (msg: WebappCurrentReply) => void;
|
|
120
|
+
activeReply: (msg: WebappActiveReply) => void;
|
|
121
|
+
iconReply: (msg: WebappIconReply) => void;
|
|
122
|
+
webappError: (msg: WebappError) => void;
|
|
123
|
+
activeChanged: (msg: WebappActiveChanged) => void;
|
|
124
|
+
webappInstalled: (msg: WebappInfo) => void;
|
|
125
|
+
webappUninstalled: (msg: WebappUninstalled) => void;
|
|
126
|
+
};
|
|
127
|
+
export type ForwardInboundHandlers = {
|
|
128
|
+
text: (msg: string) => void;
|
|
129
|
+
json: (msg: unknown) => void;
|
|
130
|
+
binary: (msg: Uint8Array) => void;
|
|
131
|
+
};
|
|
132
|
+
export declare class AssetSurface {
|
|
133
|
+
private readonly _client;
|
|
134
|
+
constructor(_client: BridgethingClient);
|
|
135
|
+
/** Subscribe to `Asset::Got` from the daemon. */
|
|
136
|
+
onGot(handler: (msg: AssetGot) => void): () => void;
|
|
137
|
+
/** Subscribe to `Asset::NotFound` from the daemon. */
|
|
138
|
+
onNotFound(handler: (msg: AssetNotFound) => void): () => void;
|
|
139
|
+
/** Subscribe to `Asset::Ready` from the daemon. */
|
|
140
|
+
onReady(handler: (msg: AssetReady) => void): () => void;
|
|
141
|
+
/** Subscribe to `Asset::Cleared` from the daemon. */
|
|
142
|
+
onCleared(handler: (msg: AssetCleared) => void): () => void;
|
|
143
|
+
/** Exhaustive subscribe over all inbound `Asset` variants. */
|
|
144
|
+
subscribe(handlers: AssetInboundHandlers): () => void;
|
|
145
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
146
|
+
subscribePartial(handlers: Partial<AssetInboundHandlers>): () => void;
|
|
147
|
+
private _subscribe;
|
|
148
|
+
/** Send `Asset::Preload` to the daemon. */
|
|
149
|
+
preload(payload: AssetPreload): Promise<void>;
|
|
150
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
151
|
+
get(req: AssetGet, options?: {
|
|
152
|
+
timeoutMs?: number;
|
|
153
|
+
}): Promise<TypedRequestResult<AssetGot, AssetNotFound>>;
|
|
154
|
+
}
|
|
155
|
+
export declare class AudioSurface {
|
|
156
|
+
private readonly _client;
|
|
157
|
+
constructor(_client: BridgethingClient);
|
|
158
|
+
/** Subscribe to `Audio::TtsStarted` from the daemon. */
|
|
159
|
+
onTtsStarted(handler: (msg: TtsStarted) => void): () => void;
|
|
160
|
+
/** Subscribe to `Audio::TtsEnded` from the daemon. */
|
|
161
|
+
onTtsEnded(handler: (msg: TtsEnded) => void): () => void;
|
|
162
|
+
/** Subscribe to `Audio::VolumeChanged` from the daemon. */
|
|
163
|
+
onVolumeChanged(handler: (msg: VolumeChanged) => void): () => void;
|
|
164
|
+
/** Exhaustive subscribe over all inbound `Audio` variants. */
|
|
165
|
+
subscribe(handlers: AudioInboundHandlers): () => void;
|
|
166
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
167
|
+
subscribePartial(handlers: Partial<AudioInboundHandlers>): () => void;
|
|
168
|
+
private _subscribe;
|
|
169
|
+
/** Send `Audio::VolumeUp` to the daemon. */
|
|
170
|
+
volumeUp(): Promise<void>;
|
|
171
|
+
/** Send `Audio::VolumeDown` to the daemon. */
|
|
172
|
+
volumeDown(): Promise<void>;
|
|
173
|
+
/** Send `Audio::SetVolume` to the daemon. */
|
|
174
|
+
setVolume(payload: SetVolume): Promise<void>;
|
|
175
|
+
/** Send `Audio::MuteToggle` to the daemon. */
|
|
176
|
+
muteToggle(): Promise<void>;
|
|
177
|
+
/** Send `Audio::SetMute` to the daemon. */
|
|
178
|
+
setMute(payload: SetMute): Promise<void>;
|
|
179
|
+
/** Send `Audio::Tts` to the daemon. */
|
|
180
|
+
tts(payload: Tts): Promise<void>;
|
|
181
|
+
/** Send `Audio::TtsCancel` to the daemon. */
|
|
182
|
+
ttsCancel(payload: TtsCancel): Promise<void>;
|
|
183
|
+
/** Send `Audio::TtsCancelAll` to the daemon. */
|
|
184
|
+
ttsCancelAll(): Promise<void>;
|
|
185
|
+
/** Send `Audio::Earcon` to the daemon. */
|
|
186
|
+
earcon(payload: Earcon): Promise<void>;
|
|
187
|
+
}
|
|
188
|
+
export declare class BluetoothSurface {
|
|
189
|
+
private readonly _client;
|
|
190
|
+
constructor(_client: BridgethingClient);
|
|
191
|
+
/** Subscribe to `Bluetooth::Status` from the daemon. */
|
|
192
|
+
onStatus(handler: (msg: BluetoothStatus) => void): () => void;
|
|
193
|
+
/** Subscribe to `Bluetooth::ConnectedDevice` from the daemon. */
|
|
194
|
+
onConnectedDevice(handler: (msg: ConnectedDevice) => void): () => void;
|
|
195
|
+
/** Subscribe to `Bluetooth::Interface` from the daemon. */
|
|
196
|
+
onInterface(handler: (msg: BluetoothInterface) => void): () => void;
|
|
197
|
+
/** Subscribe to `Bluetooth::PairingResult` from the daemon. */
|
|
198
|
+
onPairingResult(handler: (msg: BluetoothPairingResult) => void): () => void;
|
|
199
|
+
/** Subscribe to `Bluetooth::Pin` from the daemon. */
|
|
200
|
+
onPin(handler: (msg: BluetoothPin) => void): () => void;
|
|
201
|
+
/** Subscribe to `Bluetooth::PairedDevices` from the daemon. */
|
|
202
|
+
onPairedDevices(handler: (msg: PairedDevicesMap) => void): () => void;
|
|
203
|
+
/** Exhaustive subscribe over all inbound `Bluetooth` variants. */
|
|
204
|
+
subscribe(handlers: BluetoothInboundHandlers): () => void;
|
|
205
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
206
|
+
subscribePartial(handlers: Partial<BluetoothInboundHandlers>): () => void;
|
|
207
|
+
private _subscribe;
|
|
208
|
+
/** Send `Bluetooth::Connect` to the daemon. */
|
|
209
|
+
connect(payload: ConnectBluetooth): Promise<void>;
|
|
210
|
+
/** Send `Bluetooth::EnableDiscoverable` to the daemon. */
|
|
211
|
+
enableDiscoverable(): Promise<void>;
|
|
212
|
+
/** Send `Bluetooth::DisableDiscoverable` to the daemon. */
|
|
213
|
+
disableDiscoverable(): Promise<void>;
|
|
214
|
+
/** Send `Bluetooth::Forget` to the daemon. */
|
|
215
|
+
forget(payload: ForgetBluetooth): Promise<void>;
|
|
216
|
+
/** Send `Bluetooth::SetAlias` to the daemon. */
|
|
217
|
+
setAlias(payload: SetBluetoothAlias): Promise<void>;
|
|
218
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
219
|
+
list(options?: {
|
|
220
|
+
timeoutMs?: number;
|
|
221
|
+
}): Promise<TypedRequestResult<PairedDevicesMap, never>>;
|
|
222
|
+
}
|
|
223
|
+
export declare class CapabilitiesSurface {
|
|
224
|
+
private readonly _client;
|
|
225
|
+
constructor(_client: BridgethingClient);
|
|
226
|
+
/** Subscribe to `Capabilities::Update` from the daemon. */
|
|
227
|
+
onUpdate(handler: (msg: CapabilitiesSnapshot) => void): () => void;
|
|
228
|
+
/** Subscribe to `Capabilities::Snapshot` from the daemon. */
|
|
229
|
+
onSnapshot(handler: (msg: CapabilitiesSnapshot) => void): () => void;
|
|
230
|
+
/** Exhaustive subscribe over all inbound `Capabilities` variants. */
|
|
231
|
+
subscribe(handlers: CapabilitiesInboundHandlers): () => void;
|
|
232
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
233
|
+
subscribePartial(handlers: Partial<CapabilitiesInboundHandlers>): () => void;
|
|
234
|
+
private _subscribe;
|
|
235
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
236
|
+
get(options?: {
|
|
237
|
+
timeoutMs?: number;
|
|
238
|
+
}): Promise<TypedRequestResult<CapabilitiesSnapshot, never>>;
|
|
239
|
+
}
|
|
240
|
+
export declare class ConfigSurface {
|
|
241
|
+
private readonly _client;
|
|
242
|
+
constructor(_client: BridgethingClient);
|
|
243
|
+
/** Subscribe to `Config::Get` from the daemon. */
|
|
244
|
+
onGet(handler: (msg: ConfigGetReply) => void): () => void;
|
|
245
|
+
/** Subscribe to `Config::List` from the daemon. */
|
|
246
|
+
onList(handler: (msg: ConfigListReply) => void): () => void;
|
|
247
|
+
/** Subscribe to `Config::Changed` from the daemon. */
|
|
248
|
+
onChanged(handler: (msg: ConfigChanged) => void): () => void;
|
|
249
|
+
/** Exhaustive subscribe over all inbound `Config` variants. */
|
|
250
|
+
subscribe(handlers: ConfigInboundHandlers): () => void;
|
|
251
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
252
|
+
subscribePartial(handlers: Partial<ConfigInboundHandlers>): () => void;
|
|
253
|
+
private _subscribe;
|
|
254
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
255
|
+
get(req: ConfigGet, options?: {
|
|
256
|
+
timeoutMs?: number;
|
|
257
|
+
}): Promise<TypedRequestResult<ConfigGetReply, never>>;
|
|
258
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
259
|
+
list(options?: {
|
|
260
|
+
timeoutMs?: number;
|
|
261
|
+
}): Promise<TypedRequestResult<ConfigListReply, never>>;
|
|
262
|
+
}
|
|
263
|
+
export declare class GeoSurface {
|
|
264
|
+
private readonly _client;
|
|
265
|
+
constructor(_client: BridgethingClient);
|
|
266
|
+
/** Subscribe to `Geo::Position` from the daemon. */
|
|
267
|
+
onPosition(handler: (msg: Position) => void): () => void;
|
|
268
|
+
/** Subscribe to `Geo::WatchReply` from the daemon. */
|
|
269
|
+
onWatchReply(handler: (msg: GeoWatchReply) => void): () => void;
|
|
270
|
+
/** Subscribe to `Geo::GetOnceReply` from the daemon. */
|
|
271
|
+
onGetOnceReply(handler: (msg: GeoGetOnceReply) => void): () => void;
|
|
272
|
+
/** Subscribe to `Geo::ErrorReply` from the daemon. */
|
|
273
|
+
onErrorReply(handler: (msg: GeoErrorReply) => void): () => void;
|
|
274
|
+
/** Exhaustive subscribe over all inbound `Geo` variants. */
|
|
275
|
+
subscribe(handlers: GeoInboundHandlers): () => void;
|
|
276
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
277
|
+
subscribePartial(handlers: Partial<GeoInboundHandlers>): () => void;
|
|
278
|
+
private _subscribe;
|
|
279
|
+
/** Send `Geo::Unwatch` to the daemon. */
|
|
280
|
+
unwatch(payload: GeoUnwatch): Promise<void>;
|
|
281
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
282
|
+
watch(req: GeoWatch, options?: {
|
|
283
|
+
timeoutMs?: number;
|
|
284
|
+
}): Promise<TypedRequestResult<GeoWatchReply, GeoErrorReply>>;
|
|
285
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
286
|
+
getOnce(req: GeoGetOnce, options?: {
|
|
287
|
+
timeoutMs?: number;
|
|
288
|
+
}): Promise<TypedRequestResult<GeoGetOnceReply, GeoErrorReply>>;
|
|
289
|
+
}
|
|
290
|
+
export declare class HardwareSurface {
|
|
291
|
+
private readonly _client;
|
|
292
|
+
constructor(_client: BridgethingClient);
|
|
293
|
+
/** Subscribe to `Hardware::AmbientLightUpdate` from the daemon. */
|
|
294
|
+
onAmbientLightUpdate(handler: (msg: AmbientLightUpdate) => void): () => void;
|
|
295
|
+
/** Subscribe to `Hardware::BrightnessChanged` from the daemon. */
|
|
296
|
+
onBrightnessChanged(handler: (msg: BrightnessState) => void): () => void;
|
|
297
|
+
/** Subscribe to `Hardware::StateReply` from the daemon. */
|
|
298
|
+
onStateReply(handler: (msg: HardwareStateReply) => void): () => void;
|
|
299
|
+
/** Exhaustive subscribe over all inbound `Hardware` variants. */
|
|
300
|
+
subscribe(handlers: HardwareInboundHandlers): () => void;
|
|
301
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
302
|
+
subscribePartial(handlers: Partial<HardwareInboundHandlers>): () => void;
|
|
303
|
+
private _subscribe;
|
|
304
|
+
/** Send `Hardware::DisplaySetMode` to the daemon. */
|
|
305
|
+
displaySetMode(payload: DisplaySetMode): Promise<void>;
|
|
306
|
+
/** Send `Hardware::DisplaySetLevel` to the daemon. */
|
|
307
|
+
displaySetLevel(payload: DisplaySetLevel): Promise<void>;
|
|
308
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
309
|
+
stateGet(options?: {
|
|
310
|
+
timeoutMs?: number;
|
|
311
|
+
}): Promise<TypedRequestResult<HardwareStateReply, never>>;
|
|
312
|
+
}
|
|
313
|
+
export declare class LibrarySurface {
|
|
314
|
+
private readonly _client;
|
|
315
|
+
constructor(_client: BridgethingClient);
|
|
316
|
+
/** Subscribe to `Library::BrowseReply` from the daemon. */
|
|
317
|
+
onBrowseReply(handler: (msg: LibraryBrowseReply) => void): () => void;
|
|
318
|
+
/** Subscribe to `Library::SearchReply` from the daemon. */
|
|
319
|
+
onSearchReply(handler: (msg: LibrarySearchReply) => void): () => void;
|
|
320
|
+
/** Subscribe to `Library::RecommendationsReply` from the daemon. */
|
|
321
|
+
onRecommendationsReply(handler: (msg: LibraryRecommendationsReply) => void): () => void;
|
|
322
|
+
/** Subscribe to `Library::FavoritesListReply` from the daemon. */
|
|
323
|
+
onFavoritesListReply(handler: (msg: LibraryFavoritesListReply) => void): () => void;
|
|
324
|
+
/** Subscribe to `Library::FavoritesContainsReply` from the daemon. */
|
|
325
|
+
onFavoritesContainsReply(handler: (msg: LibraryFavoritesContainsReply) => void): () => void;
|
|
326
|
+
/** Subscribe to `Library::LibraryErrorReply` from the daemon. */
|
|
327
|
+
onLibraryErrorReply(handler: (msg: LibraryErrorReply) => void): () => void;
|
|
328
|
+
/** Subscribe to `Library::FavoriteChanged` from the daemon. */
|
|
329
|
+
onFavoriteChanged(handler: (msg: FavoriteChanged) => void): () => void;
|
|
330
|
+
/** Exhaustive subscribe over all inbound `Library` variants. */
|
|
331
|
+
subscribe(handlers: LibraryInboundHandlers): () => void;
|
|
332
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
333
|
+
subscribePartial(handlers: Partial<LibraryInboundHandlers>): () => void;
|
|
334
|
+
private _subscribe;
|
|
335
|
+
/** Send `Library::FavoritesToggle` to the daemon. */
|
|
336
|
+
favoritesToggle(payload: FavoritesToggle): Promise<void>;
|
|
337
|
+
/** Send `Library::FavoritesSet` to the daemon. */
|
|
338
|
+
favoritesSet(payload: FavoritesSet): Promise<void>;
|
|
339
|
+
/** Send `Library::FavoritesSetMany` to the daemon. */
|
|
340
|
+
favoritesSetMany(payload: FavoritesSetMany): Promise<void>;
|
|
341
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
342
|
+
browse(req: LibraryBrowse, options?: {
|
|
343
|
+
timeoutMs?: number;
|
|
344
|
+
}): Promise<TypedRequestResult<LibraryBrowseReply, LibraryErrorReply>>;
|
|
345
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
346
|
+
search(req: LibrarySearch, options?: {
|
|
347
|
+
timeoutMs?: number;
|
|
348
|
+
}): Promise<TypedRequestResult<LibrarySearchReply, LibraryErrorReply>>;
|
|
349
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
350
|
+
recommendations(req: LibraryRecommendations, options?: {
|
|
351
|
+
timeoutMs?: number;
|
|
352
|
+
}): Promise<TypedRequestResult<LibraryRecommendationsReply, LibraryErrorReply>>;
|
|
353
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
354
|
+
favoritesList(req: LibraryFavoritesList, options?: {
|
|
355
|
+
timeoutMs?: number;
|
|
356
|
+
}): Promise<TypedRequestResult<LibraryFavoritesListReply, LibraryErrorReply>>;
|
|
357
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
358
|
+
favoritesContains(req: LibraryFavoritesContains, options?: {
|
|
359
|
+
timeoutMs?: number;
|
|
360
|
+
}): Promise<TypedRequestResult<LibraryFavoritesContainsReply, LibraryErrorReply>>;
|
|
361
|
+
}
|
|
362
|
+
export declare class NetSurface {
|
|
363
|
+
private readonly _client;
|
|
364
|
+
constructor(_client: BridgethingClient);
|
|
365
|
+
/** Subscribe to `Net::FetchReply` from the daemon. */
|
|
366
|
+
onFetchReply(handler: (msg: NetFetchReply) => void): () => void;
|
|
367
|
+
/** Subscribe to `Net::FetchErrorReply` from the daemon. */
|
|
368
|
+
onFetchErrorReply(handler: (msg: NetFetchErrorReply) => void): () => void;
|
|
369
|
+
/** Subscribe to `Net::WsOpenReply` from the daemon. */
|
|
370
|
+
onWsOpenReply(handler: (msg: NetWsOpenReply) => void): () => void;
|
|
371
|
+
/** Subscribe to `Net::WsErrorReply` from the daemon. */
|
|
372
|
+
onWsErrorReply(handler: (msg: NetWsErrorReply) => void): () => void;
|
|
373
|
+
/** Subscribe to `Net::WsMessage` from the daemon. */
|
|
374
|
+
onWsMessage(handler: (msg: NetWsMessage) => void): () => void;
|
|
375
|
+
/** Subscribe to `Net::WsClosed` from the daemon. */
|
|
376
|
+
onWsClosed(handler: (msg: NetWsClosed) => void): () => void;
|
|
377
|
+
/** Subscribe to `Net::WsErrorEvent` from the daemon. */
|
|
378
|
+
onWsErrorEvent(handler: (msg: NetWsErrorEvent) => void): () => void;
|
|
379
|
+
/** Subscribe to `Net::StreamBegin` from the daemon. */
|
|
380
|
+
onStreamBegin(handler: (msg: StreamBegin) => void): () => void;
|
|
381
|
+
/** Subscribe to `Net::StreamChunk` from the daemon. */
|
|
382
|
+
onStreamChunk(handler: (msg: StreamChunk) => void): () => void;
|
|
383
|
+
/** Subscribe to `Net::StreamEnd` from the daemon. */
|
|
384
|
+
onStreamEnd(handler: (msg: StreamEnd) => void): () => void;
|
|
385
|
+
/** Subscribe to `Net::StreamError` from the daemon. */
|
|
386
|
+
onStreamError(handler: (msg: StreamError) => void): () => void;
|
|
387
|
+
/** Exhaustive subscribe over all inbound `Net` variants. */
|
|
388
|
+
subscribe(handlers: NetInboundHandlers): () => void;
|
|
389
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
390
|
+
subscribePartial(handlers: Partial<NetInboundHandlers>): () => void;
|
|
391
|
+
private _subscribe;
|
|
392
|
+
/** Send `Net::WsClose` to the daemon. */
|
|
393
|
+
wsClose(payload: NetWsClose): Promise<void>;
|
|
394
|
+
/** Send `Net::WsSend` to the daemon. */
|
|
395
|
+
wsSend(payload: NetWsSend): Promise<void>;
|
|
396
|
+
/** Send `Net::StreamOpen` to the daemon. */
|
|
397
|
+
streamOpen(payload: NetStreamOpen): Promise<void>;
|
|
398
|
+
/** Send `Net::StreamCancel` to the daemon. */
|
|
399
|
+
streamCancel(payload: NetStreamCancel): Promise<void>;
|
|
400
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
401
|
+
fetch(req: NetFetch, options?: {
|
|
402
|
+
timeoutMs?: number;
|
|
403
|
+
}): Promise<TypedRequestResult<NetFetchReply, NetFetchErrorReply>>;
|
|
404
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
405
|
+
wsOpen(req: NetWsOpen, options?: {
|
|
406
|
+
timeoutMs?: number;
|
|
407
|
+
}): Promise<TypedRequestResult<NetWsOpenReply, NetWsErrorReply>>;
|
|
408
|
+
}
|
|
409
|
+
export declare class NotificationsSurface {
|
|
410
|
+
private readonly _client;
|
|
411
|
+
constructor(_client: BridgethingClient);
|
|
412
|
+
/** Subscribe to `Notifications::Posted` from the daemon. */
|
|
413
|
+
onPosted(handler: (msg: Notification) => void): () => void;
|
|
414
|
+
/** Subscribe to `Notifications::Updated` from the daemon. */
|
|
415
|
+
onUpdated(handler: (msg: Notification) => void): () => void;
|
|
416
|
+
/** Subscribe to `Notifications::Removed` from the daemon. */
|
|
417
|
+
onRemoved(handler: (msg: NotificationRemoved) => void): () => void;
|
|
418
|
+
/** Exhaustive subscribe over all inbound `Notifications` variants. */
|
|
419
|
+
subscribe(handlers: NotificationsInboundHandlers): () => void;
|
|
420
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
421
|
+
subscribePartial(handlers: Partial<NotificationsInboundHandlers>): () => void;
|
|
422
|
+
private _subscribe;
|
|
423
|
+
/** Send `Notifications::InvokePositive` to the daemon. */
|
|
424
|
+
invokePositive(payload: NotificationInvoke): Promise<void>;
|
|
425
|
+
/** Send `Notifications::InvokeNegative` to the daemon. */
|
|
426
|
+
invokeNegative(payload: NotificationInvoke): Promise<void>;
|
|
427
|
+
}
|
|
428
|
+
export declare class PeerSurface {
|
|
429
|
+
private readonly _client;
|
|
430
|
+
constructor(_client: BridgethingClient);
|
|
431
|
+
/** Subscribe to `Peer::Snapshot` from the daemon. */
|
|
432
|
+
onSnapshot(handler: (msg: PeerSnapshotMap) => void): () => void;
|
|
433
|
+
}
|
|
434
|
+
export declare class PhoneSurface {
|
|
435
|
+
private readonly _client;
|
|
436
|
+
constructor(_client: BridgethingClient);
|
|
437
|
+
/** Subscribe to `Phone::CallStarted` from the daemon. */
|
|
438
|
+
onCallStarted(handler: (msg: PhoneCall) => void): () => void;
|
|
439
|
+
/** Subscribe to `Phone::CallUpdated` from the daemon. */
|
|
440
|
+
onCallUpdated(handler: (msg: PhoneCall) => void): () => void;
|
|
441
|
+
/** Subscribe to `Phone::CallEnded` from the daemon. */
|
|
442
|
+
onCallEnded(handler: (msg: PhoneCallEnded) => void): () => void;
|
|
443
|
+
/** Subscribe to `Phone::CommunicationsChanged` from the daemon. */
|
|
444
|
+
onCommunicationsChanged(handler: (msg: PhoneCommunicationsReply) => void): () => void;
|
|
445
|
+
/** Subscribe to `Phone::StateReply` from the daemon. */
|
|
446
|
+
onStateReply(handler: (msg: PhoneStateReply) => void): () => void;
|
|
447
|
+
/** Subscribe to `Phone::ErrorReply` from the daemon. */
|
|
448
|
+
onErrorReply(handler: (msg: PhoneErrorReply) => void): () => void;
|
|
449
|
+
/** Exhaustive subscribe over all inbound `Phone` variants. */
|
|
450
|
+
subscribe(handlers: PhoneInboundHandlers): () => void;
|
|
451
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
452
|
+
subscribePartial(handlers: Partial<PhoneInboundHandlers>): () => void;
|
|
453
|
+
private _subscribe;
|
|
454
|
+
/** Send `Phone::Answer` to the daemon. */
|
|
455
|
+
answer(payload: PhoneCallAction): Promise<void>;
|
|
456
|
+
/** Send `Phone::Accept` to the daemon. */
|
|
457
|
+
accept(payload: PhoneAcceptAction): Promise<void>;
|
|
458
|
+
/** Send `Phone::Decline` to the daemon. */
|
|
459
|
+
decline(payload: PhoneCallAction): Promise<void>;
|
|
460
|
+
/** Send `Phone::End` to the daemon. */
|
|
461
|
+
end(payload: PhoneCallAction): Promise<void>;
|
|
462
|
+
/** Send `Phone::EndTyped` to the daemon. */
|
|
463
|
+
endTyped(payload: PhoneEndAction): Promise<void>;
|
|
464
|
+
/** Send `Phone::Hold` to the daemon. */
|
|
465
|
+
hold(payload: PhoneCallAction): Promise<void>;
|
|
466
|
+
/** Send `Phone::Unhold` to the daemon. */
|
|
467
|
+
unhold(payload: PhoneCallAction): Promise<void>;
|
|
468
|
+
/** Send `Phone::Initiate` to the daemon. */
|
|
469
|
+
initiate(payload: PhoneInitiateAction): Promise<void>;
|
|
470
|
+
/** Send `Phone::Swap` to the daemon. */
|
|
471
|
+
swap(): Promise<void>;
|
|
472
|
+
/** Send `Phone::Merge` to the daemon. */
|
|
473
|
+
merge(): Promise<void>;
|
|
474
|
+
/** Send `Phone::Mute` to the daemon. */
|
|
475
|
+
mute(payload: PhoneMuteAction): Promise<void>;
|
|
476
|
+
/** Send `Phone::Dtmf` to the daemon. */
|
|
477
|
+
dtmf(payload: PhoneDtmfAction): Promise<void>;
|
|
478
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
479
|
+
stateGet(options?: {
|
|
480
|
+
timeoutMs?: number;
|
|
481
|
+
}): Promise<TypedRequestResult<PhoneStateReply, never>>;
|
|
482
|
+
}
|
|
483
|
+
export declare class PlayerSurface {
|
|
484
|
+
private readonly _client;
|
|
485
|
+
constructor(_client: BridgethingClient);
|
|
486
|
+
/** Subscribe to `Player::Snapshot` from the daemon. */
|
|
487
|
+
onSnapshot(handler: (msg: PlayerStateReply) => void): () => void;
|
|
488
|
+
/** Subscribe to `Player::Delta` from the daemon. */
|
|
489
|
+
onDelta(handler: (msg: NowPlayingUpdate) => void): () => void;
|
|
490
|
+
/** Subscribe to `Player::QueueChanged` from the daemon. */
|
|
491
|
+
onQueueChanged(handler: (msg: PlayerQueueReply) => void): () => void;
|
|
492
|
+
/** Subscribe to `Player::StateReply` from the daemon. */
|
|
493
|
+
onStateReply(handler: (msg: PlayerStateReply) => void): () => void;
|
|
494
|
+
/** Subscribe to `Player::QueueReply` from the daemon. */
|
|
495
|
+
onQueueReply(handler: (msg: PlayerQueueReply) => void): () => void;
|
|
496
|
+
/** Subscribe to `Player::ErrorReply` from the daemon. */
|
|
497
|
+
onErrorReply(handler: (msg: PlayerErrorReply) => void): () => void;
|
|
498
|
+
/** Exhaustive subscribe over all inbound `Player` variants. */
|
|
499
|
+
subscribe(handlers: PlayerInboundHandlers): () => void;
|
|
500
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
501
|
+
subscribePartial(handlers: Partial<PlayerInboundHandlers>): () => void;
|
|
502
|
+
private _subscribe;
|
|
503
|
+
/** Send `Player::Play` to the daemon. */
|
|
504
|
+
play(payload: PlayUri): Promise<void>;
|
|
505
|
+
/** Send `Player::Queue` to the daemon. */
|
|
506
|
+
queue(payload: QueueUri): Promise<void>;
|
|
507
|
+
/** Send `Player::Pause` to the daemon. */
|
|
508
|
+
pause(): Promise<void>;
|
|
509
|
+
/** Send `Player::Resume` to the daemon. */
|
|
510
|
+
resume(): Promise<void>;
|
|
511
|
+
/** Send `Player::SkipNext` to the daemon. */
|
|
512
|
+
skipNext(): Promise<void>;
|
|
513
|
+
/** Send `Player::SkipPrev` to the daemon. */
|
|
514
|
+
skipPrev(payload: SkipPrev): Promise<void>;
|
|
515
|
+
/** Send `Player::SkipToIndex` to the daemon. */
|
|
516
|
+
skipToIndex(payload: SkipToIndex): Promise<void>;
|
|
517
|
+
/** Send `Player::SeekTo` to the daemon. */
|
|
518
|
+
seekTo(payload: SeekTo): Promise<void>;
|
|
519
|
+
/** Send `Player::SetShuffle` to the daemon. */
|
|
520
|
+
setShuffle(payload: SetShuffle): Promise<void>;
|
|
521
|
+
/** Send `Player::SetRepeat` to the daemon. */
|
|
522
|
+
setRepeat(payload: SetRepeat): Promise<void>;
|
|
523
|
+
/** Send `Player::SetSpeed` to the daemon. */
|
|
524
|
+
setSpeed(payload: SetSpeed): Promise<void>;
|
|
525
|
+
/** Send `Player::SetCrossfade` to the daemon. */
|
|
526
|
+
setCrossfade(payload: SetCrossfade): Promise<void>;
|
|
527
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
528
|
+
stateGet(options?: {
|
|
529
|
+
timeoutMs?: number;
|
|
530
|
+
}): Promise<TypedRequestResult<PlayerStateReply, never>>;
|
|
531
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
532
|
+
queueGet(options?: {
|
|
533
|
+
timeoutMs?: number;
|
|
534
|
+
}): Promise<TypedRequestResult<PlayerQueueReply, never>>;
|
|
535
|
+
}
|
|
536
|
+
export declare class SystemSurface {
|
|
537
|
+
private readonly _client;
|
|
538
|
+
constructor(_client: BridgethingClient);
|
|
539
|
+
/** Subscribe to `System::Version` from the daemon. */
|
|
540
|
+
onVersion(handler: (msg: BridgeThingMeta) => void): () => void;
|
|
541
|
+
/** Subscribe to `System::DiagnosticsReply` from the daemon. */
|
|
542
|
+
onDiagnosticsReply(handler: (msg: DiagnosticsReply) => void): () => void;
|
|
543
|
+
/** Subscribe to `System::LogsTailReply` from the daemon. */
|
|
544
|
+
onLogsTailReply(handler: (msg: LogsTailReply) => void): () => void;
|
|
545
|
+
/** Subscribe to `System::LogsSubscribeReply` from the daemon. */
|
|
546
|
+
onLogsSubscribeReply(handler: (msg: LogsSubscribeReply) => void): () => void;
|
|
547
|
+
/** Subscribe to `System::LogEntry` from the daemon. */
|
|
548
|
+
onLogEntry(handler: (msg: LogEntry) => void): () => void;
|
|
549
|
+
/** Subscribe to `System::OtaProgress` from the daemon. */
|
|
550
|
+
onOtaProgress(handler: (msg: OtaProgress) => void): () => void;
|
|
551
|
+
/** Subscribe to `System::OtaError` from the daemon. */
|
|
552
|
+
onOtaError(handler: (msg: OtaError) => void): () => void;
|
|
553
|
+
/** Subscribe to `System::DeviceNickname` from the daemon. */
|
|
554
|
+
onDeviceNickname(handler: (msg: DeviceNicknameReply) => void): () => void;
|
|
555
|
+
/** Subscribe to `System::DeviceNicknameChanged` from the daemon. */
|
|
556
|
+
onDeviceNicknameChanged(handler: (msg: DeviceNicknameReply) => void): () => void;
|
|
557
|
+
/** Exhaustive subscribe over all inbound `System` variants. */
|
|
558
|
+
subscribe(handlers: SystemInboundHandlers): () => void;
|
|
559
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
560
|
+
subscribePartial(handlers: Partial<SystemInboundHandlers>): () => void;
|
|
561
|
+
private _subscribe;
|
|
562
|
+
/** Send `System::LogsUnsubscribe` to the daemon. */
|
|
563
|
+
logsUnsubscribe(payload: LogsUnsubscribe): Promise<void>;
|
|
564
|
+
/** Send `System::Reboot` to the daemon. */
|
|
565
|
+
reboot(): Promise<void>;
|
|
566
|
+
/** Send `System::PowerOff` to the daemon. */
|
|
567
|
+
powerOff(): Promise<void>;
|
|
568
|
+
/** Send `System::FactoryReset` to the daemon. */
|
|
569
|
+
factoryReset(): Promise<void>;
|
|
570
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
571
|
+
versionRequest(options?: {
|
|
572
|
+
timeoutMs?: number;
|
|
573
|
+
}): Promise<TypedRequestResult<BridgeThingMeta, never>>;
|
|
574
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
575
|
+
diagnosticsGet(options?: {
|
|
576
|
+
timeoutMs?: number;
|
|
577
|
+
}): Promise<TypedRequestResult<DiagnosticsReply, never>>;
|
|
578
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
579
|
+
logsTail(req: LogsTail, options?: {
|
|
580
|
+
timeoutMs?: number;
|
|
581
|
+
}): Promise<TypedRequestResult<LogsTailReply, never>>;
|
|
582
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
583
|
+
logsSubscribe(req: LogsSubscribe, options?: {
|
|
584
|
+
timeoutMs?: number;
|
|
585
|
+
}): Promise<TypedRequestResult<LogsSubscribeReply, never>>;
|
|
586
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
587
|
+
deviceGetNickname(options?: {
|
|
588
|
+
timeoutMs?: number;
|
|
589
|
+
}): Promise<TypedRequestResult<DeviceNicknameReply, never>>;
|
|
590
|
+
}
|
|
591
|
+
export declare class TimeSurface {
|
|
592
|
+
private readonly _client;
|
|
593
|
+
constructor(_client: BridgethingClient);
|
|
594
|
+
/** Subscribe to `Time::Changed` from the daemon. */
|
|
595
|
+
onChanged(handler: (msg: TimeSnapshot) => void): () => void;
|
|
596
|
+
/** Subscribe to `Time::Snapshot` from the daemon. */
|
|
597
|
+
onSnapshot(handler: (msg: TimeSnapshot) => void): () => void;
|
|
598
|
+
/** Exhaustive subscribe over all inbound `Time` variants. */
|
|
599
|
+
subscribe(handlers: TimeInboundHandlers): () => void;
|
|
600
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
601
|
+
subscribePartial(handlers: Partial<TimeInboundHandlers>): () => void;
|
|
602
|
+
private _subscribe;
|
|
603
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
604
|
+
get(options?: {
|
|
605
|
+
timeoutMs?: number;
|
|
606
|
+
}): Promise<TypedRequestResult<TimeSnapshot, never>>;
|
|
607
|
+
}
|
|
608
|
+
export declare class VoiceSurface {
|
|
609
|
+
private readonly _client;
|
|
610
|
+
constructor(_client: BridgethingClient);
|
|
611
|
+
/** Subscribe to `Voice::StateChanged` from the daemon. */
|
|
612
|
+
onStateChanged(handler: (msg: VoiceState) => void): () => void;
|
|
613
|
+
/** Subscribe to `Voice::StateReply` from the daemon. */
|
|
614
|
+
onStateReply(handler: (msg: VoiceStateReply) => void): () => void;
|
|
615
|
+
/** Exhaustive subscribe over all inbound `Voice` variants. */
|
|
616
|
+
subscribe(handlers: VoiceInboundHandlers): () => void;
|
|
617
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
618
|
+
subscribePartial(handlers: Partial<VoiceInboundHandlers>): () => void;
|
|
619
|
+
private _subscribe;
|
|
620
|
+
/** Send `Voice::Cancel` to the daemon. */
|
|
621
|
+
cancel(): Promise<void>;
|
|
622
|
+
/** Send `Voice::PushToTalk` to the daemon. */
|
|
623
|
+
pushToTalk(): Promise<void>;
|
|
624
|
+
/** Send `Voice::MuteMic` to the daemon. */
|
|
625
|
+
muteMic(payload: MicMute): Promise<void>;
|
|
626
|
+
/** Send `Voice::UnmuteMic` to the daemon. */
|
|
627
|
+
unmuteMic(payload: MicUnmute): Promise<void>;
|
|
628
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
629
|
+
stateGet(options?: {
|
|
630
|
+
timeoutMs?: number;
|
|
631
|
+
}): Promise<TypedRequestResult<VoiceStateReply, never>>;
|
|
632
|
+
}
|
|
633
|
+
export declare class WebappSurface {
|
|
634
|
+
private readonly _client;
|
|
635
|
+
constructor(_client: BridgethingClient);
|
|
636
|
+
/** Subscribe to `Webapp::ListReply` from the daemon. */
|
|
637
|
+
onListReply(handler: (msg: WebappListReply) => void): () => void;
|
|
638
|
+
/** Subscribe to `Webapp::CurrentReply` from the daemon. */
|
|
639
|
+
onCurrentReply(handler: (msg: WebappCurrentReply) => void): () => void;
|
|
640
|
+
/** Subscribe to `Webapp::ActiveReply` from the daemon. */
|
|
641
|
+
onActiveReply(handler: (msg: WebappActiveReply) => void): () => void;
|
|
642
|
+
/** Subscribe to `Webapp::IconReply` from the daemon. */
|
|
643
|
+
onIconReply(handler: (msg: WebappIconReply) => void): () => void;
|
|
644
|
+
/** Subscribe to `Webapp::WebappError` from the daemon. */
|
|
645
|
+
onWebappError(handler: (msg: WebappError) => void): () => void;
|
|
646
|
+
/** Subscribe to `Webapp::ActiveChanged` from the daemon. */
|
|
647
|
+
onActiveChanged(handler: (msg: WebappActiveChanged) => void): () => void;
|
|
648
|
+
/** Subscribe to `Webapp::WebappInstalled` from the daemon. */
|
|
649
|
+
onWebappInstalled(handler: (msg: WebappInfo) => void): () => void;
|
|
650
|
+
/** Subscribe to `Webapp::WebappUninstalled` from the daemon. */
|
|
651
|
+
onWebappUninstalled(handler: (msg: WebappUninstalled) => void): () => void;
|
|
652
|
+
/** Exhaustive subscribe over all inbound `Webapp` variants. */
|
|
653
|
+
subscribe(handlers: WebappInboundHandlers): () => void;
|
|
654
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
655
|
+
subscribePartial(handlers: Partial<WebappInboundHandlers>): () => void;
|
|
656
|
+
private _subscribe;
|
|
657
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
658
|
+
list(options?: {
|
|
659
|
+
timeoutMs?: number;
|
|
660
|
+
}): Promise<TypedRequestResult<WebappListReply, never>>;
|
|
661
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
662
|
+
current(options?: {
|
|
663
|
+
timeoutMs?: number;
|
|
664
|
+
}): Promise<TypedRequestResult<WebappCurrentReply, never>>;
|
|
665
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
666
|
+
activate(req: WebappActivate, options?: {
|
|
667
|
+
timeoutMs?: number;
|
|
668
|
+
}): Promise<TypedRequestResult<WebappActiveReply, WebappError>>;
|
|
669
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
670
|
+
icon(req: WebappIcon, options?: {
|
|
671
|
+
timeoutMs?: number;
|
|
672
|
+
}): Promise<TypedRequestResult<WebappIconReply, WebappError>>;
|
|
673
|
+
}
|
|
674
|
+
export declare class ForwardSurface {
|
|
675
|
+
private readonly _client;
|
|
676
|
+
constructor(_client: BridgethingClient);
|
|
677
|
+
/** Subscribe to `Forward::Text` from the daemon. */
|
|
678
|
+
onText(handler: (msg: string) => void): () => void;
|
|
679
|
+
/** Subscribe to `Forward::Json` from the daemon. */
|
|
680
|
+
onJson(handler: (msg: unknown) => void): () => void;
|
|
681
|
+
/** Subscribe to `Forward::Binary` from the daemon. */
|
|
682
|
+
onBinary(handler: (msg: Uint8Array) => void): () => void;
|
|
683
|
+
/** Exhaustive subscribe over all inbound `Forward` variants. */
|
|
684
|
+
subscribe(handlers: ForwardInboundHandlers): () => void;
|
|
685
|
+
/** Same as `subscribe` but every handler is optional. */
|
|
686
|
+
subscribePartial(handlers: Partial<ForwardInboundHandlers>): () => void;
|
|
687
|
+
private _subscribe;
|
|
688
|
+
/** Send `Forward::Text` to the daemon. */
|
|
689
|
+
text(payload: string): Promise<void>;
|
|
690
|
+
/** Send `Forward::Json` to the daemon. */
|
|
691
|
+
json(payload: unknown): Promise<void>;
|
|
692
|
+
/** Send `Forward::Binary` to the daemon. */
|
|
693
|
+
binary(payload: Uint8Array): Promise<void>;
|
|
694
|
+
}
|
|
695
|
+
export declare class StoreSurface {
|
|
696
|
+
private readonly _client;
|
|
697
|
+
constructor(_client: BridgethingClient);
|
|
698
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
699
|
+
get(req: KVGet, options?: {
|
|
700
|
+
timeoutMs?: number;
|
|
701
|
+
}): Promise<TypedRequestResult<StorageResponse, never>>;
|
|
702
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
703
|
+
put(req: KVPut, options?: {
|
|
704
|
+
timeoutMs?: number;
|
|
705
|
+
}): Promise<TypedRequestResult<StorageResponse, never>>;
|
|
706
|
+
/** Typed request to the daemon: webapp sends, daemon responds. */
|
|
707
|
+
delete(req: KVDelete, options?: {
|
|
708
|
+
timeoutMs?: number;
|
|
709
|
+
}): Promise<TypedRequestResult<StorageResponse, never>>;
|
|
710
|
+
}
|
|
711
|
+
export type ClientMessageHandlers = {
|
|
712
|
+
asset: AssetInboundHandlers;
|
|
713
|
+
audio: AudioInboundHandlers;
|
|
714
|
+
bluetooth: BluetoothInboundHandlers;
|
|
715
|
+
capabilities: CapabilitiesInboundHandlers;
|
|
716
|
+
config: ConfigInboundHandlers;
|
|
717
|
+
geo: GeoInboundHandlers;
|
|
718
|
+
hardware: HardwareInboundHandlers;
|
|
719
|
+
library: LibraryInboundHandlers;
|
|
720
|
+
net: NetInboundHandlers;
|
|
721
|
+
notifications: NotificationsInboundHandlers;
|
|
722
|
+
peer: (msg: PeerSnapshotMap) => void;
|
|
723
|
+
phone: PhoneInboundHandlers;
|
|
724
|
+
player: PlayerInboundHandlers;
|
|
725
|
+
system: SystemInboundHandlers;
|
|
726
|
+
time: TimeInboundHandlers;
|
|
727
|
+
voice: VoiceInboundHandlers;
|
|
728
|
+
webapp: WebappInboundHandlers;
|
|
729
|
+
forward: ForwardInboundHandlers;
|
|
730
|
+
};
|
|
731
|
+
export type PartialClientMessageHandlers = {
|
|
732
|
+
asset?: Partial<AssetInboundHandlers>;
|
|
733
|
+
audio?: Partial<AudioInboundHandlers>;
|
|
734
|
+
bluetooth?: Partial<BluetoothInboundHandlers>;
|
|
735
|
+
capabilities?: Partial<CapabilitiesInboundHandlers>;
|
|
736
|
+
config?: Partial<ConfigInboundHandlers>;
|
|
737
|
+
geo?: Partial<GeoInboundHandlers>;
|
|
738
|
+
hardware?: Partial<HardwareInboundHandlers>;
|
|
739
|
+
library?: Partial<LibraryInboundHandlers>;
|
|
740
|
+
net?: Partial<NetInboundHandlers>;
|
|
741
|
+
notifications?: Partial<NotificationsInboundHandlers>;
|
|
742
|
+
peer?: (msg: PeerSnapshotMap) => void;
|
|
743
|
+
phone?: Partial<PhoneInboundHandlers>;
|
|
744
|
+
player?: Partial<PlayerInboundHandlers>;
|
|
745
|
+
system?: Partial<SystemInboundHandlers>;
|
|
746
|
+
time?: Partial<TimeInboundHandlers>;
|
|
747
|
+
voice?: Partial<VoiceInboundHandlers>;
|
|
748
|
+
webapp?: Partial<WebappInboundHandlers>;
|
|
749
|
+
forward?: Partial<ForwardInboundHandlers>;
|
|
750
|
+
};
|
|
751
|
+
/**
|
|
752
|
+
* Codegen-emitted shape applied to `BridgethingClient` at runtime via
|
|
753
|
+
* `applyDispatch()`. `index.ts` declares `interface BridgethingClient
|
|
754
|
+
* extends ClientSurfaces {}` so class+interface merging picks these up
|
|
755
|
+
* for consumers regardless of how the published `.d.ts` is bundled.
|
|
756
|
+
*/
|
|
757
|
+
export interface ClientSurfaces {
|
|
758
|
+
/** Methods scoped to the `Asset` wire surface. */
|
|
759
|
+
readonly asset: AssetSurface;
|
|
760
|
+
/** Methods scoped to the `Audio` wire surface. */
|
|
761
|
+
readonly audio: AudioSurface;
|
|
762
|
+
/** Methods scoped to the `Bluetooth` wire surface. */
|
|
763
|
+
readonly bluetooth: BluetoothSurface;
|
|
764
|
+
/** Methods scoped to the `Capabilities` wire surface. */
|
|
765
|
+
readonly capabilities: CapabilitiesSurface;
|
|
766
|
+
/** Methods scoped to the `Config` wire surface. */
|
|
767
|
+
readonly config: ConfigSurface;
|
|
768
|
+
/** Methods scoped to the `Geo` wire surface. */
|
|
769
|
+
readonly geo: GeoSurface;
|
|
770
|
+
/** Methods scoped to the `Hardware` wire surface. */
|
|
771
|
+
readonly hardware: HardwareSurface;
|
|
772
|
+
/** Methods scoped to the `Library` wire surface. */
|
|
773
|
+
readonly library: LibrarySurface;
|
|
774
|
+
/** Methods scoped to the `Net` wire surface. */
|
|
775
|
+
readonly net: NetSurface;
|
|
776
|
+
/** Methods scoped to the `Notifications` wire surface. */
|
|
777
|
+
readonly notifications: NotificationsSurface;
|
|
778
|
+
/** Methods scoped to the `Peer` wire surface. */
|
|
779
|
+
readonly peer: PeerSurface;
|
|
780
|
+
/** Methods scoped to the `Phone` wire surface. */
|
|
781
|
+
readonly phone: PhoneSurface;
|
|
782
|
+
/** Methods scoped to the `Player` wire surface. */
|
|
783
|
+
readonly player: PlayerSurface;
|
|
784
|
+
/** Methods scoped to the `System` wire surface. */
|
|
785
|
+
readonly system: SystemSurface;
|
|
786
|
+
/** Methods scoped to the `Time` wire surface. */
|
|
787
|
+
readonly time: TimeSurface;
|
|
788
|
+
/** Methods scoped to the `Voice` wire surface. */
|
|
789
|
+
readonly voice: VoiceSurface;
|
|
790
|
+
/** Methods scoped to the `Webapp` wire surface. */
|
|
791
|
+
readonly webapp: WebappSurface;
|
|
792
|
+
/** Methods scoped to the `Forward` wire surface. */
|
|
793
|
+
readonly forward: ForwardSurface;
|
|
794
|
+
/** Methods scoped to the `Store` wire surface. */
|
|
795
|
+
readonly store: StoreSurface;
|
|
796
|
+
/** Exhaustive subscribe across every inbound wire surface. */
|
|
797
|
+
subscribe(handlers: ClientMessageHandlers): () => void;
|
|
798
|
+
subscribePartial(handlers: PartialClientMessageHandlers): () => void;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Apply codegen-emitted prototype augmentations to BridgethingClient.
|
|
802
|
+
* Called once from `index.ts` after the class definition. Idempotent.
|
|
803
|
+
*/
|
|
804
|
+
export declare function applyDispatch(): void;
|
|
805
|
+
//# sourceMappingURL=dispatch.generated.d.ts.map
|