livevoice-sdk-react-native 2.0.1 → 3.0.0
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/README.md +105 -66
- package/android/build.gradle +5 -4
- package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +122 -188
- package/android/src/main/java/io/livevoice/react/__SDK.kt +2 -2
- package/ios/LiveVoiceRNBridge.swift +362 -0
- package/ios/LiveVoiceSdkReactNative.mm +187 -158
- package/ios/__SDK.h +1 -1
- package/ios/livevoice_spm_backport.rb +202 -0
- package/lib/module/components/BrandingView.js +58 -39
- package/lib/module/components/BrandingView.js.map +1 -1
- package/lib/module/components/ChannelView.js +355 -44
- package/lib/module/components/ChannelView.js.map +1 -1
- package/lib/module/components/ErrorView.js +5 -6
- package/lib/module/components/ErrorView.js.map +1 -1
- package/lib/module/components/LiveVoiceSpinner.js +81 -0
- package/lib/module/components/LiveVoiceSpinner.js.map +1 -0
- package/lib/module/components/LiveVoiceView.js +311 -133
- package/lib/module/components/LiveVoiceView.js.map +1 -1
- package/lib/module/components/PasswordPrompt.js +165 -0
- package/lib/module/components/PasswordPrompt.js.map +1 -0
- package/lib/module/components/PlayButtonView.js +180 -244
- package/lib/module/components/PlayButtonView.js.map +1 -1
- package/lib/module/components/ReconnectingView.js +31 -53
- package/lib/module/components/ReconnectingView.js.map +1 -1
- package/lib/module/icons/branding-ios.png +0 -0
- package/lib/module/icons/camera-off-android.png +0 -0
- package/lib/module/icons/camera-off-android@2x.png +0 -0
- package/lib/module/icons/camera-off-android@3x.png +0 -0
- package/lib/module/icons/cpu-android.png +0 -0
- package/lib/module/icons/cpu-android@2x.png +0 -0
- package/lib/module/icons/cpu-android@3x.png +0 -0
- package/lib/module/icons/cpu-ios.png +0 -0
- package/lib/module/icons/cpu-ios@2x.png +0 -0
- package/lib/module/icons/cpu-ios@3x.png +0 -0
- package/lib/module/icons/lock-android.png +0 -0
- package/lib/module/icons/lock-android@2x.png +0 -0
- package/lib/module/icons/lock-android@3x.png +0 -0
- package/lib/module/icons/lock-ios.png +0 -0
- package/lib/module/icons/lock-ios@2x.png +0 -0
- package/lib/module/icons/lock-ios@3x.png +0 -0
- package/lib/module/icons/mic-off-android.png +0 -0
- package/lib/module/icons/mic-off-android@2x.png +0 -0
- package/lib/module/icons/mic-off-android@3x.png +0 -0
- package/lib/module/icons/mic-slash-ios.png +0 -0
- package/lib/module/icons/mic-slash-ios@2x.png +0 -0
- package/lib/module/icons/mic-slash-ios@3x.png +0 -0
- package/lib/module/icons/video-slash-ios.png +0 -0
- package/lib/module/icons/video-slash-ios@2x.png +0 -0
- package/lib/module/icons/video-slash-ios@3x.png +0 -0
- package/lib/module/index.js +11 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/sdk/Bridge.js +236 -0
- package/lib/module/sdk/Bridge.js.map +1 -0
- package/lib/module/sdk/Event.js +160 -0
- package/lib/module/sdk/Event.js.map +1 -0
- package/lib/module/sdk/Lifecycle.js +331 -0
- package/lib/module/sdk/Lifecycle.js.map +1 -0
- package/lib/module/sdk/LiveVoiceSdk.js +262 -268
- package/lib/module/sdk/LiveVoiceSdk.js.map +1 -1
- package/lib/module/sdk/LiveVoiceState.js +208 -40
- package/lib/module/sdk/LiveVoiceState.js.map +1 -1
- package/lib/module/sdk/LogEntries.js +99 -0
- package/lib/module/sdk/LogEntries.js.map +1 -0
- package/lib/module/sdk/Models.js +2 -0
- package/lib/module/{util/UIState.js.map → sdk/Models.js.map} +1 -1
- package/lib/module/{util/PlayingState.js → sdk/NativeSdkVersions.js} +9 -8
- package/lib/module/sdk/NativeSdkVersions.js.map +1 -0
- package/lib/module/sdk/Observables.js +391 -0
- package/lib/module/sdk/Observables.js.map +1 -0
- package/lib/module/sdk/Passwords.js +298 -0
- package/lib/module/sdk/Passwords.js.map +1 -0
- package/lib/module/sdk/Playback.js +35 -0
- package/lib/module/sdk/Playback.js.map +1 -0
- package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
- package/lib/module/util/Colors.js +2 -1
- package/lib/module/util/Colors.js.map +1 -1
- package/lib/module/util/Translations.js +34 -11
- package/lib/module/util/Translations.js.map +1 -1
- package/lib/module/util/freeze.js +26 -0
- package/lib/module/util/freeze.js.map +1 -0
- package/lib/module/util/logger.js +79 -41
- package/lib/module/util/logger.js.map +1 -1
- package/lib/typescript/src/components/BrandingView.d.ts +4 -0
- package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
- package/lib/typescript/src/components/ChannelView.d.ts +29 -3
- package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
- package/lib/typescript/src/components/ErrorView.d.ts +5 -3
- package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
- package/lib/typescript/src/components/LiveVoiceSpinner.d.ts +16 -0
- package/lib/typescript/src/components/LiveVoiceSpinner.d.ts.map +1 -0
- package/lib/typescript/src/components/LiveVoiceView.d.ts +81 -21
- package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
- package/lib/typescript/src/components/PasswordPrompt.d.ts +13 -0
- package/lib/typescript/src/components/PasswordPrompt.d.ts.map +1 -0
- package/lib/typescript/src/components/PlayButtonView.d.ts +12 -329
- package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
- package/lib/typescript/src/components/ReconnectingView.d.ts +6 -3
- package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +15 -6
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/sdk/Bridge.d.ts +36 -0
- package/lib/typescript/src/sdk/Bridge.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Event.d.ts +97 -0
- package/lib/typescript/src/sdk/Event.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Lifecycle.d.ts +191 -0
- package/lib/typescript/src/sdk/Lifecycle.d.ts.map +1 -0
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +195 -190
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -1
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts +77 -9
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -1
- package/lib/typescript/src/sdk/LogEntries.d.ts +28 -0
- package/lib/typescript/src/sdk/LogEntries.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Models.d.ts +114 -0
- package/lib/typescript/src/sdk/Models.d.ts.map +1 -0
- package/lib/typescript/src/sdk/NativeSdkVersions.d.ts +6 -0
- package/lib/typescript/src/sdk/NativeSdkVersions.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Observables.d.ts +123 -0
- package/lib/typescript/src/sdk/Observables.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Passwords.d.ts +72 -0
- package/lib/typescript/src/sdk/Passwords.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Playback.d.ts +9 -0
- package/lib/typescript/src/sdk/Playback.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +34 -31
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
- package/lib/typescript/src/util/Colors.d.ts.map +1 -1
- package/lib/typescript/src/util/Translations.d.ts +30 -8
- package/lib/typescript/src/util/Translations.d.ts.map +1 -1
- package/lib/typescript/src/util/freeze.d.ts +6 -0
- package/lib/typescript/src/util/freeze.d.ts.map +1 -0
- package/lib/typescript/src/util/logger.d.ts +17 -7
- package/lib/typescript/src/util/logger.d.ts.map +1 -1
- package/livevoice-sdk-react-native.podspec +29 -4
- package/package.json +12 -9
- package/src/components/BrandingView.tsx +42 -55
- package/src/components/ChannelView.tsx +329 -38
- package/src/components/ErrorView.tsx +9 -12
- package/src/components/LiveVoiceSpinner.tsx +87 -0
- package/src/components/LiveVoiceView.tsx +319 -201
- package/src/components/PasswordPrompt.tsx +144 -0
- package/src/components/PlayButtonView.tsx +165 -269
- package/src/components/ReconnectingView.tsx +28 -81
- package/src/icons/branding-ios.png +0 -0
- package/src/icons/camera-off-android.png +0 -0
- package/src/icons/camera-off-android@2x.png +0 -0
- package/src/icons/camera-off-android@3x.png +0 -0
- package/src/icons/cpu-android.png +0 -0
- package/src/icons/cpu-android@2x.png +0 -0
- package/src/icons/cpu-android@3x.png +0 -0
- package/src/icons/cpu-ios.png +0 -0
- package/src/icons/cpu-ios@2x.png +0 -0
- package/src/icons/cpu-ios@3x.png +0 -0
- package/src/icons/lock-android.png +0 -0
- package/src/icons/lock-android@2x.png +0 -0
- package/src/icons/lock-android@3x.png +0 -0
- package/src/icons/lock-ios.png +0 -0
- package/src/icons/lock-ios@2x.png +0 -0
- package/src/icons/lock-ios@3x.png +0 -0
- package/src/icons/mic-off-android.png +0 -0
- package/src/icons/mic-off-android@2x.png +0 -0
- package/src/icons/mic-off-android@3x.png +0 -0
- package/src/icons/mic-slash-ios.png +0 -0
- package/src/icons/mic-slash-ios@2x.png +0 -0
- package/src/icons/mic-slash-ios@3x.png +0 -0
- package/src/icons/video-slash-ios.png +0 -0
- package/src/icons/video-slash-ios@2x.png +0 -0
- package/src/icons/video-slash-ios@3x.png +0 -0
- package/src/index.tsx +92 -6
- package/src/sdk/Bridge.ts +259 -0
- package/src/sdk/Event.ts +187 -0
- package/src/sdk/Lifecycle.ts +366 -0
- package/src/sdk/LiveVoiceSdk.ts +285 -309
- package/src/sdk/LiveVoiceState.ts +230 -60
- package/src/sdk/LogEntries.ts +88 -0
- package/src/sdk/Models.ts +129 -0
- package/src/{util/PlayingState.ts → sdk/NativeSdkVersions.ts} +7 -6
- package/src/sdk/Observables.ts +414 -0
- package/src/sdk/Passwords.ts +286 -0
- package/src/sdk/Playback.ts +30 -0
- package/src/specs/NativeLiveVoiceSdk.ts +42 -38
- package/src/util/Colors.ts +2 -1
- package/src/util/Translations.ts +34 -12
- package/src/util/freeze.ts +23 -0
- package/src/util/logger.ts +79 -52
- package/lib/module/components/AudioOutputSwitchView.js +0 -138
- package/lib/module/components/AudioOutputSwitchView.js.map +0 -1
- package/lib/module/components/index.js +0 -24
- package/lib/module/components/index.js.map +0 -1
- package/lib/module/icons/mic.png +0 -0
- package/lib/module/util/ForegroundServiceConfig.js +0 -38
- package/lib/module/util/ForegroundServiceConfig.js.map +0 -1
- package/lib/module/util/PlayingState.js.map +0 -1
- package/lib/module/util/UIState.js +0 -4
- package/lib/typescript/src/components/AudioOutputSwitchView.d.ts +0 -6
- package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +0 -1
- package/lib/typescript/src/components/index.d.ts +0 -9
- package/lib/typescript/src/components/index.d.ts.map +0 -1
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +0 -19
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +0 -1
- package/lib/typescript/src/util/PlayingState.d.ts +0 -7
- package/lib/typescript/src/util/PlayingState.d.ts.map +0 -1
- package/lib/typescript/src/util/UIState.d.ts +0 -86
- package/lib/typescript/src/util/UIState.d.ts.map +0 -1
- package/src/components/AudioOutputSwitchView.tsx +0 -146
- package/src/components/index.tsx +0 -21
- package/src/icons/mic.png +0 -0
- package/src/util/ForegroundServiceConfig.tsx +0 -42
- package/src/util/UIState.ts +0 -106
|
@@ -1,210 +1,215 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
export type { Claims } from './LiveVoiceState';
|
|
1
|
+
import { type ImageSourcePropType } from 'react-native';
|
|
2
|
+
import { type LiveVoiceJoinRequest, type LiveVoiceJoinedEvent } from './Lifecycle';
|
|
3
|
+
import { type LiveVoiceAudioOutput } from './Models';
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Initialize the LiveVoice SDK.
|
|
5
|
+
* How LiveVoice shares audio with other apps while a channel plays:
|
|
6
|
+
* - `'exclusive'`: other audio pauses, as for a media app. The default.
|
|
7
|
+
* - `'duckOthers'`: other audio keeps playing, quieter.
|
|
8
|
+
* - `'hostManaged'`: on iOS, your app configures the audio session and output route; LiveVoice
|
|
9
|
+
* changes neither. On Android, LiveVoice requests no audio focus, so your app handles focus
|
|
10
|
+
* changes and stops playback when needed. Android output selection still applies.
|
|
15
11
|
*
|
|
16
|
-
*
|
|
12
|
+
* iOS interruptions pause LiveVoice in every mode. Android's automatic focus-loss handling
|
|
13
|
+
* applies only when LiveVoice owns audio focus.
|
|
17
14
|
*/
|
|
18
|
-
export
|
|
15
|
+
export type LiveVoiceAudioFocus = 'exclusive' | 'duckOthers' | 'hostManaged';
|
|
19
16
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @abstract By joining an event you can display the event's channels.
|
|
23
|
-
*
|
|
24
|
-
* @param {string} joinCode - The listener code of your event. You can find it on the event page of the admin web-interface by clicking on 'Share with your audience'.
|
|
25
|
-
* @param {string | null} password - The optional password to join the event. If a password has been set for listeners in your event, it can be found in the 'Access' tab of the event page of the admin web-interface.
|
|
26
|
-
* @param {string} apiKey - Your API key. You can find your API key in the account page when logged in on the website.
|
|
27
|
-
*/
|
|
28
|
-
export declare function joinEvent(joinCode: string, password: string | null, apiKey: string): void;
|
|
29
|
-
/**
|
|
30
|
-
* Leave the current event.
|
|
31
|
-
*
|
|
32
|
-
* @abstract You can explicitly leave an event to tear down any network connections the SDK uses when you no longer display any channels.
|
|
33
|
-
*/
|
|
34
|
-
export declare function leaveEvent(): void;
|
|
35
|
-
/**
|
|
36
|
-
* Reconnect when a connection error occurred.
|
|
37
|
-
*
|
|
38
|
-
* @abstract Call this method to try to reconnect when a connection error has occurred.
|
|
39
|
-
*/
|
|
40
|
-
export declare function reconnect(): void;
|
|
41
|
-
/**
|
|
42
|
-
* Get the claims for the current event.
|
|
43
|
-
*
|
|
44
|
-
* @deprecated Use {@link getCurrentFeatures} / {@link onFeaturesChanged} to read the authorization
|
|
45
|
-
* features, or build your UI with the `renderChannel` prop on `LiveVoiceView` (which applies the
|
|
46
|
-
* customization gating for you). Scheduled for removal in a future major version.
|
|
47
|
-
* @returns {Claims | null} The authorization claims, or `null` if not yet joined
|
|
48
|
-
*/
|
|
49
|
-
export declare function getCurrentClaims(): Claims | null;
|
|
50
|
-
/**
|
|
51
|
-
* Get the authorization features for the joined event.
|
|
52
|
-
*
|
|
53
|
-
* @abstract Reflects what the joined API key permits. Both flags are `false` until an event is
|
|
54
|
-
* joined and ready. You should only need this for an initial value; use {@link onFeaturesChanged}
|
|
55
|
-
* to observe changes.
|
|
56
|
-
* @returns {Features} The current features (`customUiAllowed` / `hideBranding`).
|
|
17
|
+
* Android only: whether a foreground service keeps playback alive while your app is in the
|
|
18
|
+
* background. Ignored on iOS.
|
|
57
19
|
*/
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
* @deprecated Build your UI with the `renderChannel` prop on `LiveVoiceView` instead of reading the
|
|
63
|
-
* raw UI state. Scheduled for removal in a future major version.
|
|
64
|
-
* @returns {UiState} The current view state
|
|
65
|
-
*/
|
|
66
|
-
export declare function getCurrentUiState(): UiState;
|
|
67
|
-
/**
|
|
68
|
-
* Get the current available subtitle configurations.
|
|
69
|
-
*
|
|
70
|
-
* @abstract Returns `null` until the SDK has joined an event and reached the `ready` state, so you
|
|
71
|
-
* can tell "not loaded yet" (`null`) apart from "loaded, but none available" (`[]`). You should
|
|
72
|
-
* only need this for an initial value; use {@link onAvailableSubtitleConfigsChanged} to observe
|
|
73
|
-
* changes.
|
|
74
|
-
* @returns {AvailableSubtitle[] | null} The available subtitles, or `null` if not yet loaded.
|
|
75
|
-
*/
|
|
76
|
-
export declare function getCurrentSubtitleConfiguration(): AvailableSubtitle[] | null;
|
|
77
|
-
/**
|
|
78
|
-
* Get the current subtitle fragments.
|
|
79
|
-
*
|
|
80
|
-
* @deprecated Use {@link getCurrentSubtitleState}, which returns the full subtitle state (type +
|
|
81
|
-
* channel + fragments). Scheduled for removal in a future major version.
|
|
82
|
-
* @returns {string[]} The current subtitle fragments
|
|
83
|
-
*/
|
|
84
|
-
export declare function getCurrentSubtitles(): string[];
|
|
85
|
-
/**
|
|
86
|
-
* Get the current subtitle state.
|
|
87
|
-
*
|
|
88
|
-
* @abstract Unlike {@link getCurrentSubtitles} (fragments only), this returns the full state: the
|
|
89
|
-
* {@link SubtitleState.type} (`disabled`/`automatic`/`specific`), the channel for `specific`, and
|
|
90
|
-
* the fragments. You should only need to call this for an initial value; use
|
|
91
|
-
* {@link onSubtitleStateChanged} to observe changes.
|
|
92
|
-
* @returns {SubtitleState} The current subtitle state
|
|
93
|
-
*/
|
|
94
|
-
export declare function getCurrentSubtitleState(): SubtitleState;
|
|
95
|
-
/**
|
|
96
|
-
* Get the current state of the audio output.
|
|
97
|
-
*
|
|
98
|
-
* @abstract You should only need to call this method to get an initial value. Use {@link onAudioOutputChanged}
|
|
99
|
-
` to be updated about the audio state.
|
|
100
|
-
* @returns {boolean} `true` for the speaker and `false` for the receiver.
|
|
101
|
-
*/
|
|
102
|
-
export declare function getCurrentAudioState(): boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Set the audio output.
|
|
105
|
-
* @param {boolean} value - Set to `true` to use the speaker, and `false` to use the receiver.
|
|
106
|
-
*/
|
|
107
|
-
export declare function setLiveVoiceUseSpeaker(value: boolean): void;
|
|
108
|
-
/**
|
|
109
|
-
* Start playing a channel.
|
|
110
|
-
* @abstract You can find the channel ID for a channel in the admin web-interface at the bottom when tapping *Edit Channel*.
|
|
111
|
-
* @deprecated Manual audio playback control should only be driven through `LiveVoiceView` channel
|
|
112
|
-
* cells. Use the `onAudioPress` helper passed to `renderChannel` instead. Scheduled for removal in
|
|
113
|
-
* a future major version.
|
|
114
|
-
* @param {number} [id] - The channel ID.
|
|
115
|
-
*/
|
|
116
|
-
export declare function startChannel(id: number): void;
|
|
117
|
-
/**
|
|
118
|
-
* Stop playing the currently playing channel.
|
|
119
|
-
*
|
|
120
|
-
* @deprecated Manual audio playback control should only be driven through `LiveVoiceView` channel
|
|
121
|
-
* cells. Use the `onAudioPress` helper passed to `renderChannel` instead. Scheduled for removal in
|
|
122
|
-
* a future major version.
|
|
123
|
-
*/
|
|
124
|
-
export declare function stopChannel(): void;
|
|
125
|
-
/**
|
|
126
|
-
* Start receiving subtitles.
|
|
127
|
-
* @abstract The SDK can receive a single stream of subtitle fragments at a time.
|
|
128
|
-
* You can stop receiving subtitles using {@link stopSubtitles()}.
|
|
129
|
-
* Whenever you call this method, any previous subtitle streams are stopped automatically and you receive the subtitles for the requested channel and language instead.
|
|
130
|
-
*
|
|
131
|
-
* Note: You have to make sure that subtitles for the given channel and language are enabled in the web-interface. You can use the {@link onAvailableSubtitleConfigsChanged} handler to check if subtitles are available for a given channel in a given language.
|
|
132
|
-
*
|
|
133
|
-
* @param {number | null} channelId - The channel to receive subtitles for. Set to `null` to always receive subtitles for the currently playing channel.
|
|
134
|
-
*/
|
|
135
|
-
export declare function startSubtitles(channelId: number | null): void;
|
|
136
|
-
/**
|
|
137
|
-
* Stop receiving subtitles.
|
|
138
|
-
*/
|
|
139
|
-
export declare function stopSubtitles(): void;
|
|
140
|
-
/**
|
|
141
|
-
* Handle changes of the audio output.
|
|
142
|
-
*
|
|
143
|
-
* @returns {object} - An object with a `remove` method to unsubscribe from the event.
|
|
144
|
-
*/
|
|
145
|
-
export declare function onAudioOutputChanged(handler: (useSpeaker: boolean) => void): {
|
|
146
|
-
remove: () => void;
|
|
20
|
+
export type LiveVoiceForegroundServiceConfig = {
|
|
21
|
+
kind: 'disabled';
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'enabled';
|
|
147
24
|
};
|
|
148
|
-
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
25
|
+
/** Options for {@link initialize}. Every option has a default. */
|
|
26
|
+
export type LiveVoiceInitializeOptions = {
|
|
27
|
+
/**
|
|
28
|
+
* Android only: the foreground service that keeps playback alive in the background,
|
|
29
|
+
* `{ kind: 'enabled' }` by default. Ignored on iOS.
|
|
30
|
+
*/
|
|
31
|
+
androidServiceConfig?: LiveVoiceForegroundServiceConfig;
|
|
32
|
+
/**
|
|
33
|
+
* iOS only: whether the playing channel appears on the Lock Screen and in Control Center,
|
|
34
|
+
* `true` by default. It applies only while the audio focus is `'exclusive'`. Set it to `false`
|
|
35
|
+
* if your app shows its own media controls. Ignored on Android, where the foreground service
|
|
36
|
+
* governs the media notification.
|
|
37
|
+
*/
|
|
38
|
+
showsSystemMediaControls?: boolean;
|
|
39
|
+
/** How LiveVoice shares audio with other apps, `'exclusive'` by default; see {@link LiveVoiceAudioFocus}. */
|
|
40
|
+
audioFocus?: LiveVoiceAudioFocus;
|
|
157
41
|
};
|
|
158
42
|
/**
|
|
159
|
-
*
|
|
43
|
+
* Initializes the LiveVoice SDK. Await it before joining an event; reading values and adding
|
|
44
|
+
* listeners works before it.
|
|
160
45
|
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* @returns {object} - An object with a `remove` method to unsubscribe from the event.
|
|
165
|
-
*/
|
|
166
|
-
export declare function onFeaturesChanged(handler: (features: Features) => void): {
|
|
167
|
-
remove: () => void;
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* Handle changes of the available subtitle configurations.
|
|
46
|
+
* Calling it again with the same options (after defaults) succeeds. Changed options apply while
|
|
47
|
+
* no event is joined (the connection is `idle` or `failed`) and reject with `invalid_argument`
|
|
48
|
+
* otherwise; an option a platform ignores never counts as a change there.
|
|
171
49
|
*
|
|
172
|
-
* @
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
* @returns { object } - An object with a`remove` method to unsubscribe from the event.
|
|
50
|
+
* @param options - See {@link LiveVoiceInitializeOptions}; every option has a default.
|
|
51
|
+
* @throws {LiveVoiceError} `invalid_argument` for an option of the wrong type or a change while
|
|
52
|
+
* joined, `unsupported_sdk` when the native SDK is not the version this package was built for.
|
|
176
53
|
*/
|
|
177
|
-
export declare function
|
|
178
|
-
remove: () => void;
|
|
179
|
-
};
|
|
54
|
+
export declare function initialize(options?: LiveVoiceInitializeOptions): Promise<void>;
|
|
180
55
|
/**
|
|
181
|
-
*
|
|
56
|
+
* Joins an event and resolves with the joined event once it is ready: authenticated, its initial
|
|
57
|
+
* state loaded, and commands accepted. A channel can be started right away; nothing plays yet and
|
|
58
|
+
* no subtitles are received.
|
|
182
59
|
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Handle changes of the subtitle state.
|
|
60
|
+
* When the promise resolves, the observed values (connection, current event, linked events,
|
|
61
|
+
* requestable languages, available subtitles) already show the joined event, or the result of a
|
|
62
|
+
* newer call. If an update of those values cannot be delivered, the call still resolves, after 5
|
|
63
|
+
* seconds, and the problem is logged; the same holds for `leaveEvent`, the joined event's
|
|
64
|
+
* `leave()`, `reconnect` and `switchToLinkedEvent`. The features and the subtitle state are not
|
|
65
|
+
* among these values: right after the promise resolves they can still show the previous value, so
|
|
66
|
+
* observe them.
|
|
192
67
|
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
68
|
+
* Every call is a fresh join, also to the same code: it replaces whatever is joined or joining,
|
|
69
|
+
* and it never retries by itself.
|
|
70
|
+
*
|
|
71
|
+
* @param request - The join code, the API key and an optional password.
|
|
72
|
+
* @returns The joined event; its `leave()` leaves only this join.
|
|
73
|
+
* @throws {LiveVoiceError} `invalid_argument` for an empty API key, a malformed join code or a
|
|
74
|
+
* speaker's code; `superseded` when a newer join replaced it; `cancelled` when a leave ended it;
|
|
75
|
+
* `timed_out` when the event was not ready within 30 seconds, which leaves the connection
|
|
76
|
+
* `failed` (waiting for an earlier event's cleanup counts, entering a password does not);
|
|
77
|
+
* `not_initialized` before `initialize()`; otherwise why the join failed, see the joining codes
|
|
78
|
+
* of {@link LiveVoiceErrorCode}.
|
|
79
|
+
*/
|
|
80
|
+
export declare function joinEvent(request: LiveVoiceJoinRequest): Promise<LiveVoiceJoinedEvent>;
|
|
81
|
+
/**
|
|
82
|
+
* Leaves whatever event is joined or joining. Call it as often as you like once `initialize()`
|
|
83
|
+
* has resolved.
|
|
84
|
+
*
|
|
85
|
+
* Resolves when the event's local cleanup has ended, or at once when nothing is joined and no
|
|
86
|
+
* cleanup is still running. The observed values then already show the result: the connection is
|
|
87
|
+
* `idle` unless a newer join exists, and the current event and its lists are `null`. A pending
|
|
88
|
+
* `joinEvent`, `switchToLinkedEvent` or `reconnect` rejects with `cancelled`. To leave only one
|
|
89
|
+
* join, use the `leave()` of the joined event `joinEvent` returned.
|
|
90
|
+
*
|
|
91
|
+
* @throws {LiveVoiceError} `leave_incomplete` when the cleanup has not finished within 5 seconds:
|
|
92
|
+
* the event is left all the same, the connection is `idle` and the cleanup continues. Another
|
|
93
|
+
* leave then waits for the same cleanup and can fail with `leave_incomplete` again.
|
|
94
|
+
* `not_initialized` before `initialize()`.
|
|
95
|
+
*/
|
|
96
|
+
export declare function leaveEvent(): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Reconnects the joined event with a fresh connection and resolves once that connection is ready.
|
|
99
|
+
*
|
|
100
|
+
* It keeps the join. Allowed while the connection is `ready` or `reconnecting`, where it forces
|
|
101
|
+
* an attempt now, and after a failure with a retryable error, where it joins again with the same
|
|
102
|
+
* code and key and the connection shows `joining`. Playback and the subtitle choice are restored
|
|
103
|
+
* unless a stop or a leave came in between; ready does not promise that playback has resumed.
|
|
104
|
+
*
|
|
105
|
+
* When the promise resolves, the observed values already show the result, or that of a newer
|
|
106
|
+
* call. The connection can already show `reconnecting` again if it dropped meanwhile.
|
|
107
|
+
*
|
|
108
|
+
* @throws {LiveVoiceError} `not_joined` without a join and while the first join or a switch is
|
|
109
|
+
* still pending, which is not disturbed; `superseded` when a newer reconnect, join or switch
|
|
110
|
+
* replaced it; `cancelled` when a leave ended it; `timed_out` after 30 seconds. For an
|
|
111
|
+
* established connection only this call fails then: the event stays joined, the connection keeps
|
|
112
|
+
* showing `reconnecting` and recovery continues by itself. The retry of a failed join that times
|
|
113
|
+
* out leaves the connection `failed`. After a failure that is not retryable, that same error
|
|
114
|
+
* again. See {@link LiveVoiceErrorCode}.
|
|
115
|
+
*/
|
|
116
|
+
export declare function reconnect(): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Sets where LiveVoice plays its audio: a preference the SDK keeps and applies whenever it plays.
|
|
119
|
+
* It works at any time, also before {@link initialize} and before joining an event, and never
|
|
120
|
+
* rejects. {@link getCurrentAudioOutput} reports it.
|
|
121
|
+
*
|
|
122
|
+
* @param output - `'system'` for the route the system chooses, `'speaker'` for the loudspeaker.
|
|
123
|
+
*/
|
|
124
|
+
export declare function setAudioOutput(output: LiveVoiceAudioOutput): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Sets the image the system's media controls show for the playing channel: the Lock Screen and
|
|
127
|
+
* Control Center on iOS, the media notification and the quick-settings player on Android. It is
|
|
128
|
+
* drawn fitted, with a margin, centred on a white square. Without one, the joined event's logo
|
|
129
|
+
* shows, if it has one.
|
|
130
|
+
*
|
|
131
|
+
* It works at any time, and a change shows at once. Before `initialize()` the image is kept and
|
|
132
|
+
* applied once `initialize()` succeeds; a failure to load it is then only logged.
|
|
133
|
+
*
|
|
134
|
+
* ```tsx
|
|
135
|
+
* await setNowPlayingArtwork(require('./assets/artwork.png'));
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* @param image - A bundled image (`require(…)`) or a `{ uri }` source with a `file://` or
|
|
139
|
+
* `http(s)://` URL (on Android also `content://` or `android.resource://`), PNG or JPEG. `null`
|
|
140
|
+
* removes it, so the event's logo shows again.
|
|
141
|
+
* @throws {LiveVoiceError} `invalid_argument` for a source without a URI, or for an image that
|
|
142
|
+
* cannot be loaded or decoded; the previous image then stays.
|
|
143
|
+
*/
|
|
144
|
+
export declare function setNowPlayingArtwork(image: ImageSourcePropType | null): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Stops the playing channel and resolves once local playback has stopped.
|
|
147
|
+
*
|
|
148
|
+
* Allowed whenever an event is joined, joining, reconnecting or failed; while joining or failed
|
|
149
|
+
* it resolves once an earlier event's audio is released. A pending start rejects with
|
|
150
|
+
* `cancelled`, and a later reconnect restores nothing. The channel's `playingState` shows
|
|
151
|
+
* `stopped` shortly after the promise resolves.
|
|
152
|
+
*
|
|
153
|
+
* @throws {LiveVoiceError} `not_joined` when no event is joined; `timed_out` when playback has
|
|
154
|
+
* not stopped within 10 seconds while connected; `leave_incomplete` when, while joining or
|
|
155
|
+
* failed, that audio is not released within 5 seconds (in both cases the stop itself continues);
|
|
156
|
+
* `generic` with `detail.reason` `stop_failed`. It can also fail with `cancelled`. See
|
|
157
|
+
* {@link LiveVoiceErrorCode}.
|
|
158
|
+
*/
|
|
159
|
+
export declare function stopChannel(): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Starts receiving subtitles. The SDK receives one subtitle stream at a time: a new start
|
|
162
|
+
* replaces the previous selection. It never starts or stops playback.
|
|
163
|
+
* {@link getCurrentAvailableSubtitles} lists what can be started; the subtitles of an offline
|
|
164
|
+
* channel can be started too.
|
|
165
|
+
*
|
|
166
|
+
* For a given channel the promise resolves once the server accepted the subscription. Without a
|
|
167
|
+
* channel the subtitles follow the playing channel. That mode is on from the call and stays on
|
|
168
|
+
* when a channel's subtitles are refused, also when this call rejects for the channel playing
|
|
169
|
+
* now. While nothing plays the promise resolves at once; otherwise once the server accepted the
|
|
170
|
+
* playing channel's subscription. {@link getCurrentSubtitles} shows the selection shortly after
|
|
171
|
+
* the promise resolves.
|
|
172
|
+
*
|
|
173
|
+
* @param options - `channelId`: the channel to receive subtitles for; leave it out or pass `null`
|
|
174
|
+
* to follow the playing channel. `password`: the channel's password, if it is protected; a
|
|
175
|
+
* password you pass is final. Without one, a given channel's password comes from the SDK's
|
|
176
|
+
* memory, the password store, then the password provider or the built-in prompt. Subtitles that
|
|
177
|
+
* follow the playing channel never ask for a password: they use the one you pass, for the channel
|
|
178
|
+
* playing now, or one the SDK remembers, such as the one playback was started with.
|
|
179
|
+
* @throws {LiveVoiceError} `invalid_argument` for a channel id that is not a positive integer;
|
|
180
|
+
* `not_joined` unless the connection is `ready`; `command_in_progress` when the same start is
|
|
181
|
+
* still pending; `cancelled` when a different start, `stopSubtitles`, a leave or a new join ended
|
|
182
|
+
* it; `timed_out` when the server does not accept within 10 seconds (entering a password does not
|
|
183
|
+
* count); `leave_incomplete` when an unfinished subtitle stop holds it up for more than 5
|
|
184
|
+
* seconds; a channel error such as `channel_wrong_password`. A connection loss during the call
|
|
185
|
+
* can fail it with `cancelled` or `network_failed`; observe the connection to follow recovery,
|
|
186
|
+
* the rejection and the connection update need not arrive in a particular order. See
|
|
187
|
+
* {@link LiveVoiceErrorCode}.
|
|
188
|
+
*/
|
|
189
|
+
export declare function startSubtitles(options?: {
|
|
190
|
+
channelId?: number | null;
|
|
191
|
+
password?: string | null;
|
|
192
|
+
}): Promise<void>;
|
|
200
193
|
/**
|
|
201
|
-
*
|
|
194
|
+
* Stops receiving subtitles and resolves once their local delivery has ended.
|
|
195
|
+
*
|
|
196
|
+
* It does not wait for the server and has no time limit. Allowed whenever an event is joined,
|
|
197
|
+
* joining, reconnecting or failed. A subtitle start that is still pending rejects with
|
|
198
|
+
* `cancelled`; playback is not affected. {@link getCurrentSubtitles} shows `disabled` shortly
|
|
199
|
+
* after the promise resolves at the latest.
|
|
200
|
+
*
|
|
201
|
+
* @throws {LiveVoiceError} `not_joined` when no event is joined. It can also fail with
|
|
202
|
+
* `cancelled`. See {@link LiveVoiceErrorCode}.
|
|
203
|
+
*/
|
|
204
|
+
export declare function stopSubtitles(): Promise<void>;
|
|
205
|
+
/**
|
|
206
|
+
* Opens the LiveVoice website in the device's default browser.
|
|
202
207
|
*/
|
|
203
208
|
export declare function openLiveVoiceWebsite(): void;
|
|
209
|
+
/** Returns the version of this React Native package, for example `"3.0.0"`. */
|
|
210
|
+
export declare function getSdkVersion(): string;
|
|
204
211
|
/**
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
* @returns {string} The SDK version, e.g. `"2.0.1"`.
|
|
212
|
+
* Returns the version of the native LiveVoice SDK this package uses, for example `"3.0.0"`.
|
|
208
213
|
*/
|
|
209
|
-
export declare function
|
|
214
|
+
export declare function getNativeSdkVersion(): string;
|
|
210
215
|
//# sourceMappingURL=LiveVoiceSdk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveVoiceSdk.d.ts","sourceRoot":"","sources":["../../../../src/sdk/LiveVoiceSdk.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LiveVoiceSdk.d.ts","sourceRoot":"","sources":["../../../../src/sdk/LiveVoiceSdk.ts"],"names":[],"mappings":"AAaA,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAIzE,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKrD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,YAAY,GAAG,aAAa,CAAC;AAE7E;;;GAGG;AACH,MAAM,MAAM,gCAAgC,GACxC;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAExB,kEAAkE;AAClE,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,gCAAgC,CAAC;IACxD;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,6GAA6G;IAC7G,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAIF;;;;;;;;;;;GAWG;AACH,wBAAsB,UAAU,CAAC,OAAO,GAAE,0BAA+B,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBxF;AAiCD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAEtF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAKhD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAK/C;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhF;AAKD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAU3F;AAsBD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAGjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,cAAc,CAClC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GACpE,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAGnD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAG3C;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
|
|
@@ -1,12 +1,80 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
1
|
+
import { LiveVoiceError, type RetryValue } from './Lifecycle';
|
|
2
|
+
import { type LiveVoiceChannel, type LiveVoiceFeatures } from './Models';
|
|
3
|
+
/** The event's brand colours, `'#RRGGBB'`. */
|
|
4
|
+
export type BrandColors = {
|
|
5
|
+
light: string;
|
|
6
|
+
dark: string;
|
|
7
|
+
};
|
|
8
|
+
/** What a double tap or a named action on a default cell does (bridge.md 2.4). */
|
|
9
|
+
export type CellActionKind = 'toggleAudio' | 'toggleSubtitles';
|
|
10
|
+
/**
|
|
11
|
+
* A default cell's accessibility, computed natively by the native default cell's own code and in
|
|
12
|
+
* the native SDK's language (bridge.md 2.4). The cell renders exactly this.
|
|
13
|
+
*/
|
|
14
|
+
export type CellAccessibility = {
|
|
15
|
+
/** The channel name. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** The row's states as the native cell joins them; `''` when there are none. */
|
|
18
|
+
value: string;
|
|
19
|
+
isButton: boolean;
|
|
20
|
+
isSelected: boolean;
|
|
21
|
+
/** What a double tap does, or `null` where it does nothing. */
|
|
22
|
+
activation: CellActionKind | null;
|
|
23
|
+
/** The named actions in the native order, each with its localised name. */
|
|
24
|
+
actions: {
|
|
25
|
+
kind: CellActionKind;
|
|
26
|
+
name: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
/** A default cell's status line under the name, as native computed it (bridge.md 2.4). */
|
|
30
|
+
export type CellStatus = {
|
|
31
|
+
/** The localised line, for example "Inactive" or "AI active". */
|
|
32
|
+
text: string;
|
|
33
|
+
/** The CPU icon precedes the text: an online AI speaker. */
|
|
34
|
+
showsAiIcon: boolean;
|
|
35
|
+
};
|
|
36
|
+
/** A default cell's mute mark, as native computed it (bridge.md 2.4). */
|
|
37
|
+
export type CellMuteMark = 'microphone' | 'camera';
|
|
38
|
+
/** The part the default view shows. */
|
|
39
|
+
export type ViewPart = {
|
|
40
|
+
kind: 'loading';
|
|
41
|
+
} | {
|
|
42
|
+
kind: 'ready';
|
|
43
|
+
channels: LiveVoiceChannel[];
|
|
44
|
+
/** Each channel's `LiveVoiceChannelCell.isEnabled`, by id. */
|
|
45
|
+
isEnabled: ReadonlyMap<number, boolean>;
|
|
46
|
+
/** Whether each channel's subtitles are the open ones, by id: the default cell's marker. */
|
|
47
|
+
subtitlesOpen: ReadonlyMap<number, boolean>;
|
|
48
|
+
/** Each default cell's accessibility, by id; `null` for one native did not send. */
|
|
49
|
+
accessibility: ReadonlyMap<number, CellAccessibility | null>;
|
|
50
|
+
/** Each default cell's status line, by id; `null` for none. */
|
|
51
|
+
status: ReadonlyMap<number, CellStatus | null>;
|
|
52
|
+
/** Each default cell's mute mark, by id; `null` for none. */
|
|
53
|
+
muteMark: ReadonlyMap<number, CellMuteMark | null>;
|
|
54
|
+
/** The list stays, drawn disabled, while the connection briefly recovers. */
|
|
55
|
+
inReconnectGrace: boolean;
|
|
56
|
+
brandColors: BrandColors | null;
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'reconnecting';
|
|
59
|
+
retry: RetryValue;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'error';
|
|
62
|
+
error: LiveVoiceError;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The default view's model: the part to show, and the permission of the join it belongs to,
|
|
66
|
+
* `null` until that join has authenticated. The gate and the branding read this permission, so
|
|
67
|
+
* channels and permission always come from the same join.
|
|
68
|
+
*/
|
|
69
|
+
export type ViewModel = {
|
|
70
|
+
part: ViewPart;
|
|
71
|
+
features: LiveVoiceFeatures | null;
|
|
72
|
+
};
|
|
73
|
+
export declare function getCurrentViewModel(): ViewModel;
|
|
74
|
+
/** Calls `handler` whenever the default view changes. */
|
|
75
|
+
export declare function onViewModelChanged(handler: (model: ViewModel) => void): {
|
|
10
76
|
remove: () => void;
|
|
11
77
|
};
|
|
78
|
+
/** A wire channel (bridge.md 2.2) as the public `LiveVoiceChannel`. */
|
|
79
|
+
export declare function decodeChannel(wire: Record<string, unknown>): LiveVoiceChannel;
|
|
12
80
|
//# sourceMappingURL=LiveVoiceState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveVoiceState.d.ts","sourceRoot":"","sources":["../../../../src/sdk/LiveVoiceState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LiveVoiceState.d.ts","sourceRoot":"","sources":["../../../../src/sdk/LiveVoiceState.ts"],"names":[],"mappings":"AAiBA,OAAO,EAA4B,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,iBAAiB,EAEvB,MAAM,UAAU,CAAC;AAGlB,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,kFAAkF;AAClF,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,UAAU,EAAE,cAAc,GAAG,IAAI,CAAC;IAClC,2EAA2E;IAC3E,OAAO,EAAE;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnD,CAAC;AAEF,0FAA0F;AAC1F,MAAM,MAAM,UAAU,GAAG;IACvB,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,yEAAyE;AACzE,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,QAAQ,CAAC;AAEnD,uCAAuC;AACvC,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IACE,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,8DAA8D;IAC9D,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,4FAA4F;IAC5F,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,oFAAoF;IACpF,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC7D,+DAA+D;IAC/D,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC,CAAC;IAC/C,6DAA6D;IAC7D,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC,CAAC;IACnD,6EAA6E;IAC7E,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;CACjC,GACD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAE,CAAC;AAmB/E,wBAAgB,mBAAmB,IAAI,SAAS,CAE/C;AAED,yDAAyD;AACzD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAO9F;AA8FD,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CA+B7E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type LiveVoiceSubscription } from './Models';
|
|
2
|
+
/** `error` for a failed result and a failed connection, `info` for everything else. */
|
|
3
|
+
export type LiveVoiceLogLevel = 'info' | 'error';
|
|
4
|
+
/** One diagnostic event of the LiveVoice SDK. */
|
|
5
|
+
export type LiveVoiceLogEntry = {
|
|
6
|
+
/** The event's name, `LV_…`. */
|
|
7
|
+
event: string;
|
|
8
|
+
level: LiveVoiceLogLevel;
|
|
9
|
+
/** The event's details. A field without a value is left out. */
|
|
10
|
+
fields: Record<string, string>;
|
|
11
|
+
/** When it happened. */
|
|
12
|
+
timestamp: Date;
|
|
13
|
+
};
|
|
14
|
+
/** Receives one log entry; see {@link addLogListener}. */
|
|
15
|
+
export type LiveVoiceLogListener = (entry: LiveVoiceLogEntry) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Receives the SDK's diagnostic events, the ones it also writes to the system log. Entries are
|
|
18
|
+
* not replayed: a listener gets what is logged after it was added, in order. It can be added
|
|
19
|
+
* before `initialize()` and stays until it is removed.
|
|
20
|
+
*
|
|
21
|
+
* Entries never hold the API key or a password. Return quickly and do not call the SDK from the
|
|
22
|
+
* listener; an error it throws is caught.
|
|
23
|
+
*
|
|
24
|
+
* @param listener - Called with each entry.
|
|
25
|
+
* @returns A subscription; its `remove()` stops the entries.
|
|
26
|
+
*/
|
|
27
|
+
export declare function addLogListener(listener: LiveVoiceLogListener): LiveVoiceSubscription;
|
|
28
|
+
//# sourceMappingURL=LogEntries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogEntries.d.ts","sourceRoot":"","sources":["../../../../src/sdk/LogEntries.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD,uFAAuF;AACvF,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,iDAAiD;AACjD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,iBAAiB,CAAC;IACzB,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,wBAAwB;IACxB,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,0DAA0D;AAC1D,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAuBtE;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,oBAAoB,GAAG,qBAAqB,CAqBpF"}
|