effect-cloudflare-webrtc 0.0.0-stage → 0.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 +439 -2
- package/dist/AudioSink-BybkMP2y.d.ts +54 -0
- package/dist/Readable-CJPSx6Uq.js +65 -0
- package/dist/Readable-CJPSx6Uq.js.map +1 -0
- package/dist/Realtime-B5OIHlLR.d.ts +129 -0
- package/dist/Realtime-B6TjV8su.js +195 -0
- package/dist/Realtime-B6TjV8su.js.map +1 -0
- package/dist/RealtimeClient-Bl0Tun5r.js +2488 -0
- package/dist/RealtimeClient-Bl0Tun5r.js.map +1 -0
- package/dist/RealtimeClient-ESFO5vfF.d.ts +412 -0
- package/dist/RealtimeClient-K7oKgsB9.d.ts +1000 -0
- package/dist/chunk-pbuEa-1d.js +13 -0
- package/dist/client/index.d.ts +275 -0
- package/dist/client/index.js +493 -0
- package/dist/client/index.js.map +1 -0
- package/dist/effect/client/index.d.ts +434 -0
- package/dist/effect/client/index.js +2 -0
- package/dist/effect/server/index.d.ts +2 -0
- package/dist/effect/server/index.js +2 -0
- package/dist/react/index.d.ts +44 -0
- package/dist/react/index.js +107 -0
- package/dist/react/index.js.map +1 -0
- package/dist/server/index.d.ts +23 -0
- package/dist/server/index.js +12 -0
- package/dist/server/index.js.map +1 -0
- package/package.json +92 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll as t };
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import {
|
|
2
|
+
C as RemoteReceptionStats,
|
|
3
|
+
D as TransportStats,
|
|
4
|
+
S as ReceivedTrackStats,
|
|
5
|
+
T as SentTrackStats,
|
|
6
|
+
b as ConnectionStats,
|
|
7
|
+
w as SentStreamStats,
|
|
8
|
+
x as QualityLimitationReason
|
|
9
|
+
} from "../RealtimeClient-K7oKgsB9.js";
|
|
10
|
+
import { n as AudioSinkElement } from "../AudioSink-BybkMP2y.js";
|
|
11
|
+
import {
|
|
12
|
+
A as TransceiverEvent,
|
|
13
|
+
C as SenderError,
|
|
14
|
+
D as SourceError,
|
|
15
|
+
E as SinkError,
|
|
16
|
+
F as Writable,
|
|
17
|
+
I as writable,
|
|
18
|
+
M as TransformFailed,
|
|
19
|
+
N as InteropObservable,
|
|
20
|
+
O as TrackError,
|
|
21
|
+
P as Readable,
|
|
22
|
+
S as PushState,
|
|
23
|
+
T as SessionState,
|
|
24
|
+
_ as NegotiationOutcomeUnknown,
|
|
25
|
+
a as createRealtimeClient,
|
|
26
|
+
b as PullState,
|
|
27
|
+
c as setLogLevel,
|
|
28
|
+
d as ApiHistoryEntry,
|
|
29
|
+
f as ApiInvalidResponse,
|
|
30
|
+
g as MediaAccessError,
|
|
31
|
+
h as DevicesExhausted,
|
|
32
|
+
i as RealtimeClientOptions,
|
|
33
|
+
j as TransceiverNotFound,
|
|
34
|
+
k as TrackMetadata,
|
|
35
|
+
l as ApiAuthRedirect,
|
|
36
|
+
m as ApiTransportError,
|
|
37
|
+
n as PushedTrack,
|
|
38
|
+
o as LogEntry,
|
|
39
|
+
p as ApiResponseError,
|
|
40
|
+
r as RealtimeClient,
|
|
41
|
+
s as LogLevel,
|
|
42
|
+
t as PulledTrack,
|
|
43
|
+
u as ApiError,
|
|
44
|
+
v as PeerConnectionFailed,
|
|
45
|
+
w as SessionError,
|
|
46
|
+
x as PushError,
|
|
47
|
+
y as PullError
|
|
48
|
+
} from "../RealtimeClient-ESFO5vfF.js";
|
|
49
|
+
//#region src/client/sources.d.ts
|
|
50
|
+
/**
|
|
51
|
+
* Makes a new track from the content track, for example a background blur.
|
|
52
|
+
* `signal` aborts when the new track must be released: stop the work and
|
|
53
|
+
* free the resources.
|
|
54
|
+
*/
|
|
55
|
+
type TrackTransform = (
|
|
56
|
+
track: MediaStreamTrack,
|
|
57
|
+
context: {
|
|
58
|
+
signal: AbortSignal;
|
|
59
|
+
}
|
|
60
|
+
) => MediaStreamTrack | Promise<MediaStreamTrack>;
|
|
61
|
+
interface TrackSource {
|
|
62
|
+
/**
|
|
63
|
+
* The track to push. It is the content track while the source is enabled
|
|
64
|
+
* and the broadcast is started, and the fallback track in all other
|
|
65
|
+
* conditions. It is active only while it has a subscriber. With no
|
|
66
|
+
* subscriber, the value is `undefined`.
|
|
67
|
+
*/
|
|
68
|
+
readonly broadcastTrack: Readable<MediaStreamTrack | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* The content track while the source is enabled, also when the broadcast
|
|
71
|
+
* is stopped. It is active only while it has a subscriber.
|
|
72
|
+
*/
|
|
73
|
+
readonly localMonitorTrack: Readable<MediaStreamTrack | undefined>;
|
|
74
|
+
/** When false, the content source is not acquired. */
|
|
75
|
+
readonly isEnabled: Readable<boolean>;
|
|
76
|
+
/** True while the content track is in the broadcast track. */
|
|
77
|
+
readonly isBroadcasting: Readable<boolean>;
|
|
78
|
+
enable(): void;
|
|
79
|
+
/** Also stops the broadcast. */
|
|
80
|
+
disable(): void;
|
|
81
|
+
toggleEnabled(): void;
|
|
82
|
+
startBroadcasting(): void;
|
|
83
|
+
stopBroadcasting(): void;
|
|
84
|
+
toggleBroadcasting(): void;
|
|
85
|
+
/** Each error of the content source. An error also disables the source. */
|
|
86
|
+
onError(listener: (error: SourceError) => void): () => void;
|
|
87
|
+
/** Returns a function that removes the transformation. */
|
|
88
|
+
addTransform(transform: TrackTransform): () => void;
|
|
89
|
+
}
|
|
90
|
+
interface DeviceSourceOptions {
|
|
91
|
+
/** Send the captured track when acquired. Construction stays idle. Default: false. */
|
|
92
|
+
broadcasting?: boolean;
|
|
93
|
+
constraints?: Omit<MediaTrackConstraints, "deviceId" | "groupId">;
|
|
94
|
+
transforms?: TrackTransform[];
|
|
95
|
+
}
|
|
96
|
+
interface DeviceSource extends Omit<
|
|
97
|
+
TrackSource,
|
|
98
|
+
| "enable"
|
|
99
|
+
| "disable"
|
|
100
|
+
| "toggleEnabled"
|
|
101
|
+
| "isEnabled"
|
|
102
|
+
| "startBroadcasting"
|
|
103
|
+
| "toggleBroadcasting"
|
|
104
|
+
> {
|
|
105
|
+
/** Acquire this device if necessary and send its track. */
|
|
106
|
+
startBroadcasting(): Promise<void>;
|
|
107
|
+
/** Turning on acquires if needed. Muting keeps the device acquired. */
|
|
108
|
+
toggleBroadcasting(): Promise<void>;
|
|
109
|
+
/** Request the device and wait for the first usable track. */
|
|
110
|
+
acquire(): Promise<void>;
|
|
111
|
+
/** Release capture, preserving the broadcast preference. */
|
|
112
|
+
release(): Promise<void>;
|
|
113
|
+
readonly isAcquiring: Readable<boolean>;
|
|
114
|
+
readonly isAcquired: Readable<boolean>;
|
|
115
|
+
readonly permissionState: Readable<PermissionState | "unknown">;
|
|
116
|
+
/** The devices of this kind. Use it for a device selector. */
|
|
117
|
+
readonly availableDevices: Readable<ReadonlyArray<MediaDeviceInfo>>;
|
|
118
|
+
/**
|
|
119
|
+
* Show this device in a device selector. It is the device identified by
|
|
120
|
+
* the captured track, or the first candidate if there is no match.
|
|
121
|
+
* It can differ from the saved preference and remains available while
|
|
122
|
+
* idle. An empty device list gives `undefined`.
|
|
123
|
+
*/
|
|
124
|
+
readonly activeDevice: Readable<MediaDeviceInfo | undefined>;
|
|
125
|
+
/** The preference is kept in `localStorage`. */
|
|
126
|
+
setPreferredDevice(device: MediaDeviceInfo): void;
|
|
127
|
+
/** Each device that gave a track that is not healthy. */
|
|
128
|
+
onDeviceFailure(listener: (device: MediaDeviceInfo) => void): () => void;
|
|
129
|
+
/** Releases the hardware and all internal resources. */
|
|
130
|
+
dispose(): Promise<void>;
|
|
131
|
+
}
|
|
132
|
+
interface ScreenShareTrackOptions {
|
|
133
|
+
constraints?: MediaTrackConstraints;
|
|
134
|
+
/** The broadcast is started at the start. Default: false. */
|
|
135
|
+
broadcasting?: boolean;
|
|
136
|
+
}
|
|
137
|
+
interface ScreenShareSourceOptions {
|
|
138
|
+
/** The source is enabled at the start. Default: false. */
|
|
139
|
+
enabled?: boolean;
|
|
140
|
+
/** Keeps the screen share acquired while the broadcast is stopped. */
|
|
141
|
+
keepSourceAlive?: boolean;
|
|
142
|
+
/** `false` asks for no audio. Default: true. */
|
|
143
|
+
audio?: boolean | ScreenShareTrackOptions;
|
|
144
|
+
video?: boolean | ScreenShareTrackOptions;
|
|
145
|
+
}
|
|
146
|
+
type ScreenShareTrack = Omit<
|
|
147
|
+
TrackSource,
|
|
148
|
+
"isEnabled" | "enable" | "disable" | "toggleEnabled"
|
|
149
|
+
>;
|
|
150
|
+
interface ScreenShareSource {
|
|
151
|
+
readonly audio: ScreenShareTrack;
|
|
152
|
+
readonly video: ScreenShareTrack;
|
|
153
|
+
readonly isEnabled: Readable<boolean>;
|
|
154
|
+
/** True when the audio or the video broadcasts. */
|
|
155
|
+
readonly isBroadcasting: Readable<boolean>;
|
|
156
|
+
enable(): void;
|
|
157
|
+
disable(): void;
|
|
158
|
+
toggleEnabled(): void;
|
|
159
|
+
/** Starts the two tracks. The browser prompt shows. */
|
|
160
|
+
startBroadcasting(): void;
|
|
161
|
+
stopBroadcasting(): void;
|
|
162
|
+
toggleBroadcasting(): void;
|
|
163
|
+
dispose(): Promise<void>;
|
|
164
|
+
}
|
|
165
|
+
interface AudioSinkOptions {
|
|
166
|
+
/** An `<audio>` element. */
|
|
167
|
+
audioElement: AudioSinkElement;
|
|
168
|
+
/** The audio output device at the start. */
|
|
169
|
+
sinkId?: string;
|
|
170
|
+
}
|
|
171
|
+
interface AudioSink {
|
|
172
|
+
/**
|
|
173
|
+
* Plays the track of the `Readable`. A new track replaces the track
|
|
174
|
+
* before it. Returns a function that removes the track.
|
|
175
|
+
*/
|
|
176
|
+
attach(track: Readable<MediaStreamTrack | undefined>): () => void;
|
|
177
|
+
/** False in a browser that cannot select the audio output device. */
|
|
178
|
+
readonly isSinkIdSupported: boolean;
|
|
179
|
+
/** Rejects with a `SinkError`. */
|
|
180
|
+
setSinkId(sinkId: string): Promise<void>;
|
|
181
|
+
/** The audio output devices. */
|
|
182
|
+
readonly availableDevices: Readable<ReadonlyArray<MediaDeviceInfo>>;
|
|
183
|
+
/** False when the browser blocked the element. */
|
|
184
|
+
readonly isPlaying: Readable<boolean>;
|
|
185
|
+
/** Removes all tracks from the element and stops the attachments. */
|
|
186
|
+
dispose(): Promise<void>;
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/client/index.d.ts
|
|
190
|
+
/** The microphone: device selection, resilient acquisition, mute. */
|
|
191
|
+
declare const createMicrophoneSource: (
|
|
192
|
+
options?: DeviceSourceOptions
|
|
193
|
+
) => DeviceSource;
|
|
194
|
+
/** The camera: device selection, resilient acquisition, on and off. */
|
|
195
|
+
declare const createCameraSource: (
|
|
196
|
+
options?: DeviceSourceOptions
|
|
197
|
+
) => DeviceSource;
|
|
198
|
+
/** A screen share: an audio and a video track from one browser prompt. */
|
|
199
|
+
declare const createScreenShareSource: (
|
|
200
|
+
options?: ScreenShareSourceOptions
|
|
201
|
+
) => ScreenShareSource;
|
|
202
|
+
/** Plays pulled audio tracks in one `<audio>` element. */
|
|
203
|
+
declare const createAudioSink: (options: AudioSinkOptions) => AudioSink;
|
|
204
|
+
declare const createMediaSources: (options?: {
|
|
205
|
+
microphone?: DeviceSourceOptions;
|
|
206
|
+
camera?: DeviceSourceOptions;
|
|
207
|
+
}) => {
|
|
208
|
+
microphone: DeviceSource;
|
|
209
|
+
camera: DeviceSource;
|
|
210
|
+
acquire: () => Promise<void>;
|
|
211
|
+
release: () => Promise<void>;
|
|
212
|
+
dispose: () => Promise<void>;
|
|
213
|
+
};
|
|
214
|
+
//#endregion
|
|
215
|
+
export {
|
|
216
|
+
ApiAuthRedirect,
|
|
217
|
+
ApiError,
|
|
218
|
+
ApiHistoryEntry,
|
|
219
|
+
ApiInvalidResponse,
|
|
220
|
+
ApiResponseError,
|
|
221
|
+
ApiTransportError,
|
|
222
|
+
type AudioSink,
|
|
223
|
+
type AudioSinkOptions,
|
|
224
|
+
ConnectionStats,
|
|
225
|
+
type DeviceSource,
|
|
226
|
+
type DeviceSourceOptions,
|
|
227
|
+
DevicesExhausted,
|
|
228
|
+
type InteropObservable,
|
|
229
|
+
type LogEntry,
|
|
230
|
+
type LogLevel,
|
|
231
|
+
MediaAccessError,
|
|
232
|
+
NegotiationOutcomeUnknown,
|
|
233
|
+
PeerConnectionFailed,
|
|
234
|
+
PullError,
|
|
235
|
+
PullState,
|
|
236
|
+
type PulledTrack,
|
|
237
|
+
PushError,
|
|
238
|
+
PushState,
|
|
239
|
+
type PushedTrack,
|
|
240
|
+
QualityLimitationReason,
|
|
241
|
+
type Readable,
|
|
242
|
+
type RealtimeClient,
|
|
243
|
+
type RealtimeClientOptions,
|
|
244
|
+
ReceivedTrackStats,
|
|
245
|
+
RemoteReceptionStats,
|
|
246
|
+
type ScreenShareSource,
|
|
247
|
+
type ScreenShareSourceOptions,
|
|
248
|
+
type ScreenShareTrack,
|
|
249
|
+
type ScreenShareTrackOptions,
|
|
250
|
+
SenderError,
|
|
251
|
+
SentStreamStats,
|
|
252
|
+
SentTrackStats,
|
|
253
|
+
SessionError,
|
|
254
|
+
SessionState,
|
|
255
|
+
SinkError,
|
|
256
|
+
SourceError,
|
|
257
|
+
TrackError,
|
|
258
|
+
TrackMetadata,
|
|
259
|
+
type TrackSource,
|
|
260
|
+
type TrackTransform,
|
|
261
|
+
TransceiverEvent,
|
|
262
|
+
TransceiverNotFound,
|
|
263
|
+
TransformFailed,
|
|
264
|
+
TransportStats,
|
|
265
|
+
type Writable,
|
|
266
|
+
createAudioSink,
|
|
267
|
+
createCameraSource,
|
|
268
|
+
createMediaSources,
|
|
269
|
+
createMicrophoneSource,
|
|
270
|
+
createRealtimeClient,
|
|
271
|
+
createScreenShareSource,
|
|
272
|
+
setLogLevel,
|
|
273
|
+
writable
|
|
274
|
+
};
|
|
275
|
+
//# sourceMappingURL=index.d.ts.map
|