@cloudflare/realtimekit 0.0.3 → 0.2.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/.config/rewrite-types.js +15 -2
- package/README.md +1 -15
- package/build-types.sh +0 -16
- package/dist/browser.js +15 -16
- package/dist/index.cjs.js +15 -15
- package/dist/index.d.ts +44 -102
- package/dist/index.es.js +7326 -8222
- package/dist/index.rn.js +22 -0
- package/dist/mock.cjs.js +3 -3
- package/dist/mock.es.js +1158 -1039
- package/dist/ts3.4/dist/index.d.ts +44 -105
- package/package.json +3 -14
- package/dist/react.cjs.js +0 -23
- package/dist/react.d.ts +0 -4784
- package/dist/react.es.js +0 -30954
- package/dist/ts3.4/dist/react.d.ts +0 -4733
|
@@ -1959,8 +1959,6 @@ declare class ChatSocketHandler {
|
|
|
1959
1959
|
on(event: number, handler: (socketMessage: ChatSocketMessage) => void): void;
|
|
1960
1960
|
}
|
|
1961
1961
|
declare class RTKSelectedPeers {
|
|
1962
|
-
private readonly _activeSpeakerPeers;
|
|
1963
|
-
private readonly _compulsoryPeers;
|
|
1964
1962
|
constructor();
|
|
1965
1963
|
add(peerId: string, priority: number): number;
|
|
1966
1964
|
delete(peerId: string): void;
|
|
@@ -1968,7 +1966,6 @@ declare class RTKSelectedPeers {
|
|
|
1968
1966
|
readonly peers: string[];
|
|
1969
1967
|
readonly compulsoryPeers: string[];
|
|
1970
1968
|
readonly activeSpeakerPeers: string[];
|
|
1971
|
-
private _removeFromCompulsoryPeer;
|
|
1972
1969
|
}
|
|
1973
1970
|
type PipEvents = {
|
|
1974
1971
|
['cameraToggled']: () => void;
|
|
@@ -1981,40 +1978,15 @@ type PipEvents = {
|
|
|
1981
1978
|
declare class RTKPip extends RTKTypedEventEmitter<PipEvents> {
|
|
1982
1979
|
private constructor();
|
|
1983
1980
|
static _init(context: Context<RTKContextState>, self: RTKSelf$1): Promise<RTKPip>;
|
|
1984
|
-
private setupIcon;
|
|
1985
1981
|
overrideIcon(icon: 'handRaise' | 'pin', value: string): Promise<void>;
|
|
1986
|
-
private constructImage;
|
|
1987
|
-
private createVideoContainer;
|
|
1988
|
-
private setupEventListeners;
|
|
1989
|
-
private cleanupEventListeners;
|
|
1990
|
-
private enablePipMediaControls;
|
|
1991
|
-
private onSelfVideoUpdateListener;
|
|
1992
|
-
private onSelfAudioUpdateListener;
|
|
1993
|
-
private handlePipMediaControls;
|
|
1994
|
-
private createCanvas;
|
|
1995
|
-
private eventCallback;
|
|
1996
|
-
private setupMediaSessionEvents;
|
|
1997
|
-
private mountAudioEvents;
|
|
1998
|
-
private mountVideoEvents;
|
|
1999
|
-
private unmountEvents;
|
|
2000
|
-
private getSources;
|
|
2001
|
-
private drawEmptyTile;
|
|
2002
|
-
private drawIcons;
|
|
2003
|
-
private drawTile;
|
|
2004
|
-
private calcGridElemSize;
|
|
2005
|
-
private paintCanvas;
|
|
2006
|
-
private animate;
|
|
2007
1982
|
isSupported(): boolean;
|
|
2008
1983
|
readonly isActive: boolean;
|
|
2009
|
-
private cleanup;
|
|
2010
1984
|
init({ height, width }?: {
|
|
2011
1985
|
height?: number;
|
|
2012
1986
|
width?: number;
|
|
2013
1987
|
}): void;
|
|
2014
|
-
private updateMediaSession;
|
|
2015
1988
|
enableSource(source: string): void;
|
|
2016
1989
|
disableSource(source: string): void;
|
|
2017
|
-
private generateAvatar;
|
|
2018
1990
|
addSource(id: string, element: HTMLVideoElement, enabled: boolean, pinned?: boolean, displayText?: string, imageUrl?: string, handRaised?: boolean): void;
|
|
2019
1991
|
updateSource(id: string, source: any): void;
|
|
2020
1992
|
removeSource(id: string): void;
|
|
@@ -2102,7 +2074,6 @@ declare class RoomSocketHandler {
|
|
|
2102
2074
|
id: string;
|
|
2103
2075
|
payload: Uint8Array;
|
|
2104
2076
|
}>;
|
|
2105
|
-
private handleSocketEvents;
|
|
2106
2077
|
on(event: number, handler: (message: EventHandlerTypes) => void): void;
|
|
2107
2078
|
getUserPermissions(userId: string): Promise<Pick<PresetTypeV2['permissions'], 'chat' | 'polls' | 'plugins'>>;
|
|
2108
2079
|
}
|
|
@@ -2140,12 +2111,7 @@ interface HandlerSendResult extends GenericHandlerResult {
|
|
|
2140
2111
|
mid: string;
|
|
2141
2112
|
}
|
|
2142
2113
|
declare abstract class HandlerInterface<TransportPromiseEvents> extends EnhancedEventEmitter<TransportPromiseEvents> {
|
|
2143
|
-
|
|
2144
|
-
protected _sendScreenShareStream: MediaStream;
|
|
2145
|
-
protected _direction?: 'send' | 'recv';
|
|
2146
|
-
pc: RTCPeerConnection;
|
|
2147
|
-
protected _transportReady: boolean;
|
|
2148
|
-
private readonly _mapMidTransceiver;
|
|
2114
|
+
pc: RTCPeerConnection;
|
|
2149
2115
|
enableHighBitrate: boolean;
|
|
2150
2116
|
enableStereo: boolean;
|
|
2151
2117
|
enableDtx: boolean;
|
|
@@ -2155,9 +2121,7 @@ declare abstract class HandlerInterface<TransportPromiseEvents> extends Enhanced
|
|
|
2155
2121
|
restartIce(): Promise<GenericHandlerResult>;
|
|
2156
2122
|
init({ direction, iceServers, iceTransportPolicy, additionalSettings, proprietaryConstraints, onTrackHandler, }: HandlerRunOptions): void;
|
|
2157
2123
|
connect(): Promise<GenericHandlerResult>;
|
|
2158
|
-
getTransportStats(): Promise<RTCStatsReport>;
|
|
2159
|
-
protected _assertSendDirection(): void;
|
|
2160
|
-
protected _assertRecvDirection(): void;
|
|
2124
|
+
getTransportStats(): Promise<RTCStatsReport>;
|
|
2161
2125
|
getReceiverStats(localId: string): Promise<RTCStatsReport>;
|
|
2162
2126
|
stopSending(localId: string): Promise<GenericHandlerResult>;
|
|
2163
2127
|
abstract send(options: HandlerSendOptions): Promise<HandlerSendResult>;
|
|
@@ -2190,17 +2154,12 @@ declare enum MediaNodeType {
|
|
|
2190
2154
|
type MediaConnectionState = {
|
|
2191
2155
|
recv: {
|
|
2192
2156
|
state: string;
|
|
2193
|
-
reconnected: boolean;
|
|
2194
2157
|
};
|
|
2195
2158
|
send: {
|
|
2196
2159
|
state: string;
|
|
2197
|
-
reconnected: boolean;
|
|
2198
2160
|
};
|
|
2199
2161
|
};
|
|
2200
2162
|
type TransportPromiseEvents = {
|
|
2201
|
-
'connect': {
|
|
2202
|
-
answer: RTCSessionDescriptionInit;
|
|
2203
|
-
};
|
|
2204
2163
|
'close': {
|
|
2205
2164
|
answer: RTCSessionDescriptionInit;
|
|
2206
2165
|
};
|
|
@@ -2409,13 +2368,10 @@ declare class RTKParticipant$1 extends RTKTypedEventEmitter<ParticipantEvents> {
|
|
|
2409
2368
|
supportsRemoteControl: boolean;
|
|
2410
2369
|
presetName?: string;
|
|
2411
2370
|
readonly stageStatus: StageStatus;
|
|
2412
|
-
private readonly mediaJoined: any;
|
|
2413
|
-
private readonly socketJoined: any;
|
|
2414
2371
|
constructor(context: Context<RTKContextState>, participant: Participant, self: RTKSelf, roomSocket: RoomSocketHandler);
|
|
2415
2372
|
setVideoEnabled(videoEnabled: boolean, emitEvent?: boolean): void;
|
|
2416
2373
|
setAudioEnabled(audioEnabled: boolean, emitEvent?: boolean): void;
|
|
2417
2374
|
setScreenShareEnabled(screenShareEnabled: boolean, emitEvent?: boolean): void;
|
|
2418
|
-
private setupEvents;
|
|
2419
2375
|
pin(): Promise<void>;
|
|
2420
2376
|
unpin(): Promise<void>;
|
|
2421
2377
|
setIsPinned(isPinned: boolean, emitEvent?: boolean): void;
|
|
@@ -2427,7 +2383,6 @@ declare class RTKParticipant$1 extends RTKTypedEventEmitter<ParticipantEvents> {
|
|
|
2427
2383
|
readonly isPinned: boolean;
|
|
2428
2384
|
registerVideoElement(videoElem: HTMLVideoElement): void;
|
|
2429
2385
|
deregisterVideoElement(videoElem: HTMLVideoElement): void;
|
|
2430
|
-
private updateVideo;
|
|
2431
2386
|
}
|
|
2432
2387
|
type TranscriptionData = {
|
|
2433
2388
|
id: string;
|
|
@@ -2494,7 +2449,6 @@ declare class RTKMeta$1 extends RTKTypedEventEmitter<MetaEvents> {
|
|
|
2494
2449
|
readonly meetingId: string;
|
|
2495
2450
|
setBroadcastTabChanges(broadcastTabChanges: boolean): void;
|
|
2496
2451
|
setSelfActiveTab(spotlightTab: ActiveTab, tabChangeSource: TabChangeSource): void;
|
|
2497
|
-
private assertActiveTabToRoom;
|
|
2498
2452
|
}
|
|
2499
2453
|
interface RTKMapEvents<T extends EventMap> {
|
|
2500
2454
|
onAddEvent?: keyof T;
|
|
@@ -2606,6 +2560,25 @@ type BroadcastMessageTarget = {
|
|
|
2606
2560
|
} | {
|
|
2607
2561
|
meetingIds: string[];
|
|
2608
2562
|
};
|
|
2563
|
+
type JoinedPeer = {
|
|
2564
|
+
id: string;
|
|
2565
|
+
userId: string;
|
|
2566
|
+
name: string;
|
|
2567
|
+
stageType?: StageStatus;
|
|
2568
|
+
customParticipantId?: string;
|
|
2569
|
+
presetId?: string;
|
|
2570
|
+
picture?: string;
|
|
2571
|
+
waitlisted: boolean;
|
|
2572
|
+
recorderType?: string;
|
|
2573
|
+
stageStatus?: StageStatus;
|
|
2574
|
+
metadata?: {
|
|
2575
|
+
preset_name?: string;
|
|
2576
|
+
};
|
|
2577
|
+
flags?: {
|
|
2578
|
+
hiddenParticipant?: boolean;
|
|
2579
|
+
recorder?: boolean;
|
|
2580
|
+
};
|
|
2581
|
+
};
|
|
2609
2582
|
type ParticipantsEvents = {
|
|
2610
2583
|
['viewModeChanged']: (payload: {
|
|
2611
2584
|
viewMode: string;
|
|
@@ -2653,8 +2626,6 @@ declare class RTKParticipants$1 extends RTKTypedEventEmitter<ParticipantsEvents>
|
|
|
2653
2626
|
readonly pinned: Readonly<RTKParticipantMap$1>;
|
|
2654
2627
|
readonly all: Readonly<RTKBasicParticipantsMap>;
|
|
2655
2628
|
readonly pip: RTKPip;
|
|
2656
|
-
private readonly socketJoined: any;
|
|
2657
|
-
private readonly mediaJoined: any;
|
|
2658
2629
|
rateLimitConfig: {
|
|
2659
2630
|
maxInvocations: number;
|
|
2660
2631
|
period: number;
|
|
@@ -2748,8 +2719,7 @@ declare class FetchClient {
|
|
|
2748
2719
|
retry: number;
|
|
2749
2720
|
retryDelay: number;
|
|
2750
2721
|
responseType?: string;
|
|
2751
|
-
});
|
|
2752
|
-
private buildURL;
|
|
2722
|
+
});
|
|
2753
2723
|
request<T = any>(config: FetchRequestConfig): Promise<FetchResponse<T>>;
|
|
2754
2724
|
get<T = any>(url: string, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
|
|
2755
2725
|
post<T = any>(url: string, data?: any, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
|
|
@@ -2764,7 +2734,6 @@ declare class LocalMediaHandler extends RTKEventEmitter<LocalMediaEvents> {
|
|
|
2764
2734
|
audioUpdateInProgress: boolean;
|
|
2765
2735
|
videoUpdateInProgress: boolean;
|
|
2766
2736
|
constructor(context: Context<RTKContextState>, mediaConstraints: MediaConstraints, isNonPreferredDevice?: (media: MediaDeviceInfo) => boolean, autoSwitchDevice?: boolean);
|
|
2767
|
-
private onVisibilityChange;
|
|
2768
2737
|
repopulateAvailableDevices(): Promise<boolean>;
|
|
2769
2738
|
setupStreams({ audio, video, }: {
|
|
2770
2739
|
audio: boolean;
|
|
@@ -2782,28 +2751,23 @@ declare class LocalMediaHandler extends RTKEventEmitter<LocalMediaEvents> {
|
|
|
2782
2751
|
};
|
|
2783
2752
|
getAllDevices(): Promise<InputDeviceInfo[]>;
|
|
2784
2753
|
getDeviceById(deviceId: string, kind?: 'audioinput' | 'audiooutput' | 'videoinput'): Promise<MediaDeviceInfo>;
|
|
2785
|
-
private onAudioTrackMuted;
|
|
2786
|
-
private onAudioTrackChanged;
|
|
2787
2754
|
readonly rawAudioTrack: MediaStreamTrack;
|
|
2788
2755
|
readonly audioTrack: MediaStreamTrack;
|
|
2789
2756
|
readonly audioEnabled: boolean;
|
|
2790
|
-
enableAudio(): Promise<void>;
|
|
2757
|
+
enableAudio(customTrack?: MediaStreamTrack): Promise<void>;
|
|
2791
2758
|
disableAudio(): void;
|
|
2792
2759
|
getAudioDevices(devices?: MediaDeviceInfo[]): Promise<MediaDeviceInfo[]>;
|
|
2793
2760
|
setAudioDevice(device: MediaDeviceInfo): Promise<void>;
|
|
2794
2761
|
setupSpeaker(): Promise<void>;
|
|
2795
2762
|
setSpeakerDevice(device: MediaDeviceInfo): Promise<void>;
|
|
2796
|
-
private onVideoTrackChanged;
|
|
2797
|
-
private onVideoTrackEnded;
|
|
2798
2763
|
readonly rawVideoTrack: MediaStreamTrack;
|
|
2799
2764
|
readonly videoTrack: MediaStreamTrack;
|
|
2800
2765
|
readonly videoEnabled: boolean;
|
|
2801
|
-
enableVideo(): Promise<void>;
|
|
2766
|
+
enableVideo(customTrack?: MediaStreamTrack): Promise<void>;
|
|
2802
2767
|
disableVideo(): void;
|
|
2803
2768
|
getVideoDevices(devices?: MediaDeviceInfo[]): Promise<MediaDeviceInfo[]>;
|
|
2804
2769
|
setVideoDevice(device: MediaDeviceInfo): Promise<void>;
|
|
2805
2770
|
updateVideoConstraints(resolution: VideoQualityConstraints): Promise<void>;
|
|
2806
|
-
private onScreenShareEnded;
|
|
2807
2771
|
readonly screenShareTracks: {
|
|
2808
2772
|
audio: MediaStreamTrack;
|
|
2809
2773
|
video: MediaStreamTrack;
|
|
@@ -3094,7 +3058,6 @@ type PermissionEvents = {
|
|
|
3094
3058
|
};
|
|
3095
3059
|
declare class RTKPermissionsPreset$1 extends RTKTypedEventEmitter<PermissionEvents> {
|
|
3096
3060
|
private constructor();
|
|
3097
|
-
private setupEvents;
|
|
3098
3061
|
static fromResponse(response: PresetPermissions, viewType: ViewType, context: Context<RTKContextState>): RTKPermissionsPreset$1;
|
|
3099
3062
|
static default(context: Context<RTKContextState>, viewType: ViewType): RTKPermissionsPreset$1;
|
|
3100
3063
|
static init(context: Context<RTKContextState>, viewType: ViewType, response?: PresetPermissions): RTKPermissionsPreset$1;
|
|
@@ -3175,7 +3138,6 @@ declare class RTKLivestream$1 extends RTKTypedEventEmitter<LivestreamEvents> {
|
|
|
3175
3138
|
viewerCount: number;
|
|
3176
3139
|
constructor(self: RTKSelf);
|
|
3177
3140
|
setLivestreamState(livestreamState: LivestreamState): void;
|
|
3178
|
-
private emitCurrentLivestreamState;
|
|
3179
3141
|
start(livestreamConfig?: StartLivestreamConfig): Promise<void>;
|
|
3180
3142
|
stop(): Promise<void>;
|
|
3181
3143
|
}
|
|
@@ -3321,12 +3283,7 @@ declare class RTKChat$1 extends RTKTypedEventEmitter<ChatEvents> {
|
|
|
3321
3283
|
channels: ChatChannel[];
|
|
3322
3284
|
maxTextLimit: number;
|
|
3323
3285
|
setMaxTextLimit(limit: number): void;
|
|
3324
|
-
private readonly socketJoined: any;
|
|
3325
3286
|
constructor(context: Context<RTKContextState>, chatSocketHandler: ChatSocketHandler, chatChannelSocketHandler: ChatChannelSocketHandler, self: RTKSelf$1, participants: RTKParticipants$1);
|
|
3326
|
-
private sendMessageInternal;
|
|
3327
|
-
private sendTextMessageInternal;
|
|
3328
|
-
private sendImageMessageInternal;
|
|
3329
|
-
private sendFileMessageInternal;
|
|
3330
3287
|
readonly rateLimits: {
|
|
3331
3288
|
maxInvocations: number;
|
|
3332
3289
|
period: number;
|
|
@@ -3402,7 +3359,6 @@ type PollsEvents = {
|
|
|
3402
3359
|
};
|
|
3403
3360
|
declare class RTKPolls$1 extends RTKTypedEventEmitter<PollsEvents> {
|
|
3404
3361
|
items: Poll[];
|
|
3405
|
-
private readonly socketJoined: any;
|
|
3406
3362
|
constructor(context: Context<RTKContextState>, self: RTKSelf$1, pollSocketHandler: PollSocketHandler);
|
|
3407
3363
|
create(question: string, options: string[], anonymous?: boolean, hideVotes?: boolean): Promise<void>;
|
|
3408
3364
|
vote(id: string, index: number): Promise<void>;
|
|
@@ -3462,12 +3418,6 @@ declare class PluginSocketHandler {
|
|
|
3462
3418
|
on(event: number, handler: (socketMessage: PluginSocketMessage, messageId?: string) => void): void;
|
|
3463
3419
|
}
|
|
3464
3420
|
declare class RTKSelfMedia extends RTKTypedEventEmitter<SelfEvents> {
|
|
3465
|
-
protected localMediaHandler: LocalMediaHandler;
|
|
3466
|
-
protected updatePermission(): Promise<void>;
|
|
3467
|
-
protected populateMediaPermissionsInCallstats({ message, kind, }: {
|
|
3468
|
-
message: keyof typeof MediaPermission;
|
|
3469
|
-
kind: 'audio' | 'video' | 'screenshare';
|
|
3470
|
-
}): Promise<void>;
|
|
3471
3421
|
init(options?: {
|
|
3472
3422
|
video?: boolean;
|
|
3473
3423
|
audio?: boolean;
|
|
@@ -3886,6 +3836,10 @@ type LogData$2 = {
|
|
|
3886
3836
|
};
|
|
3887
3837
|
peerIds?: string[];
|
|
3888
3838
|
producers?: ProducerState[];
|
|
3839
|
+
sdp?: RTCSessionDescription['sdp'];
|
|
3840
|
+
queueSizeAtStart?: number;
|
|
3841
|
+
taskStartTime?: number;
|
|
3842
|
+
subTasksSize?: number;
|
|
3889
3843
|
};
|
|
3890
3844
|
type EventSeverities = SupportedEventSeverities;
|
|
3891
3845
|
type LogData$1 = LogData$2;
|
|
@@ -3949,14 +3903,12 @@ declare class RTKStore$1 {
|
|
|
3949
3903
|
maxInvocations: number;
|
|
3950
3904
|
period: number;
|
|
3951
3905
|
};
|
|
3952
|
-
private listeners;
|
|
3953
3906
|
constructor({ name, socketHandler, meetingId }: {
|
|
3954
3907
|
name: string;
|
|
3955
3908
|
socketHandler: PluginSocketHandler;
|
|
3956
3909
|
meetingId: string;
|
|
3957
3910
|
});
|
|
3958
3911
|
set(key: string, value: any, sync?: boolean, emit?: boolean): Promise<void>;
|
|
3959
|
-
private remoteSet;
|
|
3960
3912
|
bulkSet(data: {
|
|
3961
3913
|
key: string;
|
|
3962
3914
|
payload: any;
|
|
@@ -4000,7 +3952,6 @@ declare class MediaNodeClient {
|
|
|
4000
3952
|
readonly context: Context<RTKContextState>;
|
|
4001
3953
|
readonly authToken: string;
|
|
4002
3954
|
readonly e2ee: boolean;
|
|
4003
|
-
maxPreferredStreams: number;
|
|
4004
3955
|
readonly peerId: string;
|
|
4005
3956
|
constructor(context: Context<RTKContextState>, nodeType: MediaNodeType, options: MediaNodeClientOptions);
|
|
4006
3957
|
mediaJoined: boolean;
|
|
@@ -4012,15 +3963,11 @@ declare class MediaNodeClient {
|
|
|
4012
3963
|
}, forceFullReset?: boolean, rejoining?: boolean): Promise<{
|
|
4013
3964
|
roomJoined: boolean;
|
|
4014
3965
|
}>;
|
|
4015
|
-
private partialJoinRoomPromise;
|
|
4016
3966
|
_partialJoinRoom(displayName: string, roomUuid: string, rejoining?: boolean, loc?: GeoLocation): Promise<void>;
|
|
4017
3967
|
partialJoinRoom(displayName: string, roomUuid: string, rejoining?: boolean, loc?: GeoLocation): Promise<any>;
|
|
4018
|
-
private _joinRoom;
|
|
4019
|
-
private completeJoinRoom;
|
|
4020
3968
|
leaveRoom(): Promise<void>;
|
|
4021
3969
|
getConsumers(): Map<string, Consumer>;
|
|
4022
3970
|
activatePeers(producers: ProducerState[]): Promise<void>;
|
|
4023
|
-
deactivatePeers(producers: ProducerState[], mode?: 'manual' | 'default'): Promise<void>;
|
|
4024
3971
|
createConsumers(producers: ProducerState[]): Promise<void>;
|
|
4025
3972
|
closeConsumers(producers: ProducerState[]): Promise<void>;
|
|
4026
3973
|
_shareWebcam(videoTrack: MediaStreamTrack & {
|
|
@@ -4045,8 +3992,8 @@ declare class MediaNodeClient {
|
|
|
4045
3992
|
unmuteSelf(): Promise<void>;
|
|
4046
3993
|
resetVideoProducers(videoTrack: MediaStreamTrack, screenShareTrack?: MediaStreamTrack): Promise<void>;
|
|
4047
3994
|
changeDisplayName(displayName: string, peerId?: string): Promise<void>;
|
|
4048
|
-
kick(peerId: string):
|
|
4049
|
-
kickAll():
|
|
3995
|
+
kick(peerId: string): void;
|
|
3996
|
+
kickAll(): void;
|
|
4050
3997
|
muteAll(_allowUnMute: boolean): Promise<void>;
|
|
4051
3998
|
muteAllVideo(): Promise<void>;
|
|
4052
3999
|
disableAudio(peerId: string): Promise<void>;
|
|
@@ -4277,7 +4224,6 @@ declare class SocketService {
|
|
|
4277
4224
|
capabilities: SocketServiceCapabilities;
|
|
4278
4225
|
});
|
|
4279
4226
|
updateURL(peerID: string): void;
|
|
4280
|
-
private static getSocketEdgeDomain;
|
|
4281
4227
|
readonly url: string;
|
|
4282
4228
|
connect(): Promise<void>;
|
|
4283
4229
|
disconnect(): Promise<void>;
|
|
@@ -4352,7 +4298,6 @@ type StageEvents = {
|
|
|
4352
4298
|
declare class RTKStage extends RTKTypedEventEmitter<StageEvents> {
|
|
4353
4299
|
constructor(context: Context<RTKContextState>, self: RTKSelf$1, participants: RTKParticipants, stageSocketHandler: StageSocketHandler, roomSocketHandler: RoomSocketHandler);
|
|
4354
4300
|
readonly status: StageStatus;
|
|
4355
|
-
private setupEvents;
|
|
4356
4301
|
getAccessRequests(): {
|
|
4357
4302
|
stageRequests: StageRequestPayload[];
|
|
4358
4303
|
};
|
|
@@ -4396,7 +4341,6 @@ declare class RTKSelf$1 extends RTKSelfMedia {
|
|
|
4396
4341
|
private constructor();
|
|
4397
4342
|
static __init__(context: Context<RTKContextState>, details: UserDetailsResponse, permissions: RTKPermissionsPreset$1, theme: RTKThemePreset$1, presetName: string, skipAwaits?: boolean): Promise<RTKSelf$1>;
|
|
4398
4343
|
cleanupEvents(): void;
|
|
4399
|
-
private setupEvents;
|
|
4400
4344
|
readonly permissions: RTKPermissionsPreset$1;
|
|
4401
4345
|
readonly config: RTKThemePreset$1;
|
|
4402
4346
|
readonly roomJoined: boolean;
|
|
@@ -4408,8 +4352,8 @@ declare class RTKSelf$1 extends RTKSelfMedia {
|
|
|
4408
4352
|
}): Promise<void>;
|
|
4409
4353
|
destructMediaHandler(): Promise<void>;
|
|
4410
4354
|
removeDocumentEventListeners(): Promise<void>;
|
|
4411
|
-
enableAudio(): Promise<void>;
|
|
4412
|
-
enableVideo(): Promise<void>;
|
|
4355
|
+
enableAudio(customTrack?: MediaStreamTrack): Promise<void>;
|
|
4356
|
+
enableVideo(customTrack?: MediaStreamTrack): Promise<void>;
|
|
4413
4357
|
updateVideoConstraints(resolution: VideoQualityConstraints): Promise<void>;
|
|
4414
4358
|
enableScreenShare(): Promise<void>;
|
|
4415
4359
|
updateScreenshareConstraints(resolution: VideoQualityConstraints): Promise<void>;
|
|
@@ -4427,7 +4371,6 @@ declare class RTKSelf$1 extends RTKSelfMedia {
|
|
|
4427
4371
|
cleanUpTracks(): void;
|
|
4428
4372
|
registerVideoElement(videoElem: HTMLVideoElement, isPreview?: boolean): void;
|
|
4429
4373
|
deregisterVideoElement(videoElem: HTMLVideoElement, isPreview?: boolean): void;
|
|
4430
|
-
private updateVideo;
|
|
4431
4374
|
}
|
|
4432
4375
|
interface RTKPluginResponse {
|
|
4433
4376
|
baseURL: string;
|
|
@@ -4534,11 +4477,9 @@ declare class RTKPlugin$1 extends RTKEventEmitter<PluginEvents> {
|
|
|
4534
4477
|
enabledBy: string;
|
|
4535
4478
|
constructor(context: Context<RTKContextState>, { baseURL, createdAt, description, id, name, organizationId, picture, private: isPrivate, published, staggered, tags, type, updatedAt, }: RTKPluginResponse, pluginSocketHandler: PluginSocketHandler, self: RTKSelf$1, participants: RTKParticipants$1, chat: Readonly<RTKChat$1>, meetingTitle: string);
|
|
4536
4479
|
sendIframeEvent(message: PluginIframeMessage): void;
|
|
4537
|
-
private handleIframeMessage;
|
|
4538
4480
|
sendData(payload: SendDataOptions): void;
|
|
4539
4481
|
removePluginView(viewId?: string): void;
|
|
4540
4482
|
addPluginView(iframe: HTMLIFrameElement | ReactNativeWebView, viewId?: string): void;
|
|
4541
|
-
private setActive;
|
|
4542
4483
|
activateForSelf(): Promise<void>;
|
|
4543
4484
|
deactivateForSelf(): void;
|
|
4544
4485
|
enable(): Promise<void>;
|
|
@@ -4569,16 +4510,6 @@ interface APIOptions {
|
|
|
4569
4510
|
}
|
|
4570
4511
|
declare class API {
|
|
4571
4512
|
ipInfo: any;
|
|
4572
|
-
protected fetchClient: FetchClient;
|
|
4573
|
-
protected requests: FetchClient;
|
|
4574
|
-
protected roomName: string;
|
|
4575
|
-
protected roomUUID: string;
|
|
4576
|
-
protected authToken: string;
|
|
4577
|
-
protected organizationId: string;
|
|
4578
|
-
protected iceServers: IceServerInformation[];
|
|
4579
|
-
protected pluginInformation: RTKPluginResponse[];
|
|
4580
|
-
protected userDetails: UserDetailsResponseV2;
|
|
4581
|
-
protected roomDetails: RoomDetails;
|
|
4582
4513
|
readonly peerId: string;
|
|
4583
4514
|
context: Context<RTKContextState>;
|
|
4584
4515
|
constructor(context: Context<RTKContextState>, options?: APIOptions);
|
|
@@ -4618,7 +4549,6 @@ declare class RTKConnectedMeetings$1 extends RTKTypedEventEmitter<ConnectedMeeti
|
|
|
4618
4549
|
readonly supportsConnectedMeetings: boolean;
|
|
4619
4550
|
readonly isActive: boolean;
|
|
4620
4551
|
readonly currentMeetingId: string;
|
|
4621
|
-
private validateConnectedMeetingsAction;
|
|
4622
4552
|
getConnectedMeetings(): Promise<{
|
|
4623
4553
|
parentMeeting: ConnectedMeeting;
|
|
4624
4554
|
meetings: ConnectedMeeting[];
|
|
@@ -4653,7 +4583,6 @@ declare class RTKConnectedMeetings$1 extends RTKTypedEventEmitter<ConnectedMeeti
|
|
|
4653
4583
|
success: boolean;
|
|
4654
4584
|
error: any;
|
|
4655
4585
|
}>;
|
|
4656
|
-
private moveSuccessHandler;
|
|
4657
4586
|
}
|
|
4658
4587
|
interface Overrides {
|
|
4659
4588
|
disableSimulcast?: boolean;
|
|
@@ -4672,7 +4601,6 @@ interface RealtimeKitClientOptions {
|
|
|
4672
4601
|
declare class RealtimeKitClient {
|
|
4673
4602
|
private constructor();
|
|
4674
4603
|
static init(options: RealtimeKitClientOptions): Promise<RealtimeKitClient>;
|
|
4675
|
-
private static setupContext;
|
|
4676
4604
|
join(): Promise<void>;
|
|
4677
4605
|
leave(state?: LeaveRoomState): Promise<void>;
|
|
4678
4606
|
readonly participants: Readonly<RTKParticipants$1>;
|
|
@@ -4691,11 +4619,22 @@ declare class RealtimeKitClient {
|
|
|
4691
4619
|
joinRoom(): Promise<void>;
|
|
4692
4620
|
leaveRoom(state?: LeaveRoomState): Promise<void>;
|
|
4693
4621
|
}
|
|
4622
|
+
declare enum RequestToJoinType {
|
|
4623
|
+
PRESENT = "REQUEST_TO_PRESENT"
|
|
4624
|
+
}
|
|
4694
4625
|
type RTKParticipant = Readonly<RTKParticipant$1>;
|
|
4695
4626
|
type RTKParticipants = Readonly<RTKParticipants$1>;
|
|
4696
4627
|
type RTKParticipantMap = Readonly<RTKParticipantMap$1>;
|
|
4697
4628
|
type RTKPlugin = Readonly<RTKPlugin$1>;
|
|
4629
|
+
type RTKPlugins = Readonly<RTKPlugins$1>;
|
|
4630
|
+
type RTKPluginMap = Readonly<RTKPluginMap$1>;
|
|
4631
|
+
type RTKMeta = Readonly<RTKMeta$1>;
|
|
4698
4632
|
type RTKSelf = Readonly<RTKSelf$1>;
|
|
4633
|
+
type RTKChat = Readonly<RTKChat$1>;
|
|
4634
|
+
type RTKPolls = Readonly<RTKPolls$1>;
|
|
4635
|
+
type RTKRecording = Readonly<RTKRecording$1>;
|
|
4636
|
+
type RTKLivestream = Readonly<RTKLivestream$1>;
|
|
4637
|
+
type RTKStore = RTKStore$1;
|
|
4699
4638
|
type RTKConnectedMeetings = Readonly<RTKConnectedMeetings$1>;
|
|
4700
4639
|
type RTKPermissionsPreset = Readonly<RTKPermissionsPreset$1>;
|
|
4701
4640
|
type RTKThemePreset = Readonly<RTKThemePreset$1>;
|
|
@@ -4716,4 +4655,4 @@ declare global {
|
|
|
4716
4655
|
TransformStream?: any;
|
|
4717
4656
|
}
|
|
4718
4657
|
}
|
|
4719
|
-
export { ActiveTab, ActiveTabType, AudioProducerScoreStats, ChatChannel, ChatUpdateParams, CustomMessage, DeviceConfig, RTKBasicParticipant, RealtimeKitClientOptions, RTKConnectedMeetings, RTKParticipant, RTKParticipantMap, RTKParticipants, RTKPermissionsPreset, RTKPlugin, RTKSelf,
|
|
4658
|
+
export { ActiveTab, ActiveTabType, AudioConsumerScoreStats, AudioMiddleware, AudioProducerScoreStats, BroadcastMessagePayload, ChatChannel, ChatUpdateParams, CustomMessage, DeviceConfig, RTKBasicParticipant, RTKChat, RealtimeKitClientOptions, RTKConnectedMeetings, RTKLivestream, RTKMeta, RTKParticipant, RTKParticipantMap, RTKParticipants, RTKPermissionsPreset, RTKPlugin, RTKPluginMap, RTKPlugins, RTKPolls, RTKRecording, RTKSelf, RTKStore, RTKThemePreset, FileMessage, ImageMessage, JoinedPeer, LeaveRoomState, LivestreamIngestionCredentials, LivestreamState, LogData, MediaConnectionState, MediaConnectionUpdate, MediaKind$1 as MediaKind, MediaPermission, Message, ProducerScoreStats, RTKSelfMedia as RTKSelfMedia, RecordingState, RequestToJoinType, SocketConnectionState, StageStatus, StartLivestreamConfig, TextMessage, VideoConsumerScoreStats, VideoMiddleware, VideoProducerScoreStats, VideoQualityConstraints, RealtimeKitClient as default, LeaveRoomState as leaveRoomState };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/realtimekit",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A real-time video and audio SDK for building custom, collaborative communication experiences.",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -17,18 +17,6 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
"./react": {
|
|
21
|
-
"import": "./dist/react.es.js",
|
|
22
|
-
"require": "./dist/react.cjs.js",
|
|
23
|
-
"types": "./dist/react.d.ts",
|
|
24
|
-
"typesVersions": {
|
|
25
|
-
"<4.0": {
|
|
26
|
-
"*": [
|
|
27
|
-
"./dist/ts3.4/react.d.ts"
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
20
|
"./inlined": {
|
|
33
21
|
"default": "./dist/browser.js",
|
|
34
22
|
"types": "./dist/index.d.ts",
|
|
@@ -53,6 +41,7 @@
|
|
|
53
41
|
}
|
|
54
42
|
}
|
|
55
43
|
},
|
|
44
|
+
"react-native": "./dist/index.rn.js",
|
|
56
45
|
"types": "./dist/index.d.ts",
|
|
57
46
|
"typesVersions": {
|
|
58
47
|
"<4.0": {
|
|
@@ -80,4 +69,4 @@
|
|
|
80
69
|
"scripts": {
|
|
81
70
|
"postpublish": "mv package.json.bak package.json"
|
|
82
71
|
}
|
|
83
|
-
}
|
|
72
|
+
}
|