@cloudflare/realtimekit 1.1.0-staging.12 → 1.1.0-staging.17

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.
@@ -1,73 +1,9 @@
1
1
  /// <reference types="node" />
2
- import EventEmitter$1, { EventEmitter } from 'events';
3
- import { MessageType as MessageType$1 } from '@protobuf-ts/runtime';
4
2
  import * as _dyteinternals_utils from '@dyteinternals/utils';
5
- import { ViewType, createNewFlagsmithInstance, PresetTypeV2, MediaVideoQualityType, LivestreamViewerMediaQualityType, MediaProductionPermissionType, WaitingRoomTypes, MediaScreenShareQualityType, PluginAccessControls, RecorderType as RecorderType$1, BorderRadius, BorderWidth, Theme } from '@dyteinternals/utils';
3
+ import { MediaVideoQualityType, ViewType, LivestreamViewerMediaQualityType, MediaProductionPermissionType, WaitingRoomTypes, createNewFlagsmithInstance, PresetTypeV2, MediaScreenShareQualityType, PluginAccessControls, RecorderType as RecorderType$1, BorderRadius, BorderWidth, Theme } from '@dyteinternals/utils';
4
+ import { MessageType as MessageType$1 } from '@protobuf-ts/runtime';
5
+ import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
6
6
  import * as WorkerTimers from 'worker-timers';
7
- declare global {
8
- interface SymbolConstructor {
9
- readonly observable: symbol;
10
- }
11
- }
12
- /**
13
- Get keys of the given type as strings.
14
-
15
- Number keys are converted to strings.
16
-
17
- Use-cases:
18
- - Get string keys from a type which may have number keys.
19
- - Makes it possible to index using strings retrieved from template types.
20
-
21
- @example
22
- ```
23
- import type {StringKeyOf} from 'type-fest';
24
-
25
- type Foo = {
26
- 1: number,
27
- stringKey: string,
28
- };
29
-
30
- type StringKeysOfFoo = StringKeyOf<Foo>;
31
- //=> '1' | 'stringKey'
32
- ```
33
-
34
- @category Object
35
- */
36
- type StringKeyOf<BaseType> = string;
37
- declare class RTKEventEmitter<T extends string | symbol> extends EventEmitter {
38
- constructor();
39
- emit(event: T, ...args: any[]): boolean;
40
- on(event: T, callback: (...args: any[]) => void): this;
41
- addListener(event: T, callback: (...args: any[]) => any): this;
42
- off(event: T, callback: (...args: any[]) => any): this;
43
- once(event: T, callback: (...args: any[]) => any): this;
44
- prependListener(event: T, callback: (...args: any[]) => any): this;
45
- prependOnceListener(event: T, callback: (...args: any[]) => any): this;
46
- removeListener(event: T, callback: (...args: any[]) => any): this;
47
- removeAllListeners(event?: T): this;
48
- listeners(event: T): Function[];
49
- listenerCount(event: T): number;
50
- }
51
- type EventMap$1 = {
52
- [key: string]: (...args: any[]) => void;
53
- };
54
- type WildCardEvent<T> = {
55
- ['*']: (event: StringKeyOf<T>, ...args: any) => void;
56
- };
57
- declare class RTKTypedEventEmitter<Events extends EventMap$1 & WildCardEvent<Events>> extends EventEmitter {
58
- constructor();
59
- emit<E extends StringKeyOf<Events>>(event: E, ...args: Parameters<Events[E]>): boolean;
60
- on<E extends StringKeyOf<Events>>(event: E, callback: Events[E]): this;
61
- addListener<E extends StringKeyOf<Events>>(event: E, callback: Events[E]): this;
62
- off<T extends StringKeyOf<Events>>(event: T, callback: Events[T]): this;
63
- once<T extends StringKeyOf<Events>>(event: T, callback: Events[T]): this;
64
- prependListener<T extends StringKeyOf<Events>>(event: T, callback: Events[T]): this;
65
- prependOnceListener<T extends StringKeyOf<Events>>(event: T, callback: Events[T]): this;
66
- removeListener<T extends StringKeyOf<Events>>(event: T, callback: Events[T]): this;
67
- removeAllListeners<T extends StringKeyOf<Events>>(event?: T): this;
68
- listeners<T extends StringKeyOf<Events>>(event: T): Function[];
69
- listenerCount<T extends StringKeyOf<Events>>(event: T): number;
70
- }
71
7
  /**
72
8
  * protolint:disable ENUM_FIELD_NAMES_PREFIX
73
9
  *
@@ -2599,7 +2535,7 @@ interface IVSPlayerLiveLatencyEntry extends EventEntryBase {
2599
2535
  metaData: IVSPlayerLiveLatencyData;
2600
2536
  }
2601
2537
  type EventEntry = CallJoinBeginEntry | NetworkQualityTestBeginEntry | NetworkQualityTestEndEntry | BrowserForegroundedEntry | PingStatsEntry | PreCallTestBeginEntry | PreCallTestCompletedEntry | WebSocketConnectedEntry | TransportConnectedEntry | AudioToggleEntry | VideoToggleEntry | ScreenShareToggleEntry | DisconnectEntry | ReconnectEntry | ParticipantRoleToggleEntry | DominantSpeakerEntry | DevicesEntry | SelectedDeviceEntry | MediaPermissionEntry | MediaPlaybackFailureEntry | MediaTrackFailureEntry | ScreenShareRequestedEntry | ExpectedVideoResolutionEntry | ExpectedScreenshareResolutionEntry | TabChangeEntry | BrowserBackgroundedEntry | LegacySwitchEntry | IVSPlayerRebufferingEntry | IVSPlayerAudioBlockedEntry | IVSPlayerPlaybackBlockedEntry | IVSPlayerNetworkUnavailableEntry | IVSPlayerInitializedEntry | IVSPlayerErrorEntry | IVSPlayerRecoverableErrorEntry | IVSPlayerAnalyticsEventEntry | IVSPlayerLiveLatencyEntry | IVSPlayerPlaybackRateChangedEntry | IVSPlayerQualityChangedEntry | IVSPlayerWorkerErrorEntry;
2602
- declare class EventHandler extends EventEmitter$1 {
2538
+ declare class EventHandler extends EventEmitter {
2603
2539
  constructor({ logger, peerId, apiHostnames, }: {
2604
2540
  logger: RTKLogger$2;
2605
2541
  peerId: string;
@@ -2629,8 +2565,8 @@ declare class ParsedRTCStats {
2629
2565
  staleProducerStreamMap: boolean;
2630
2566
  staleConsumerStreamMap: boolean;
2631
2567
  }
2632
- declare abstract class Measurements extends EventEmitter$1 {
2633
- observer: EventEmitter$1;
2568
+ declare abstract class Measurements extends EventEmitter {
2569
+ observer: EventEmitter;
2634
2570
  outboundProducerMap: Map<string, string>;
2635
2571
  inboundConsumerMap: Map<string, string>;
2636
2572
  consumerPeerIdMap: Map<string, {
@@ -2721,8 +2657,8 @@ declare abstract class Measurements extends EventEmitter$1 {
2721
2657
  getNetworkQuality(iceServers: IceServerInfo[]): Promise<NetworkQualityInformation>;
2722
2658
  getNetworkInfo(iceServers: IceServerInfo[], skipConnectivityChecks?: boolean): Promise<NetworkInformation | NetworkInformationWithoutConnectivityData>;
2723
2659
  }
2724
- declare class CallStats extends EventEmitter$1 {
2725
- observer: EventEmitter$1;
2660
+ declare class CallStats extends EventEmitter {
2661
+ observer: EventEmitter;
2726
2662
  eventHandler: EventHandler;
2727
2663
  producers: Map<string, any>;
2728
2664
  logger: RTKLogger$2;
@@ -2791,7 +2727,7 @@ declare class CallStats extends EventEmitter$1 {
2791
2727
  expectedVideoResolution(frameWidth: number, frameHeight: number, timestamp: Date): void;
2792
2728
  expectedScreenshareResolution(frameWidth: number, frameHeight: number, timestamp: Date): void;
2793
2729
  }
2794
- declare class InhouseCallStats extends EventEmitter$1 {
2730
+ declare class InhouseCallStats extends EventEmitter {
2795
2731
  stats: any;
2796
2732
  peerId: string;
2797
2733
  backend: CallStats;
@@ -2845,164 +2781,140 @@ declare class InhouseCallStats extends EventEmitter$1 {
2845
2781
  expectedVideoResolution(frameWidth: number, frameHeight: number): void;
2846
2782
  expectedScreenshareResolution(frameWidth: number, frameHeight: number): void;
2847
2783
  }
2848
- interface RTKBasicParticipant {
2849
- userId: string;
2850
- name?: string;
2851
- picture?: string;
2852
- customParticipantId: string;
2853
- }
2854
- declare class RTKBasicParticipantsMap extends RTKEventEmitter<'participantsUpdate'> {
2855
- constructor();
2856
- __set(objId: string, obj: RTKBasicParticipant): Map<string, RTKBasicParticipant>;
2857
- __clear(): void;
2858
- get(objId: string): RTKBasicParticipant;
2859
- toArray(): RTKBasicParticipant[];
2860
- }
2861
- type ChatChannelSocketMessage = GetChatChannelResponse;
2862
- interface ChatChannel {
2863
- id: string;
2864
- displayName: string;
2865
- memberIds: string[];
2866
- displayPictureUrl?: string;
2867
- visibility?: string;
2868
- isDirectMessage?: boolean;
2869
- latestMessage?: Message;
2870
- unreadCount: number;
2871
- }
2872
- interface UpdateChannelRequestPayload {
2873
- memberIds?: string[];
2874
- displayName?: string;
2875
- displayPictureUrl?: string;
2876
- visibility?: string;
2877
- }
2878
- declare class ChatChannelSocketHandler {
2879
- constructor(socketService: SocketService);
2880
- createChannel(displayName: string, memberIds: string[], displayPictureUrl?: string, visibility?: string, isDirectMessage?: boolean): Promise<ChatChannel>;
2881
- updateChannel(channelId: string, payload: UpdateChannelRequestPayload): Promise<ChatChannel>;
2882
- static formatChannel(socketChannel: ChatChannel$1): ChatChannel;
2883
- getChannelMembers(channelId: string): Promise<RTKBasicParticipant[]>;
2884
- on(event: number, handler: (socketMessage: ChatChannelSocketMessage) => void): void;
2784
+ declare global {
2785
+ interface SymbolConstructor {
2786
+ readonly observable: symbol;
2787
+ }
2885
2788
  }
2886
- declare enum ChatMessageType {
2887
- TEXT = 0,
2888
- IMAGE = 1,
2889
- FILE = 2,
2890
- CUSTOM = 3
2789
+ /**
2790
+ Get keys of the given type as strings.
2791
+
2792
+ Number keys are converted to strings.
2793
+
2794
+ Use-cases:
2795
+ - Get string keys from a type which may have number keys.
2796
+ - Makes it possible to index using strings retrieved from template types.
2797
+
2798
+ @example
2799
+ ```
2800
+ import type {StringKeyOf} from 'type-fest';
2801
+
2802
+ type Foo = {
2803
+ 1: number,
2804
+ stringKey: string,
2805
+ };
2806
+
2807
+ type StringKeysOfFoo = StringKeyOf<Foo>;
2808
+ //=> '1' | 'stringKey'
2809
+ ```
2810
+
2811
+ @category Object
2812
+ */
2813
+ type StringKeyOf<BaseType> = string;
2814
+ declare class RTKEventEmitter<T extends string | symbol> extends EventEmitter$1 {
2815
+ logger: RTKLogger$1 | undefined;
2816
+ constructor(logger: RTKLogger$1);
2817
+ emit(event: T, ...args: any[]): boolean;
2818
+ on(event: T, callback: (...args: any[]) => void): this;
2819
+ addListener(event: T, callback: (...args: any[]) => any): this;
2820
+ off(event: T, callback: (...args: any[]) => any): this;
2821
+ once(event: T, callback: (...args: any[]) => any): this;
2822
+ prependListener(event: T, callback: (...args: any[]) => any): this;
2823
+ prependOnceListener(event: T, callback: (...args: any[]) => any): this;
2824
+ removeListener(event: T, callback: (...args: any[]) => any): this;
2825
+ removeAllListeners(event?: T): this;
2826
+ listeners(event: T): Function[];
2827
+ listenerCount(event: T): number;
2891
2828
  }
2892
- type ChatSocketMessage = SendChatMessageToRoomResponse | SendChatMessageToPeersResponse | EditChatMessageResponse | DeleteChatMessageResponse;
2893
- interface SearchFilters {
2894
- channelId?: string;
2895
- timestamp?: number;
2896
- size?: number;
2897
- reversed?: boolean;
2829
+ type EventMap$1 = {
2830
+ [key: string]: (...args: any[]) => void;
2831
+ };
2832
+ type WildCardEvent<T> = {
2833
+ ['*']: (event: StringKeyOf<T>, ...args: any) => void;
2834
+ };
2835
+ declare class RTKTypedEventEmitter<Events extends EventMap$1 & WildCardEvent<Events>> extends EventEmitter$1 {
2836
+ logger: RTKLogger$1 | undefined;
2837
+ constructor(logger: RTKLogger$1);
2838
+ emit<E extends StringKeyOf<Events>>(event: E, ...args: Parameters<Events[E]>): boolean;
2839
+ on<E extends StringKeyOf<Events>>(event: E, callback: Events[E]): this;
2840
+ addListener<E extends StringKeyOf<Events>>(event: E, callback: Events[E]): this;
2841
+ off<T extends StringKeyOf<Events>>(event: T, callback: Events[T]): this;
2842
+ once<T extends StringKeyOf<Events>>(event: T, callback: Events[T]): this;
2843
+ prependListener<T extends StringKeyOf<Events>>(event: T, callback: Events[T]): this;
2844
+ prependOnceListener<T extends StringKeyOf<Events>>(event: T, callback: Events[T]): this;
2845
+ removeListener<T extends StringKeyOf<Events>>(event: T, callback: Events[T]): this;
2846
+ removeAllListeners<T extends StringKeyOf<Events>>(event?: T): this;
2847
+ listeners<T extends StringKeyOf<Events>>(event: T): Function[];
2848
+ listenerCount<T extends StringKeyOf<Events>>(event: T): number;
2898
2849
  }
2899
- declare class ChatSocketHandler {
2850
+ type StageSocketMessage = GetStageRequestsResponse | GetStagePeersResponse | DenyStageAccessRequest | PeerStatusUpdate;
2851
+ declare class StageSocketHandler {
2900
2852
  constructor(socketService: SocketService);
2901
- getChatMessages(): Promise<{
2853
+ getStageRequests(): Promise<GetStageRequestsResponse>;
2854
+ requestAccess(): void;
2855
+ cancelRequestAccess(): void;
2856
+ grantAccess(userIds: string[]): Promise<void>;
2857
+ denyAccess(userIds: string[]): Promise<void>;
2858
+ joinStage(): Promise<{
2902
2859
  id: string;
2903
2860
  payload: Uint8Array;
2904
2861
  }>;
2905
- getChatMessagesPaginated(timeStamp: number, size: number, reversed: boolean, offset?: number, channelId?: string): Promise<GetPaginatedChatMessageRoomResponse>;
2906
- sendMessageToRoom(message: string, messageType: ChatMessageType): void;
2907
- sendMessageToPeers(message: string, messageType: ChatMessageType, peerIds: string[]): void;
2908
- sendMessageToChannel(message: string, messageType: ChatMessageType, channelId: string): void;
2909
- sendMessage(message: string, messageType: ChatMessageType, peerIds?: string[], channelId?: string): void;
2910
- editMessage(chatId: string, message: string, payloadType: ChatMessageType, channelId?: string, pinned?: boolean): Promise<ChatMessage>;
2911
- deleteMessage(chatId: string, channelId?: string): Promise<{
2912
- channelId?: string;
2862
+ leaveStage(userId: string): Promise<{
2863
+ id: string;
2864
+ payload: Uint8Array;
2865
+ }>;
2866
+ kick(userIds: string[]): Promise<{
2913
2867
  id: string;
2868
+ payload: Uint8Array;
2914
2869
  }>;
2915
- searchMessages(query: string, filters: SearchFilters): Promise<ChatMessage[]>;
2916
- getAllChannels(): Promise<ChatChannel[]>;
2917
- markLastReadMessage(channelId: string, message: Message): Promise<string>;
2918
- setPinState(message: Message, pin: boolean): Promise<PinChatMessageResponse>;
2919
- on(event: number, handler: (socketMessage: ChatSocketMessage) => void): void;
2870
+ on(event: number, handler: (socketMessage: StageSocketMessage, messageId?: string) => void): void;
2871
+ getPeerInfo(peerId: string): Promise<PeerInfoResponse>;
2920
2872
  }
2921
- declare class RTKSelectedPeers {
2922
- constructor();
2923
- add(peerId: string, priority: number): number;
2924
- delete(peerId: string): void;
2925
- index(peerId: string): number;
2926
- readonly peers: string[];
2927
- readonly compulsoryPeers: string[];
2928
- readonly activeSpeakerPeers: string[];
2873
+ type StageStatus = 'OFF_STAGE' | 'REQUESTED_TO_JOIN_STAGE' | 'ACCEPTED_TO_JOIN_STAGE' | 'ON_STAGE';
2874
+ interface StageRequestPayload {
2875
+ displayName: string;
2876
+ userId: string;
2877
+ peerId: string;
2929
2878
  }
2930
- type PipEvents = {
2931
- ['cameraToggled']: () => void;
2932
- ['micToggled']: () => void;
2933
- ['hangup']: () => void;
2934
- ['pipStarted']: () => void;
2935
- ['pipEnded']: () => void;
2879
+ type StageEvents = {
2880
+ ['stageAccessRequestUpdate']: (requests?: StageRequestPayload[]) => void;
2881
+ ['stageStatusUpdate']: (status: StageStatus) => void;
2882
+ ['newStageRequest']: (payload: {
2883
+ count: number;
2884
+ }) => void;
2885
+ ['stageRequestApproved']: () => void;
2886
+ ['stageRequestRejected']: () => void;
2936
2887
  ['*']: (eventName: string, ...args: any[]) => void;
2937
2888
  };
2938
- declare class RTKPip extends RTKTypedEventEmitter<PipEvents> {
2939
- private constructor();
2940
- static _init(context: Context<RTKContextState>, self: RTKSelf$1): Promise<RTKPip>;
2941
- overrideIcon(icon: 'handRaise' | 'pin', value: string): Promise<void>;
2942
- isSupported(): boolean;
2943
- readonly isActive: boolean;
2944
- init({ height, width }?: {
2945
- height?: number;
2946
- width?: number;
2947
- }): void;
2948
- enableSource(source: string): void;
2949
- disableSource(source: string): void;
2950
- addSource(id: string, element: HTMLVideoElement, enabled: boolean, pinned?: boolean, displayText?: string, imageUrl?: string, handRaised?: boolean): void;
2951
- updateSource(id: string, source: any): void;
2952
- removeSource(id: string): void;
2953
- removePinnedSource(): void;
2954
- removeAllSources(): void;
2955
- enable(): void;
2956
- disable: (partial?: boolean) => void;
2957
- }
2958
- type EventHandlerTypes = PeerInfoResponse | GetWaitingRoomRequests | RecordingEvent | UpdatePeersPresetResponse | PeerJoinBroadcastResponse | PeerJoinCompleteResponse | GlobalPeerPinningBroadcastResponse | PeerLeaveResponse | SelectedPeersResponse | SelectedPeersDiffResponse;
2959
- declare class RoomSocketHandler {
2960
- socket: SocketService;
2961
- cleanup(): Promise<void>;
2962
- constructor(context: Context<RTKContextState>, socketService: SocketService);
2963
- joinRoom(opts: {
2964
- name: string;
2889
+ declare class RTKStage extends RTKTypedEventEmitter<StageEvents> {
2890
+ readonly telemetry: RTKTelemetry;
2891
+ constructor(context: Context<RTKContextState>, self: RTKSelf$1, participants: RTKParticipants, stageSocketHandler: StageSocketHandler, roomSocketHandler: RoomSocketHandler);
2892
+ readonly status: StageStatus;
2893
+ getAccessRequests(): {
2894
+ stageRequests: StageRequestPayload[];
2895
+ };
2896
+ requestAccess(): Promise<void>;
2897
+ cancelRequestAccess(): Promise<void>;
2898
+ grantAccess(userIds: string[]): Promise<void>;
2899
+ denyAccess(userIds: string[]): Promise<void>;
2900
+ join(): Promise<void>;
2901
+ leave(): Promise<void>;
2902
+ kick(userIds: string[]): Promise<{
2965
2903
  id: string;
2966
- userId: string;
2967
- customParticipantId: string;
2968
- picture?: string;
2969
- }): Promise<{
2970
- peer: Peer;
2904
+ payload: Uint8Array;
2971
2905
  }>;
2972
- getAllAddedParticipants(): Promise<RTKBasicParticipant[]>;
2973
- getRoomPeers(searchQuery: string, limit: number, offset: number): Promise<RoomPeersInfoResponse>;
2974
- getRoomPeersNonPaginated(): Promise<RoomPeersInfoResponse>;
2975
- getStagePeers(): Promise<RoomPeersInfoResponse>;
2976
- getPeerInfo(peerId: string): Promise<PeerInfoResponse>;
2977
- getRoomState(): Promise<RoomInfoResponse>;
2978
- getRoomStageState(): Promise<GetRoomStageStateResponse>;
2979
- broadcastMessage(type: string, payload: BroadcastMessagePayload): Promise<{
2980
- id: string;
2981
- payload: Uint8Array;
2982
- }>;
2983
- broadcastToMeetings(type: string, meetingIds: string[], payload: BroadcastMessagePayload): Promise<{
2984
- id: string;
2985
- payload: Uint8Array;
2986
- }>;
2987
- broadcastToPeers(type: string, peerIds: string[], payload: BroadcastMessagePayload): Promise<boolean>;
2988
- leaveRoom(): Promise<void>;
2989
- kick(peerId: string): Promise<void>;
2990
- kickAll(propagateKickAll?: boolean): Promise<void>;
2991
- getWaitingRoomRequests(): void;
2992
- acceptWaitingRoomRequest(userIds: string[]): void;
2993
- rejectWaitingRoomRequest(userIds: string[]): void;
2994
- updatePermissions(userIds: string[], patch: PresetUpdates): Promise<{
2995
- id: string;
2996
- payload: Uint8Array;
2997
- }>;
2998
- on(event: number, handler: (message: EventHandlerTypes) => void): void;
2999
- getUserPermissions(userId: string): Promise<Pick<PresetTypeV2['permissions'], 'chat' | 'polls' | 'plugins'>>;
3000
2906
  }
3001
- declare class EnhancedEventEmitter<TransportPromiseEvents> extends EventEmitter {
3002
- constructor();
3003
- safeEmit(event: string, ...args: any[]): boolean;
3004
- safeEmitAsPromise<T extends keyof TransportPromiseEvents>(event: T, ...args: any[]): Promise<TransportPromiseEvents[T]>;
3005
- safeEmitAsPromiseWithTimeout<T extends keyof TransportPromiseEvents>(event: T, timeout: number, ...args: any[]): Promise<TransportPromiseEvents[T]>;
2907
+ interface ResponseStatus {
2908
+ success: boolean;
2909
+ message: string;
2910
+ }
2911
+ type MediaPermission$1 = 'NOT_REQUESTED' | 'ACCEPTED' | 'DENIED' | 'SYSTEM_DENIED' | 'COULD_NOT_START' | 'NO_DEVICES_AVAILABLE' | 'CANCELED';
2912
+ declare class EnhancedEventEmitter<TransportPromiseEvents> extends EventEmitter$1 {
2913
+ readonly logger: RTKLogger$1;
2914
+ constructor(context: Context<RTKContextState>);
2915
+ safeEmit(event: string, ...args: any[]): boolean;
2916
+ safeEmitAsPromise<T extends keyof TransportPromiseEvents>(event: T, ...args: any[]): Promise<TransportPromiseEvents[T]>;
2917
+ safeEmitAsPromiseWithTimeout<T extends keyof TransportPromiseEvents>(event: T, timeout: number, ...args: any[]): Promise<TransportPromiseEvents[T]>;
3006
2918
  }
3007
2919
  declare enum TransportState {
3008
2920
  NEW = "new",
@@ -3106,25 +3018,25 @@ type ConsumerOptions = {
3106
3018
  closeTranscieverOnClose?: boolean;
3107
3019
  };
3108
3020
  type MediaKind = 'audio' | 'video';
3109
- declare class Consumer extends EnhancedEventEmitter<TransportPromiseEvents> {
3110
- readonly rtpReceiver: RTCRtpReceiver;
3111
- readonly id: string;
3112
- readonly localId: string;
3113
- readonly producerId: string;
3114
- readonly producingTransportId: string;
3115
- readonly mimeType: string;
3116
- readonly track: MediaStreamTrack;
3117
- readonly peerId: string;
3118
- readonly appData: Record<string, unknown>;
3119
- readonly transceiver: RTCRtpTransceiver;
3120
- constructor(opts: ConsumerOptions);
3121
- readonly closed: boolean;
3122
- readonly kind: MediaKind;
3123
- readonly paused: boolean;
3124
- close(reason?: string, closeTranscieverOnClose?: boolean): void;
3125
- getStats(): Promise<RTCStatsReport>;
3126
- pause(): void;
3127
- resume(): void;
3021
+ declare class Consumer extends EnhancedEventEmitter<TransportPromiseEvents> {
3022
+ readonly rtpReceiver: RTCRtpReceiver;
3023
+ readonly id: string;
3024
+ readonly localId: string;
3025
+ readonly producerId: string;
3026
+ readonly producingTransportId: string;
3027
+ readonly mimeType: string;
3028
+ readonly track: MediaStreamTrack;
3029
+ readonly peerId: string;
3030
+ readonly appData: Record<string, unknown>;
3031
+ readonly transceiver: RTCRtpTransceiver;
3032
+ constructor(context: Context<RTKContextState>, opts: ConsumerOptions);
3033
+ readonly closed: boolean;
3034
+ readonly kind: MediaKind;
3035
+ readonly paused: boolean;
3036
+ close(reason?: string, closeTranscieverOnClose?: boolean): void;
3037
+ getStats(): Promise<RTCStatsReport>;
3038
+ pause(): void;
3039
+ resume(): void;
3128
3040
  }
3129
3041
  declare const localMediaEvents: readonly [
3130
3042
  "AUDIO_TRACK_CHANGE",
@@ -3226,1589 +3138,1492 @@ type SelfEvents = {
3226
3138
  ['autoplayError']: (error: Error) => void;
3227
3139
  ['*']: (event: string, ...args: any[]) => void;
3228
3140
  };
3229
- interface DeviceConfig {
3230
- browserName: string;
3231
- browserVersion: string;
3232
- isMobile: boolean;
3233
- engineName: string;
3234
- osName: string;
3235
- }
3236
- interface ProducerState {
3237
- producerId: string;
3238
- kind: 'audio' | 'video';
3239
- pause: boolean;
3240
- screenShare: boolean;
3241
- producingTransportId: string;
3242
- producingPeerId: string;
3243
- mimeType?: string;
3244
- }
3245
- interface Participant {
3246
- id: string;
3247
- userId: string;
3248
- displayName: string;
3249
- device?: DeviceConfig;
3250
- picture?: string;
3251
- isHost: boolean;
3252
- flags: {
3253
- [key: string]: string | boolean;
3254
- };
3255
- clientSpecificId?: string;
3256
- customParticipantId?: string;
3257
- stageStatus?: StageStatus;
3258
- audioMuted: boolean;
3259
- audioTrack: MediaStreamTrack;
3260
- videoTrack: MediaStreamTrack;
3261
- videoEnabled: boolean;
3262
- producers?: ProducerState[];
3263
- metadata?: {
3264
- preset_name?: string;
3265
- };
3266
- recorderType?: string;
3267
- }
3268
- declare class RTKParticipant$1 extends RTKTypedEventEmitter<ParticipantEvents> {
3269
- id: string;
3270
- userId: string;
3271
- name: string;
3272
- picture: string;
3273
- isHost: boolean;
3274
- customParticipantId?: string;
3275
- readonly clientSpecificId: string;
3276
- flags: {
3277
- [key: string]: string | boolean;
3141
+ declare class LocalMediaHandler extends RTKEventEmitter<LocalMediaEvents> {
3142
+ readonly telemetry: RTKTelemetry;
3143
+ audioUpdateInProgress: boolean;
3144
+ videoUpdateInProgress: boolean;
3145
+ constructor(context: Context<RTKContextState>, mediaConstraints: MediaConstraints, isNonPreferredDevice?: (media: MediaDeviceInfo) => boolean, autoSwitchDevice?: boolean);
3146
+ context: Context<RTKContextState>;
3147
+ repopulateAvailableDevices(): Promise<boolean>;
3148
+ setupStreams({ audio, video, }: {
3149
+ audio: boolean;
3150
+ video: boolean;
3151
+ }): Promise<void>;
3152
+ getCurrentDevices(): {
3153
+ audio: MediaDeviceInfo;
3154
+ video: MediaDeviceInfo;
3155
+ speaker: MediaDeviceInfo;
3278
3156
  };
3279
- device: DeviceConfig;
3280
- videoTrack: MediaStreamTrack;
3281
- audioTrack: MediaStreamTrack;
3282
- screenShareTracks: {
3157
+ readonly permissions: {
3158
+ audio?: MediaPermission$1;
3159
+ video?: MediaPermission$1;
3160
+ screenshare?: MediaPermission$1;
3161
+ };
3162
+ getAllDevices(): Promise<InputDeviceInfo[]>;
3163
+ getDeviceById(deviceId: string, kind?: 'audioinput' | 'audiooutput' | 'videoinput'): Promise<MediaDeviceInfo>;
3164
+ readonly rawAudioTrack: MediaStreamTrack;
3165
+ readonly audioTrack: MediaStreamTrack;
3166
+ readonly audioEnabled: boolean;
3167
+ enableAudio(customTrack?: MediaStreamTrack): Promise<void>;
3168
+ disableAudio(): void;
3169
+ getAudioDevices(devices?: MediaDeviceInfo[]): Promise<MediaDeviceInfo[]>;
3170
+ setAudioDevice(device: MediaDeviceInfo): Promise<void>;
3171
+ setupSpeaker(): Promise<void>;
3172
+ setSpeakerDevice(device: MediaDeviceInfo): Promise<void>;
3173
+ readonly rawVideoTrack: MediaStreamTrack;
3174
+ readonly videoTrack: MediaStreamTrack;
3175
+ readonly videoEnabled: boolean;
3176
+ enableVideo(customTrack?: MediaStreamTrack): Promise<void>;
3177
+ disableVideo(): void;
3178
+ getVideoDevices(devices?: MediaDeviceInfo[]): Promise<MediaDeviceInfo[]>;
3179
+ setVideoDevice(device: MediaDeviceInfo): Promise<void>;
3180
+ updateVideoConstraints(resolution: VideoQualityConstraints): Promise<void>;
3181
+ readonly screenShareTracks: {
3283
3182
  audio: MediaStreamTrack;
3284
3183
  video: MediaStreamTrack;
3285
3184
  };
3286
- videoEnabled: boolean;
3287
- audioEnabled: boolean;
3288
- screenShareEnabled: boolean;
3289
- producers: ProducerState[];
3290
- manualProducerConfig: PeerProducerConfig;
3291
- supportsRemoteControl: boolean;
3292
- presetName?: string;
3293
- readonly stageStatus: StageStatus;
3294
- constructor(context: Context<RTKContextState>, participant: Participant, self: RTKSelf, roomSocket: RoomSocketHandler);
3295
- setVideoEnabled(videoEnabled: boolean, emitEvent?: boolean): void;
3296
- setAudioEnabled(audioEnabled: boolean, emitEvent?: boolean): void;
3297
- setScreenShareEnabled(screenShareEnabled: boolean, emitEvent?: boolean): void;
3298
- pin(): Promise<void>;
3299
- unpin(): Promise<void>;
3300
- setIsPinned(isPinned: boolean, emitEvent?: boolean): void;
3301
- disableAudio(): Promise<void>;
3302
- kick(): Promise<void>;
3303
- disableVideo(): Promise<void>;
3304
- getPermissions(): Promise<Pick<_dyteinternals_utils.Permissions, "plugins" | "polls" | "chat">>;
3305
- setStageStatus(stageStatus: StageStatus): void;
3306
- readonly isPinned: boolean;
3307
- registerVideoElement(videoElem: HTMLVideoElement): void;
3308
- deregisterVideoElement(videoElem?: HTMLVideoElement): void;
3185
+ readonly screenShareEnabled: boolean;
3186
+ enableScreenShare(): Promise<void>;
3187
+ disableScreenShare(): Promise<void>;
3188
+ updateScreenshareConstraints(resolution: VideoQualityConstraints): Promise<void>;
3189
+ getSpeakerDevices(devices?: MediaDeviceInfo[]): Promise<MediaDeviceInfo[]>;
3190
+ addAudioMiddleware(audioMiddleware: AudioMiddleware): Promise<ResponseStatus>;
3191
+ removeAudioMiddleware(audioMiddleware: AudioMiddleware): Promise<ResponseStatus>;
3192
+ removeAllAudioMiddlewares(): Promise<ResponseStatus>;
3193
+ addVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<ResponseStatus>;
3194
+ removeVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<ResponseStatus>;
3195
+ removeAllVideoMiddlewares(): Promise<ResponseStatus>;
3196
+ setVideoMiddlewareGlobalConfig(config: VideoMiddlewareGlobalConfig): Promise<void>;
3197
+ destruct(): void;
3198
+ onDeviceChange(changedDevices: {
3199
+ added: MediaDeviceInfo[];
3200
+ removed: MediaDeviceInfo[];
3201
+ devices: MediaDeviceInfo[];
3202
+ }, skipDeviceChange: boolean): Promise<void>;
3203
+ removeAllTracks(): void;
3204
+ removeAudioTrack(): void;
3205
+ removeVideoTrack(): void;
3206
+ removeDocumentEventListeners(): Promise<void>;
3309
3207
  }
3310
- type TranscriptionData = {
3311
- id: string;
3312
- name: string;
3313
- peerId: string;
3314
- userId: string;
3315
- customParticipantId: string;
3316
- transcript: string;
3317
- isPartialTranscript: boolean;
3318
- date: Date;
3208
+ declare enum MediaPermission {
3209
+ NOT_REQUESTED = 0,
3210
+ ACCEPTED = 1,
3211
+ DENIED = 2,
3212
+ CANCELED = 3,
3213
+ SYSTEM_DENIED = 4,
3214
+ COULD_NOT_START = 5,
3215
+ NO_DEVICES_AVAILABLE = 6
3216
+ }
3217
+ type AudioMiddleware = (audioContext: AudioContext) => Promise<ScriptProcessorNode | AudioWorkletNode>;
3218
+ type VideoMiddleware = (() => Promise<(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D) => Promise<void>>) | ((helpers: {
3219
+ canvas: HTMLCanvasElement;
3220
+ WorkerTimers: typeof WorkerTimers;
3221
+ }) => Promise<void>);
3222
+ type VideoMiddlewareGlobalConfig = {
3223
+ disablePerFrameCanvasRendering: boolean;
3319
3224
  };
3320
- type AiEvents = {
3321
- ['transcript']: (t: TranscriptionData) => void;
3322
- ['*']: (event: string, ...args: any[]) => void;
3225
+ type PresetMediaConstraints = PresetV2CamelCased['config']['media'];
3226
+ type AudioQualityConstraints = {
3227
+ echoCancellation?: boolean;
3228
+ noiseSupression?: boolean;
3229
+ autoGainControl?: boolean;
3230
+ enableStereo?: boolean;
3231
+ enableHighBitrate?: boolean;
3323
3232
  };
3324
- declare class RTKAi extends RTKTypedEventEmitter<AiEvents> {
3325
- transcripts: TranscriptionData[];
3326
- constructor();
3327
- static init(transcriptionEnabled: boolean): Promise<RTKAi>;
3328
- static parseTranscript(transcriptData: string, isPartialTranscript?: boolean): TranscriptionData | undefined;
3329
- static parseTranscripts(transcriptData: string): TranscriptionData[];
3330
- getActiveTranscript(): Promise<void>;
3331
- onTranscript(transcript: TranscriptionData): Promise<void>;
3332
- }
3333
- type ActiveTabType = 'screenshare' | 'plugin';
3334
- interface ActiveTab {
3335
- type: ActiveTabType;
3336
- id: string;
3233
+ type VideoQualityConstraints = {
3234
+ width: {
3235
+ ideal: number;
3236
+ };
3237
+ height: {
3238
+ ideal: number;
3239
+ };
3240
+ frameRate?: {
3241
+ ideal: number;
3242
+ };
3243
+ };
3244
+ type ScreenshareQualityConstraints = {
3245
+ width?: {
3246
+ max: number;
3247
+ };
3248
+ height?: {
3249
+ max: number;
3250
+ };
3251
+ frameRate?: {
3252
+ ideal: number;
3253
+ max: number;
3254
+ };
3255
+ displaySurface?: 'window' | 'monitor' | 'browser';
3256
+ selfBrowserSurface?: 'include' | 'exclude';
3257
+ };
3258
+ interface RTKMediaTrackConstraints extends MediaTrackConstraints {
3259
+ optional?: Array<object>;
3337
3260
  }
3338
- declare enum TabChangeSource {
3339
- User = 0,
3340
- Meeting = 1
3261
+ interface RTKMediaStreamConstraints extends MediaStreamConstraints {
3262
+ audio?: boolean | RTKMediaTrackConstraints;
3341
3263
  }
3342
- interface MediaConnectionUpdate {
3343
- transport: 'consuming' | 'producing';
3344
- state: string;
3345
- reconnected: boolean;
3346
- }
3347
- type MetaEvents = {
3348
- ['mediaConnectionUpdate']: (payload: MediaConnectionUpdate) => void;
3349
- ['socketConnectionUpdate']: (state: SocketConnectionState) => void;
3350
- ['poorConnection']: (payload: {
3351
- score: number;
3352
- }) => void;
3353
- ['meetingStartTimeUpdate']: (payload: {
3354
- meetingStartedTimestamp: Date;
3355
- }) => void;
3356
- ['transcript']: (t: TranscriptionData) => void;
3357
- ['activeTabUpdate']: (tab: ActiveTab) => void;
3358
- ['selfTabUpdate']: (tab: ActiveTab) => void;
3359
- ['broadcastTabChangesUpdate']: (broadcastTabChanges: boolean) => void;
3360
- ['*']: (event: string, ...args: any[]) => void;
3264
+ type MediaConstraints = {
3265
+ audio?: AudioQualityConstraints;
3266
+ video?: MediaVideoQualityType | VideoQualityConstraints;
3267
+ screenshare?: ScreenshareQualityConstraints;
3361
3268
  };
3362
- declare class RTKMeta$1 extends RTKTypedEventEmitter<MetaEvents> {
3363
- selfActiveTab: ActiveTab | undefined;
3364
- readonly socketState: SocketConnectionState;
3365
- readonly mediaState: MediaConnectionState;
3366
- broadcastTabChanges: boolean;
3367
- viewType: string;
3368
- meetingStartedTimestamp: Date;
3369
- meetingTitle: string;
3370
- sessionId: string;
3371
- constructor(context: Context<RTKContextState>, self: RTKSelf, viewType: string, roomSocketHandler: RoomSocketHandler, meetingTitle: string);
3372
- readonly meetingId: string;
3373
- setBroadcastTabChanges(broadcastTabChanges: boolean): void;
3374
- setSelfActiveTab(spotlightTab: ActiveTab, tabChangeSource: TabChangeSource): void;
3375
- }
3376
- interface RTKMapEvents<T extends EventMap$1> {
3377
- onAddEvent?: keyof T;
3378
- onDeleteEvent?: keyof T;
3379
- onClearEvent?: keyof T;
3269
+ type PresetV2CamelCased = {
3270
+ config: {
3271
+ viewType: ViewType;
3272
+ media: {
3273
+ audio: {
3274
+ enableStereo: boolean;
3275
+ enableHighBitrate: boolean;
3276
+ };
3277
+ video: {
3278
+ quality: MediaVideoQualityType;
3279
+ frameRate: number;
3280
+ };
3281
+ screenshare: {
3282
+ quality: MediaScreenShareQualityType;
3283
+ frameRate: number;
3284
+ };
3285
+ };
3286
+ livestreamViewerQualities: LivestreamViewerMediaQualityType[];
3287
+ maxVideoStreams: {
3288
+ mobile: number;
3289
+ desktop: number;
3290
+ };
3291
+ maxScreenshareCount: number;
3292
+ };
3293
+ permissions: {
3294
+ acceptWaitingRequests: boolean;
3295
+ canAcceptProductionRequests: boolean;
3296
+ canEditDisplayName: boolean;
3297
+ canRecord: boolean;
3298
+ canLivestream: boolean;
3299
+ canSpotlight?: boolean;
3300
+ disableParticipantAudio: boolean;
3301
+ disableParticipantScreensharing: boolean;
3302
+ disableParticipantVideo: boolean;
3303
+ kickParticipant: boolean;
3304
+ pinParticipant: boolean;
3305
+ plugins: {
3306
+ canClose: boolean;
3307
+ canStart: boolean;
3308
+ canEditConfig?: boolean;
3309
+ config: {
3310
+ [pluginId: string]: Partial<{
3311
+ accessControl: PluginAccessControls.FULL_ACCESS | PluginAccessControls.VIEW_ONLY;
3312
+ disabled: boolean;
3313
+ handlesViewOnly: boolean;
3314
+ }>;
3315
+ };
3316
+ };
3317
+ waitingRoomType: WaitingRoomTypes;
3318
+ polls: {
3319
+ canCreate: boolean;
3320
+ canVote: boolean;
3321
+ canView: boolean;
3322
+ };
3323
+ media: {
3324
+ video: {
3325
+ canProduce: MediaProductionPermissionType;
3326
+ };
3327
+ audio: {
3328
+ canProduce: MediaProductionPermissionType;
3329
+ };
3330
+ screenshare: {
3331
+ canProduce: MediaProductionPermissionType;
3332
+ };
3333
+ };
3334
+ chat: {
3335
+ public: {
3336
+ canSend: boolean;
3337
+ text: boolean;
3338
+ files: boolean;
3339
+ };
3340
+ private?: {
3341
+ canSend: boolean;
3342
+ canReceive: boolean;
3343
+ text: boolean;
3344
+ files: boolean;
3345
+ };
3346
+ channel?: {
3347
+ canCreate: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
3348
+ canDelete: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
3349
+ canUpdate: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
3350
+ canReadAll: boolean;
3351
+ };
3352
+ message?: {
3353
+ canDelete: 'NONE' | 'SELF' | 'ALL';
3354
+ canEdit: 'NONE' | 'SELF' | 'ALL';
3355
+ deleteCutoffTimeSeconds: number;
3356
+ editCutoffTimeSeconds: number;
3357
+ };
3358
+ };
3359
+ isRecorder?: boolean;
3360
+ recorderType: RecorderType$1;
3361
+ hiddenParticipant: boolean;
3362
+ showParticipantList: boolean;
3363
+ canChangeParticipantPermissions: boolean;
3364
+ connectedMeetings: {
3365
+ canAlterConnectedMeetings: boolean;
3366
+ canSwitchConnectedMeetings: boolean;
3367
+ canSwitchToParentMeeting: boolean;
3368
+ };
3369
+ acceptStageRequests?: boolean;
3370
+ stageEnabled?: boolean;
3371
+ stageAccess?: MediaProductionPermissionType;
3372
+ transcriptionEnabled: boolean;
3373
+ };
3374
+ ui: {
3375
+ designTokens: {
3376
+ borderRadius: BorderRadius;
3377
+ borderWidth: BorderWidth;
3378
+ colors: {
3379
+ brand: {
3380
+ 300: string;
3381
+ 400: string;
3382
+ 500: string;
3383
+ 600: string;
3384
+ 700: string;
3385
+ };
3386
+ background: {
3387
+ 600: string;
3388
+ 700: string;
3389
+ 800: string;
3390
+ 900: string;
3391
+ 1000: string;
3392
+ };
3393
+ danger: string;
3394
+ success: string;
3395
+ textOnBrand: string;
3396
+ text: string;
3397
+ videoBg: string;
3398
+ warning: string;
3399
+ };
3400
+ fontFamily?: string;
3401
+ googleFont?: string;
3402
+ logo?: string;
3403
+ spacingBase: number;
3404
+ theme: Theme;
3405
+ };
3406
+ configDiff: any;
3407
+ };
3408
+ version?: string;
3409
+ id?: string;
3410
+ name?: string;
3411
+ };
3412
+ type MaxVideoStreams = PresetV2CamelCased['config']['maxVideoStreams'];
3413
+ declare class RTKThemePreset$1 {
3414
+ private constructor();
3415
+ static fromResponse(preset: PresetV2CamelCased): RTKThemePreset$1;
3416
+ static default(): RTKThemePreset$1;
3417
+ static init(preset?: PresetV2CamelCased, useDefault?: boolean): RTKThemePreset$1;
3418
+ readonly setupScreen: Readonly<{
3419
+ isEnabled: boolean;
3420
+ }>;
3421
+ readonly waitingRoom: Readonly<{
3422
+ isEnabled: boolean;
3423
+ }>;
3424
+ readonly controlBar: Readonly<{
3425
+ isEnabled: boolean;
3426
+ elements?: {
3427
+ chat?: boolean;
3428
+ fullscreen?: boolean;
3429
+ invite?: boolean;
3430
+ layout?: boolean;
3431
+ participants?: boolean;
3432
+ plugins?: boolean;
3433
+ polls?: boolean;
3434
+ reactions?: boolean;
3435
+ screenshare?: boolean;
3436
+ };
3437
+ }>;
3438
+ readonly header: Readonly<{
3439
+ isEnabled: boolean;
3440
+ elements: {
3441
+ logo: string;
3442
+ timer: boolean;
3443
+ title: boolean;
3444
+ participantCount: boolean;
3445
+ changeLayout: boolean;
3446
+ };
3447
+ }>;
3448
+ readonly pipMode: Readonly<boolean>;
3449
+ readonly viewType: Readonly<ViewType>;
3450
+ readonly livestreamViewerQualities: Readonly<LivestreamViewerMediaQualityType[]>;
3451
+ readonly maxVideoStreams: Readonly<MaxVideoStreams>;
3452
+ readonly maxScreenShareCount: Readonly<number>;
3453
+ readonly plugins: Readonly<string[]>;
3454
+ readonly disabledPlugins: Readonly<string[]>;
3455
+ readonly designTokens: Readonly<PresetV2CamelCased['ui']['designTokens']>;
3456
+ readonly configDiff: Readonly<PresetV2CamelCased['ui']['configDiff']>;
3457
+ readonly mediaConstraints: Readonly<PresetMediaConstraints>;
3458
+ readonly name: string;
3380
3459
  }
3381
- type ModifyPrependObject<T extends EventMap$1, U> = {
3382
- [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3383
- } & {
3384
- ['*']: (event: String, ...args: any[]) => void;
3460
+ type PresetPermissions = PresetV2CamelCased['permissions'];
3461
+ type MediaRoomType = 'HIVE' | 'CF';
3462
+ type PermissionEvents = {
3463
+ ['chatUpdate']: () => void;
3464
+ ['pollsUpdate']: () => void;
3465
+ ['pluginsUpdate']: () => void;
3466
+ ['permissionsUpdate']: (patch: PresetUpdates) => void;
3467
+ ['*']: () => void;
3385
3468
  };
3386
- declare class RTKMap<T extends (EventMap$1 & WildCardEvent<T>), U extends {
3387
- id: string;
3388
- } & RTKTypedEventEmitter<T>, V extends EventMap$1> extends Map<string, U> {
3389
- readonly onAddEvent: keyof V;
3390
- readonly onDeleteEvent: keyof V;
3391
- readonly onClearEvent: keyof V;
3392
- constructor(options: RTKMapEvents<V>);
3393
- emit<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, ...args: Parameters<(V | ModifyPrependObject<T, U>)[E]>): boolean;
3394
- on<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3395
- [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3396
- } & {
3397
- "*": (event: String, ...args: any[]) => void;
3398
- } & V>;
3399
- addListener<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3400
- [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3401
- } & {
3402
- "*": (event: String, ...args: any[]) => void;
3403
- } & V>;
3404
- off<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3405
- [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3406
- } & {
3407
- "*": (event: String, ...args: any[]) => void;
3408
- } & V>;
3409
- once<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3410
- [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3411
- } & {
3412
- "*": (event: String, ...args: any[]) => void;
3413
- } & V>;
3414
- prependListener<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3415
- [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3416
- } & {
3417
- "*": (event: String, ...args: any[]) => void;
3418
- } & V>;
3419
- prependOnceListener<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3420
- [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3421
- } & {
3422
- "*": (event: String, ...args: any[]) => void;
3423
- } & V>;
3424
- removeListener<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3425
- [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3426
- } & {
3427
- "*": (event: String, ...args: any[]) => void;
3428
- } & V>;
3429
- removeAllListeners<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event?: E): RTKTypedEventEmitter<{
3430
- [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3431
- } & {
3432
- "*": (event: String, ...args: any[]) => void;
3433
- } & V>;
3434
- listeners<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E): Function[];
3435
- listenerCount<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E): number;
3436
- getMaxListeners(): number;
3437
- setMaxListeners(n: number): RTKTypedEventEmitter<{
3438
- [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3439
- } & {
3440
- "*": (event: String, ...args: any[]) => void;
3441
- } & V>;
3442
- eventNames(): (string | symbol)[];
3443
- add(obj: U, emitEvent?: boolean): this;
3444
- set(objId: string, obj: U, emitEvent?: boolean): this;
3445
- delete(objId: string, emitEvent?: boolean, removeListeners?: boolean): boolean;
3446
- clear(emitEvent?: boolean, removeListeners?: boolean): void;
3447
- toArray(): U[];
3448
- }
3449
- type ParticipantMapEvents = {
3450
- ['participantJoined']: (payload: RTKParticipant$1) => void;
3451
- ['participantLeft']: (payload: RTKParticipant$1) => void;
3452
- ['participantsCleared']: () => void;
3453
- ['participantsUpdate']: () => void;
3454
- ['kicked']: (payload: {
3455
- id: string;
3456
- }) => void;
3457
- };
3458
- declare class RTKParticipantMap$1<T extends Pick<RTKParticipant$1, 'id' | keyof RTKTypedEventEmitter<ParticipantEvents>> = RTKParticipant$1> extends RTKMap<ParticipantEvents, T, ParticipantMapEvents> {
3459
- constructor(options?: RTKMapEvents<ParticipantMapEvents>);
3460
- add(participant: T, emitEvent?: boolean): this;
3461
- clear(emitEvent?: boolean, removeListeners?: boolean): void;
3462
- delete(participantId: string, emitEvent?: boolean, removeListeners?: boolean): boolean;
3469
+ declare class RTKPermissionsPreset$1 extends RTKTypedEventEmitter<PermissionEvents> {
3470
+ private constructor();
3471
+ static fromResponse(response: PresetPermissions, viewType: ViewType, context: Context<RTKContextState>): RTKPermissionsPreset$1;
3472
+ static default(context: Context<RTKContextState>, viewType: ViewType): RTKPermissionsPreset$1;
3473
+ static init(context: Context<RTKContextState>, viewType: ViewType, response?: PresetPermissions): RTKPermissionsPreset$1;
3474
+ readonly mediaRoomType: Readonly<MediaRoomType>;
3475
+ readonly stageEnabled: Readonly<boolean>;
3476
+ readonly acceptStageRequests: Readonly<boolean>;
3477
+ readonly stageAccess: Readonly<MediaProductionPermissionType>;
3478
+ readonly acceptWaitingRequests: Readonly<boolean>;
3479
+ readonly requestProduceVideo: Readonly<boolean>;
3480
+ readonly requestProduceAudio: Readonly<boolean>;
3481
+ readonly requestProduceScreenshare: Readonly<boolean>;
3482
+ readonly canAllowParticipantAudio: Readonly<boolean>;
3483
+ readonly canAllowParticipantScreensharing: Readonly<boolean>;
3484
+ readonly canAllowParticipantVideo: Readonly<boolean>;
3485
+ readonly canDisableParticipantAudio: Readonly<boolean>;
3486
+ readonly canDisableParticipantVideo: Readonly<boolean>;
3487
+ readonly kickParticipant: Readonly<boolean>;
3488
+ readonly pinParticipant: Readonly<boolean>;
3489
+ readonly canRecord: Readonly<boolean>;
3490
+ readonly waitingRoomType: Readonly<WaitingRoomTypes>;
3491
+ readonly waitingRoomBehaviour: Readonly<WaitingRoomTypes>;
3492
+ readonly plugins: Readonly<PresetPermissions['plugins']>;
3493
+ readonly polls: Readonly<PresetPermissions['polls']>;
3494
+ readonly produceVideo: Readonly<MediaProductionPermissionType>;
3495
+ readonly requestProduce: Readonly<boolean>;
3496
+ readonly canProduceVideo: Readonly<MediaProductionPermissionType>;
3497
+ readonly produceScreenshare: Readonly<MediaProductionPermissionType>;
3498
+ readonly canProduceScreenshare: Readonly<MediaProductionPermissionType>;
3499
+ readonly produceAudio: Readonly<MediaProductionPermissionType>;
3500
+ readonly canProduceAudio: Readonly<MediaProductionPermissionType>;
3501
+ readonly chatPublic: Readonly<PresetPermissions['chat']['public']>;
3502
+ readonly chatPrivate: Readonly<PresetPermissions['chat']['private']>;
3503
+ readonly chatChannel: Readonly<PresetPermissions['chat']['channel']>;
3504
+ readonly chatMessage: Readonly<PresetPermissions['chat']['message']>;
3505
+ readonly connectedMeetings: Readonly<PresetPermissions['connectedMeetings']>;
3506
+ readonly hiddenParticipant: Readonly<boolean>;
3507
+ readonly showParticipantList: Readonly<boolean>;
3508
+ readonly canChangeParticipantRole: Readonly<boolean>;
3509
+ readonly canChangeParticipantPermissions: Readonly<boolean>;
3510
+ readonly canChangeTheme: Readonly<boolean>;
3511
+ readonly canPresent: Readonly<boolean>;
3512
+ readonly acceptPresentRequests: Readonly<boolean>;
3513
+ readonly canEditDisplayName: Readonly<boolean>;
3514
+ readonly maxScreenShareCount: Readonly<number>;
3515
+ readonly isRecorder: Readonly<boolean>;
3516
+ readonly canSpotlight: Readonly<boolean>;
3517
+ readonly canLivestream: Readonly<boolean>;
3518
+ readonly transcriptionEnabled: Readonly<boolean>;
3463
3519
  }
3464
- declare const modes: readonly [
3465
- "ACTIVE_GRID",
3466
- "PAGINATED",
3467
- "MANUAL"
3468
- ];
3469
- type ViewMode = (typeof modes)[number];
3470
- interface BroadcastMessagePayload {
3471
- [key: string]: boolean | number | string | Date | ActiveTab;
3520
+ interface UserDetailsResponseV2 {
3521
+ participant: UserDetailsResponse;
3522
+ preset: PresetV2CamelCased;
3472
3523
  }
3473
- interface PeerProducerConfig {
3474
- audio: boolean;
3475
- video: boolean;
3476
- screenshareAudio: boolean;
3477
- screenshareVideo: boolean;
3524
+ type LeaveRoomState = 'kicked' | 'ended' | 'left' | 'rejected' | 'connected-meeting' | 'disconnected' | 'failed' | 'stageLeft';
3525
+ declare class RTKSelfMedia$1 extends RTKTypedEventEmitter<SelfEvents> {
3526
+ readonly peerId: string;
3527
+ init(options?: {
3528
+ video?: boolean;
3529
+ audio?: boolean;
3530
+ constraints?: MediaConstraints;
3531
+ }, skipAwaits?: boolean, context?: Context<RTKContextState>): Promise<void>;
3532
+ context: Context<RTKContextState>;
3533
+ readonly audioTrack: MediaStreamTrack;
3534
+ readonly rawAudioTrack: MediaStreamTrack;
3535
+ readonly mediaPermissions: {
3536
+ audio?: MediaPermission$1;
3537
+ video?: MediaPermission$1;
3538
+ screenshare?: MediaPermission$1;
3539
+ };
3540
+ addAudioMiddleware(audioMiddleware: AudioMiddleware): Promise<{
3541
+ success: boolean;
3542
+ message: string;
3543
+ }>;
3544
+ removeAudioMiddleware(audioMiddleware: AudioMiddleware): Promise<{
3545
+ success: boolean;
3546
+ message: string;
3547
+ }>;
3548
+ removeAllAudioMiddlewares(): Promise<{
3549
+ success: boolean;
3550
+ message: string;
3551
+ }>;
3552
+ readonly videoTrack: MediaStreamTrack;
3553
+ readonly rawVideoTrack: MediaStreamTrack;
3554
+ addVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<{
3555
+ success: boolean;
3556
+ message: string;
3557
+ }>;
3558
+ setVideoMiddlewareGlobalConfig(config?: VideoMiddlewareGlobalConfig): Promise<void>;
3559
+ removeVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<{
3560
+ success: boolean;
3561
+ message: string;
3562
+ }>;
3563
+ removeAllVideoMiddlewares(): Promise<{
3564
+ success: boolean;
3565
+ message: string;
3566
+ }>;
3567
+ readonly screenShareTracks: {
3568
+ audio: MediaStreamTrack;
3569
+ video: MediaStreamTrack;
3570
+ };
3571
+ readonly audioEnabled: boolean;
3572
+ readonly videoEnabled: boolean;
3573
+ readonly screenShareEnabled: boolean;
3574
+ enableAudio(): Promise<void>;
3575
+ enableVideo(): Promise<void>;
3576
+ disableAudio(): Promise<void>;
3577
+ enableScreenShare(): Promise<void>;
3578
+ disableScreenShare(): Promise<void>;
3579
+ disableVideo(): Promise<void>;
3580
+ getCurrentDevices(): {
3581
+ audio: MediaDeviceInfo;
3582
+ video: MediaDeviceInfo;
3583
+ speaker: MediaDeviceInfo;
3584
+ };
3585
+ getAudioDevices(): Promise<MediaDeviceInfo[]>;
3586
+ getVideoDevices(): Promise<MediaDeviceInfo[]>;
3587
+ getSpeakerDevices(): Promise<MediaDeviceInfo[]>;
3588
+ getDeviceById(deviceId: string, kind: 'audio' | 'video' | 'speaker'): Promise<MediaDeviceInfo>;
3589
+ setDevice(device: MediaDeviceInfo): Promise<void>;
3478
3590
  }
3479
- type BroadcastMessageTarget = {
3480
- participantIds: string[];
3481
- } | {
3482
- presetNames: string[];
3483
- } | {
3484
- meetingIds: string[];
3485
- };
3486
- type JoinedPeer = {
3591
+ interface UserDetailsResponse {
3487
3592
  id: string;
3488
- userId: string;
3489
3593
  name: string;
3490
- stageType?: StageStatus;
3491
- customParticipantId?: string;
3492
- presetId?: string;
3594
+ email: string;
3493
3595
  picture?: string;
3494
- waitlisted: boolean;
3495
- recorderType?: string;
3496
- stageStatus?: StageStatus;
3497
- metadata?: {
3498
- preset_name?: string;
3499
- };
3500
- flags?: {
3501
- hiddenParticipant?: boolean;
3502
- recorder?: boolean;
3503
- };
3504
- };
3505
- type ParticipantsEvents = {
3506
- ['viewModeChanged']: (payload: {
3507
- viewMode: string;
3508
- currentPage: number;
3509
- pageCount: number;
3510
- }) => void;
3511
- ['activeSpeaker']: (payload: {
3512
- peerId: string;
3513
- volume: number;
3514
- }) => void;
3515
- ['broadcastedMessage']: (payload: {
3516
- type: string;
3517
- payload: BroadcastMessagePayload;
3518
- timestamp: number;
3519
- }) => void;
3520
- ['poorConnection']: (payload: {
3521
- participantId: string;
3522
- score: number;
3523
- kind: string;
3524
- }) => void;
3525
- ['pageChanged']: (payload: {
3526
- viewMode: string;
3527
- currentPage: number;
3528
- pageCount: number;
3529
- }) => void;
3530
- ['mediaScoreUpdate']: (payload: {
3531
- kind: string;
3532
- isScreenshare: boolean;
3533
- score: number;
3534
- participantId: string;
3535
- scoreStats: ConsumerScoreStats;
3536
- }) => void;
3537
- ['media_decode_error']: (payload: {
3538
- reason: string;
3539
- code: '1702' | '1703';
3540
- }) => void;
3541
- ['*']: (event: string, ...args: any[]) => void;
3542
- };
3543
- declare class RTKParticipants$1 extends RTKTypedEventEmitter<ParticipantsEvents> {
3544
- readonly waitlisted: Readonly<RTKParticipantMap$1<Pick<RTKParticipant$1, Exclude<keyof RTKParticipant$1, 'audioTrack' | 'videoTrack' | 'screenShareTracks'>>>>;
3545
- readonly joined: Readonly<RTKParticipantMap$1>;
3546
- readonly active: Readonly<RTKParticipantMap$1>;
3547
- readonly videoSubscribed: Readonly<RTKParticipantMap$1>;
3548
- readonly audioSubscribed: Readonly<RTKParticipantMap$1>;
3549
- readonly pinned: Readonly<RTKParticipantMap$1>;
3550
- readonly all: Readonly<RTKBasicParticipantsMap>;
3551
- readonly pip: RTKPip;
3552
- rateLimitConfig: {
3553
- maxInvocations: number;
3554
- period: number;
3555
- };
3556
- readonly rateLimits: {
3557
- maxInvocations: number;
3558
- period: number;
3559
- };
3560
- updateRateLimits(num: number, period: number): void;
3561
- viewMode: ViewMode;
3562
- currentPage: number;
3563
- lastActiveSpeaker: string;
3564
- selectedPeers: RTKSelectedPeers;
3565
- constructor(context: Context<RTKContextState>, self: RTKSelf$1, roomSocketHandler: RoomSocketHandler);
3566
- setupEvents(): void;
3567
- readonly count: number;
3568
- readonly maxActiveParticipantsCount: number;
3569
- setMaxActiveParticipantsCount(limit: number): void;
3570
- readonly pageCount: number;
3571
- acceptWaitingRoomRequest(id: string): void;
3572
- acceptAllWaitingRoomRequest(userIds: string[]): Promise<void>;
3573
- rejectWaitingRoomRequest(id: string): Promise<void>;
3574
- setViewMode(viewMode: ViewMode): Promise<void>;
3575
- subscribe(peerIds: string[], kinds?: ('audio' | 'video' | 'screenshareAudio' | 'screenshareVideo')[]): Promise<void>;
3576
- unsubscribe(peerIds: string[], kinds?: ('audio' | 'video' | 'screenshareAudio' | 'screenshareVideo')[]): Promise<void>;
3577
- getPeerIdsForCurrentPage(): string[];
3578
- setPage(page: number): Promise<void>;
3579
- disableAllAudio(allowUnmute: boolean): Promise<void>;
3580
- disableAllVideo(): Promise<void>;
3581
- disableAudio(participantId: string): Promise<void>;
3582
- disableVideo(participantId: string): Promise<void>;
3583
- kick(participantId: string): Promise<void>;
3584
- kickAll(): Promise<void>;
3585
- broadcastMessage(type: Exclude<string, 'spotlight'>, payload: BroadcastMessagePayload, target?: BroadcastMessageTarget): Promise<void>;
3586
- getAllJoinedPeers(searchQuery: string, limit: number, offset: number): Promise<{
3587
- id: string;
3588
- userId: string;
3589
- name: string;
3590
- displayName: string;
3591
- stageType: StageStatus;
3592
- customParticipantId: string;
3593
- presetId: string;
3594
- picture: string;
3595
- waitlisted: boolean;
3596
- stageStatus: StageStatus;
3597
- metadata: {
3598
- preset_name: string;
3599
- };
3600
- recorderType: string;
3601
- flags: {
3602
- hiddenParticipant: boolean;
3603
- hidden_participant: boolean;
3604
- recorder: boolean;
3605
- };
3606
- }[]>;
3607
- updatePermissions(participantIds: string[], permissions: PresetUpdates): Promise<void>;
3608
- getParticipantsInMeetingPreJoin(): Promise<RoomPeersInfoResponse>;
3609
- }
3610
- interface FetchRequestConfig {
3611
- baseURL?: string;
3612
- url?: string;
3613
- method?: string;
3614
- headers?: Record<string, string>;
3615
- timeout?: number;
3616
- retry?: number;
3617
- retryDelay?: number;
3618
- responseType?: string;
3619
- data?: any;
3620
- params?: Record<string, string>;
3621
- }
3622
- interface FetchResponse<T = any> {
3623
- data: T;
3624
- status: number;
3625
- statusText: string;
3626
- headers: Record<string, string>;
3627
- config: FetchRequestConfig;
3628
- }
3629
- declare class FetchClient {
3630
- defaults: {
3631
- baseURL: string;
3632
- headers: {
3633
- common: Record<string, string>;
3634
- };
3635
- timeout: number;
3636
- retry: number;
3637
- retryDelay: number;
3638
- };
3639
- constructor(options: {
3640
- baseURL: string;
3641
- timeout: number;
3642
- retry: number;
3643
- retryDelay: number;
3644
- responseType?: string;
3645
- });
3646
- request<T = any>(config: FetchRequestConfig): Promise<FetchResponse<T>>;
3647
- get<T = any>(url: string, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
3648
- post<T = any>(url: string, data?: any, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
3649
- put<T = any>(url: string, data?: any, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
3650
- }
3651
- interface ResponseStatus {
3652
- success: boolean;
3653
- message: string;
3596
+ loggedIn?: boolean;
3597
+ scope?: string[];
3598
+ clientSpecificId?: string;
3599
+ customParticipantId?: string;
3600
+ organizationId?: string;
3654
3601
  }
3655
- type MediaPermission$1 = 'NOT_REQUESTED' | 'ACCEPTED' | 'DENIED' | 'SYSTEM_DENIED' | 'COULD_NOT_START' | 'NO_DEVICES_AVAILABLE' | 'CANCELED';
3656
- declare class LocalMediaHandler extends RTKEventEmitter<LocalMediaEvents> {
3657
- audioUpdateInProgress: boolean;
3658
- videoUpdateInProgress: boolean;
3659
- constructor(context: Context<RTKContextState>, mediaConstraints: MediaConstraints, isNonPreferredDevice?: (media: MediaDeviceInfo) => boolean, autoSwitchDevice?: boolean);
3660
- repopulateAvailableDevices(): Promise<boolean>;
3661
- setupStreams({ audio, video, }: {
3662
- audio: boolean;
3663
- video: boolean;
3602
+ declare class RTKSelf$1 extends RTKSelfMedia$1 {
3603
+ name: string;
3604
+ picture: string;
3605
+ customParticipantId: string;
3606
+ waitlistStatus: 'accepted' | 'waiting' | 'rejected' | 'none';
3607
+ role: any;
3608
+ userId: string;
3609
+ organizationId: string;
3610
+ supportsRemoteControl: boolean;
3611
+ device: DeviceConfig;
3612
+ readonly telemetry: RTKTelemetry;
3613
+ hidden: boolean;
3614
+ readonly stageStatus: StageStatus;
3615
+ readonly id: string;
3616
+ readonly peerId: string;
3617
+ presetName: string;
3618
+ roomState: 'init' | 'joined' | 'waitlisted' | LeaveRoomState;
3619
+ private constructor();
3620
+ static __init__(context: Context<RTKContextState>, details: UserDetailsResponse, permissions: RTKPermissionsPreset$1, theme: RTKThemePreset$1, presetName: string, skipAwaits?: boolean): Promise<RTKSelf$1>;
3621
+ cleanupEvents(): void;
3622
+ readonly permissions: RTKPermissionsPreset$1;
3623
+ readonly config: RTKThemePreset$1;
3624
+ readonly roomJoined: boolean;
3625
+ setName(name: string): void;
3626
+ setupTracks(options?: {
3627
+ video?: boolean;
3628
+ audio?: boolean;
3629
+ forceReset?: boolean;
3664
3630
  }): Promise<void>;
3665
- getCurrentDevices(): {
3666
- audio: MediaDeviceInfo;
3667
- video: MediaDeviceInfo;
3668
- speaker: MediaDeviceInfo;
3669
- };
3670
- readonly permissions: {
3671
- audio?: MediaPermission$1;
3672
- video?: MediaPermission$1;
3673
- screenshare?: MediaPermission$1;
3674
- };
3675
- getAllDevices(): Promise<InputDeviceInfo[]>;
3676
- getDeviceById(deviceId: string, kind?: 'audioinput' | 'audiooutput' | 'videoinput'): Promise<MediaDeviceInfo>;
3677
- readonly rawAudioTrack: MediaStreamTrack;
3678
- readonly audioTrack: MediaStreamTrack;
3679
- readonly audioEnabled: boolean;
3631
+ destructMediaHandler(): Promise<void>;
3632
+ removeDocumentEventListeners(): Promise<void>;
3680
3633
  enableAudio(customTrack?: MediaStreamTrack): Promise<void>;
3681
- disableAudio(): void;
3682
- getAudioDevices(devices?: MediaDeviceInfo[]): Promise<MediaDeviceInfo[]>;
3683
- setAudioDevice(device: MediaDeviceInfo): Promise<void>;
3684
- setupSpeaker(): Promise<void>;
3685
- setSpeakerDevice(device: MediaDeviceInfo): Promise<void>;
3686
- readonly rawVideoTrack: MediaStreamTrack;
3687
- readonly videoTrack: MediaStreamTrack;
3688
- readonly videoEnabled: boolean;
3689
3634
  enableVideo(customTrack?: MediaStreamTrack): Promise<void>;
3690
- disableVideo(): void;
3691
- getVideoDevices(devices?: MediaDeviceInfo[]): Promise<MediaDeviceInfo[]>;
3692
- setVideoDevice(device: MediaDeviceInfo): Promise<void>;
3693
3635
  updateVideoConstraints(resolution: VideoQualityConstraints): Promise<void>;
3694
- readonly screenShareTracks: {
3695
- audio: MediaStreamTrack;
3696
- video: MediaStreamTrack;
3697
- };
3698
- readonly screenShareEnabled: boolean;
3699
3636
  enableScreenShare(): Promise<void>;
3700
- disableScreenShare(): Promise<void>;
3701
3637
  updateScreenshareConstraints(resolution: VideoQualityConstraints): Promise<void>;
3702
- getSpeakerDevices(devices?: MediaDeviceInfo[]): Promise<MediaDeviceInfo[]>;
3703
- addAudioMiddleware(audioMiddleware: AudioMiddleware): Promise<ResponseStatus>;
3704
- removeAudioMiddleware(audioMiddleware: AudioMiddleware): Promise<ResponseStatus>;
3705
- removeAllAudioMiddlewares(): Promise<ResponseStatus>;
3706
- addVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<ResponseStatus>;
3707
- removeVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<ResponseStatus>;
3708
- removeAllVideoMiddlewares(): Promise<ResponseStatus>;
3709
- setVideoMiddlewareGlobalConfig(config: VideoMiddlewareGlobalConfig): Promise<void>;
3710
- destruct(): void;
3711
- onDeviceChange(changedDevices: {
3712
- added: MediaDeviceInfo[];
3713
- removed: MediaDeviceInfo[];
3714
- devices: MediaDeviceInfo[];
3715
- }, skipDeviceChange: boolean): Promise<void>;
3716
- removeAllTracks(): void;
3717
- removeAudioTrack(): void;
3718
- removeVideoTrack(): void;
3719
- removeDocumentEventListeners(): Promise<void>;
3638
+ disableAudio(): Promise<void>;
3639
+ disableVideo(): Promise<void>;
3640
+ disableScreenShare(): Promise<void>;
3641
+ getAllDevices(): Promise<InputDeviceInfo[]>;
3642
+ setIsPinned(isPinned: boolean, emitEvent?: boolean): void;
3643
+ readonly isPinned: boolean;
3644
+ pin(): Promise<void>;
3645
+ unpin(): Promise<void>;
3646
+ hide(): Promise<void>;
3647
+ show(): void;
3648
+ setDevice(device: MediaDeviceInfo): Promise<void>;
3649
+ cleanUpTracks(): void;
3650
+ playAudio(): Promise<void>;
3651
+ registerVideoElement(videoElem: HTMLVideoElement, isPreview?: boolean): void;
3652
+ deregisterVideoElement(videoElem?: HTMLVideoElement, isPreview?: boolean): void;
3720
3653
  }
3721
- declare enum MediaPermission {
3722
- NOT_REQUESTED = 0,
3723
- ACCEPTED = 1,
3724
- DENIED = 2,
3725
- CANCELED = 3,
3726
- SYSTEM_DENIED = 4,
3727
- COULD_NOT_START = 5,
3728
- NO_DEVICES_AVAILABLE = 6
3654
+ interface RTKBasicParticipant {
3655
+ userId: string;
3656
+ name?: string;
3657
+ picture?: string;
3658
+ customParticipantId: string;
3729
3659
  }
3730
- type AudioMiddleware = (audioContext: AudioContext) => Promise<ScriptProcessorNode | AudioWorkletNode>;
3731
- type VideoMiddleware = (() => Promise<(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D) => Promise<void>>) | ((helpers: {
3732
- canvas: HTMLCanvasElement;
3733
- WorkerTimers: typeof WorkerTimers;
3734
- }) => Promise<void>);
3735
- type VideoMiddlewareGlobalConfig = {
3736
- disablePerFrameCanvasRendering: boolean;
3737
- };
3738
- type PresetMediaConstraints = PresetV2CamelCased['config']['media'];
3739
- type AudioQualityConstraints = {
3740
- echoCancellation?: boolean;
3741
- noiseSupression?: boolean;
3742
- autoGainControl?: boolean;
3743
- enableStereo?: boolean;
3744
- enableHighBitrate?: boolean;
3745
- };
3746
- type VideoQualityConstraints = {
3747
- width: {
3748
- ideal: number;
3749
- };
3750
- height: {
3751
- ideal: number;
3752
- };
3753
- frameRate?: {
3754
- ideal: number;
3755
- };
3756
- };
3757
- type ScreenshareQualityConstraints = {
3758
- width?: {
3759
- max: number;
3760
- };
3761
- height?: {
3762
- max: number;
3763
- };
3764
- frameRate?: {
3765
- ideal: number;
3766
- max: number;
3767
- };
3768
- displaySurface?: 'window' | 'monitor' | 'browser';
3769
- selfBrowserSurface?: 'include' | 'exclude';
3770
- };
3771
- interface RTKMediaTrackConstraints extends MediaTrackConstraints {
3772
- optional?: Array<object>;
3660
+ declare class RTKBasicParticipantsMap extends RTKEventEmitter<'participantsUpdate'> {
3661
+ constructor(logger: RTKLogger$1);
3662
+ __set(objId: string, obj: RTKBasicParticipant): Map<string, RTKBasicParticipant>;
3663
+ __clear(): void;
3664
+ get(objId: string): RTKBasicParticipant;
3665
+ toArray(): RTKBasicParticipant[];
3773
3666
  }
3774
- interface RTKMediaStreamConstraints extends MediaStreamConstraints {
3775
- audio?: boolean | RTKMediaTrackConstraints;
3667
+ type ChatChannelSocketMessage = GetChatChannelResponse;
3668
+ interface ChatChannel {
3669
+ id: string;
3670
+ displayName: string;
3671
+ memberIds: string[];
3672
+ displayPictureUrl?: string;
3673
+ visibility?: string;
3674
+ isDirectMessage?: boolean;
3675
+ latestMessage?: Message;
3676
+ unreadCount: number;
3776
3677
  }
3777
- type MediaConstraints = {
3778
- audio?: AudioQualityConstraints;
3779
- video?: MediaVideoQualityType | VideoQualityConstraints;
3780
- screenshare?: ScreenshareQualityConstraints;
3781
- };
3782
- type PresetV2CamelCased = {
3783
- config: {
3784
- viewType: ViewType;
3785
- media: {
3786
- audio: {
3787
- enableStereo: boolean;
3788
- enableHighBitrate: boolean;
3789
- };
3790
- video: {
3791
- quality: MediaVideoQualityType;
3792
- frameRate: number;
3793
- };
3794
- screenshare: {
3795
- quality: MediaScreenShareQualityType;
3796
- frameRate: number;
3797
- };
3798
- };
3799
- livestreamViewerQualities: LivestreamViewerMediaQualityType[];
3800
- maxVideoStreams: {
3801
- mobile: number;
3802
- desktop: number;
3803
- };
3804
- maxScreenshareCount: number;
3805
- };
3806
- permissions: {
3807
- acceptWaitingRequests: boolean;
3808
- canAcceptProductionRequests: boolean;
3809
- canEditDisplayName: boolean;
3810
- canRecord: boolean;
3811
- canLivestream: boolean;
3812
- canSpotlight?: boolean;
3813
- disableParticipantAudio: boolean;
3814
- disableParticipantScreensharing: boolean;
3815
- disableParticipantVideo: boolean;
3816
- kickParticipant: boolean;
3817
- pinParticipant: boolean;
3818
- plugins: {
3819
- canClose: boolean;
3820
- canStart: boolean;
3821
- canEditConfig?: boolean;
3822
- config: {
3823
- [pluginId: string]: Partial<{
3824
- accessControl: PluginAccessControls.FULL_ACCESS | PluginAccessControls.VIEW_ONLY;
3825
- disabled: boolean;
3826
- handlesViewOnly: boolean;
3827
- }>;
3828
- };
3829
- };
3830
- waitingRoomType: WaitingRoomTypes;
3831
- polls: {
3832
- canCreate: boolean;
3833
- canVote: boolean;
3834
- canView: boolean;
3835
- };
3836
- media: {
3837
- video: {
3838
- canProduce: MediaProductionPermissionType;
3839
- };
3840
- audio: {
3841
- canProduce: MediaProductionPermissionType;
3842
- };
3843
- screenshare: {
3844
- canProduce: MediaProductionPermissionType;
3845
- };
3846
- };
3847
- chat: {
3848
- public: {
3849
- canSend: boolean;
3850
- text: boolean;
3851
- files: boolean;
3852
- };
3853
- private?: {
3854
- canSend: boolean;
3855
- canReceive: boolean;
3856
- text: boolean;
3857
- files: boolean;
3858
- };
3859
- channel?: {
3860
- canCreate: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
3861
- canDelete: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
3862
- canUpdate: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
3863
- canReadAll: boolean;
3864
- };
3865
- message?: {
3866
- canDelete: 'NONE' | 'SELF' | 'ALL';
3867
- canEdit: 'NONE' | 'SELF' | 'ALL';
3868
- deleteCutoffTimeSeconds: number;
3869
- editCutoffTimeSeconds: number;
3870
- };
3871
- };
3872
- isRecorder?: boolean;
3873
- recorderType: RecorderType$1;
3874
- hiddenParticipant: boolean;
3875
- showParticipantList: boolean;
3876
- canChangeParticipantPermissions: boolean;
3877
- connectedMeetings: {
3878
- canAlterConnectedMeetings: boolean;
3879
- canSwitchConnectedMeetings: boolean;
3880
- canSwitchToParentMeeting: boolean;
3881
- };
3882
- acceptStageRequests?: boolean;
3883
- stageEnabled?: boolean;
3884
- stageAccess?: MediaProductionPermissionType;
3885
- transcriptionEnabled: boolean;
3886
- };
3887
- ui: {
3888
- designTokens: {
3889
- borderRadius: BorderRadius;
3890
- borderWidth: BorderWidth;
3891
- colors: {
3892
- brand: {
3893
- 300: string;
3894
- 400: string;
3895
- 500: string;
3896
- 600: string;
3897
- 700: string;
3898
- };
3899
- background: {
3900
- 600: string;
3901
- 700: string;
3902
- 800: string;
3903
- 900: string;
3904
- 1000: string;
3905
- };
3906
- danger: string;
3907
- success: string;
3908
- textOnBrand: string;
3909
- text: string;
3910
- videoBg: string;
3911
- warning: string;
3912
- };
3913
- fontFamily?: string;
3914
- googleFont?: string;
3915
- logo?: string;
3916
- spacingBase: number;
3917
- theme: Theme;
3918
- };
3919
- configDiff: any;
3920
- };
3921
- version?: string;
3922
- id?: string;
3923
- name?: string;
3924
- };
3925
- type MaxVideoStreams = PresetV2CamelCased['config']['maxVideoStreams'];
3926
- declare class RTKThemePreset$1 {
3927
- private constructor();
3928
- static fromResponse(preset: PresetV2CamelCased): RTKThemePreset$1;
3929
- static default(): RTKThemePreset$1;
3930
- static init(preset?: PresetV2CamelCased, useDefault?: boolean): RTKThemePreset$1;
3931
- readonly setupScreen: Readonly<{
3932
- isEnabled: boolean;
3933
- }>;
3934
- readonly waitingRoom: Readonly<{
3935
- isEnabled: boolean;
3936
- }>;
3937
- readonly controlBar: Readonly<{
3938
- isEnabled: boolean;
3939
- elements?: {
3940
- chat?: boolean;
3941
- fullscreen?: boolean;
3942
- invite?: boolean;
3943
- layout?: boolean;
3944
- participants?: boolean;
3945
- plugins?: boolean;
3946
- polls?: boolean;
3947
- reactions?: boolean;
3948
- screenshare?: boolean;
3949
- };
3678
+ interface UpdateChannelRequestPayload {
3679
+ memberIds?: string[];
3680
+ displayName?: string;
3681
+ displayPictureUrl?: string;
3682
+ visibility?: string;
3683
+ }
3684
+ declare class ChatChannelSocketHandler {
3685
+ readonly telemetry: RTKTelemetry;
3686
+ readonly logger: RTKLogger$1;
3687
+ constructor(context: Context<RTKContextState>, socketService: SocketService);
3688
+ createChannel(displayName: string, memberIds: string[], displayPictureUrl?: string, visibility?: string, isDirectMessage?: boolean): Promise<ChatChannel>;
3689
+ updateChannel(channelId: string, payload: UpdateChannelRequestPayload): Promise<ChatChannel>;
3690
+ static formatChannel(socketChannel: ChatChannel$1): ChatChannel;
3691
+ getChannelMembers(channelId: string): Promise<RTKBasicParticipant[]>;
3692
+ on(event: number, handler: (socketMessage: ChatChannelSocketMessage) => void): void;
3693
+ }
3694
+ declare enum ChatMessageType {
3695
+ TEXT = 0,
3696
+ IMAGE = 1,
3697
+ FILE = 2,
3698
+ CUSTOM = 3
3699
+ }
3700
+ type ChatSocketMessage = SendChatMessageToRoomResponse | SendChatMessageToPeersResponse | EditChatMessageResponse | DeleteChatMessageResponse;
3701
+ interface SearchFilters {
3702
+ channelId?: string;
3703
+ timestamp?: number;
3704
+ size?: number;
3705
+ reversed?: boolean;
3706
+ }
3707
+ declare class ChatSocketHandler {
3708
+ readonly telemetry: RTKTelemetry;
3709
+ readonly logger: RTKLogger$1;
3710
+ constructor(context: Context<RTKContextState>, socketService: SocketService);
3711
+ getChatMessages(): Promise<{
3712
+ id: string;
3713
+ payload: Uint8Array;
3950
3714
  }>;
3951
- readonly header: Readonly<{
3952
- isEnabled: boolean;
3953
- elements: {
3954
- logo: string;
3955
- timer: boolean;
3956
- title: boolean;
3957
- participantCount: boolean;
3958
- changeLayout: boolean;
3959
- };
3715
+ getChatMessagesPaginated(timeStamp: number, size: number, reversed: boolean, offset?: number, channelId?: string): Promise<GetPaginatedChatMessageRoomResponse>;
3716
+ sendMessageToRoom(message: string, messageType: ChatMessageType): void;
3717
+ sendMessageToPeers(message: string, messageType: ChatMessageType, peerIds: string[]): void;
3718
+ sendMessageToChannel(message: string, messageType: ChatMessageType, channelId: string): void;
3719
+ sendMessage(message: string, messageType: ChatMessageType, peerIds?: string[], channelId?: string): void;
3720
+ editMessage(chatId: string, message: string, payloadType: ChatMessageType, channelId?: string, pinned?: boolean): Promise<ChatMessage>;
3721
+ deleteMessage(chatId: string, channelId?: string): Promise<{
3722
+ channelId?: string;
3723
+ id: string;
3960
3724
  }>;
3961
- readonly pipMode: Readonly<boolean>;
3962
- readonly viewType: Readonly<ViewType>;
3963
- readonly livestreamViewerQualities: Readonly<LivestreamViewerMediaQualityType[]>;
3964
- readonly maxVideoStreams: Readonly<MaxVideoStreams>;
3965
- readonly maxScreenShareCount: Readonly<number>;
3966
- readonly plugins: Readonly<string[]>;
3967
- readonly disabledPlugins: Readonly<string[]>;
3968
- readonly designTokens: Readonly<PresetV2CamelCased['ui']['designTokens']>;
3969
- readonly configDiff: Readonly<PresetV2CamelCased['ui']['configDiff']>;
3970
- readonly mediaConstraints: Readonly<PresetMediaConstraints>;
3971
- readonly name: string;
3725
+ searchMessages(query: string, filters: SearchFilters): Promise<ChatMessage[]>;
3726
+ getAllChannels(): Promise<ChatChannel[]>;
3727
+ markLastReadMessage(channelId: string, message: Message): Promise<string>;
3728
+ setPinState(message: Message, pin: boolean): Promise<PinChatMessageResponse>;
3729
+ on(event: number, handler: (socketMessage: ChatSocketMessage) => void): void;
3972
3730
  }
3973
- type PresetPermissions = PresetV2CamelCased['permissions'];
3974
- type MediaRoomType = 'HIVE' | 'CF';
3975
- type PermissionEvents = {
3976
- ['chatUpdate']: () => void;
3977
- ['pollsUpdate']: () => void;
3978
- ['pluginsUpdate']: () => void;
3979
- ['permissionsUpdate']: (patch: PresetUpdates) => void;
3980
- ['*']: () => void;
3981
- };
3982
- declare class RTKPermissionsPreset$1 extends RTKTypedEventEmitter<PermissionEvents> {
3983
- private constructor();
3984
- static fromResponse(response: PresetPermissions, viewType: ViewType, context: Context<RTKContextState>): RTKPermissionsPreset$1;
3985
- static default(context: Context<RTKContextState>, viewType: ViewType): RTKPermissionsPreset$1;
3986
- static init(context: Context<RTKContextState>, viewType: ViewType, response?: PresetPermissions): RTKPermissionsPreset$1;
3987
- readonly mediaRoomType: Readonly<MediaRoomType>;
3988
- readonly stageEnabled: Readonly<boolean>;
3989
- readonly acceptStageRequests: Readonly<boolean>;
3990
- readonly stageAccess: Readonly<MediaProductionPermissionType>;
3991
- readonly acceptWaitingRequests: Readonly<boolean>;
3992
- readonly requestProduceVideo: Readonly<boolean>;
3993
- readonly requestProduceAudio: Readonly<boolean>;
3994
- readonly requestProduceScreenshare: Readonly<boolean>;
3995
- readonly canAllowParticipantAudio: Readonly<boolean>;
3996
- readonly canAllowParticipantScreensharing: Readonly<boolean>;
3997
- readonly canAllowParticipantVideo: Readonly<boolean>;
3998
- readonly canDisableParticipantAudio: Readonly<boolean>;
3999
- readonly canDisableParticipantVideo: Readonly<boolean>;
4000
- readonly kickParticipant: Readonly<boolean>;
4001
- readonly pinParticipant: Readonly<boolean>;
4002
- readonly canRecord: Readonly<boolean>;
4003
- readonly waitingRoomType: Readonly<WaitingRoomTypes>;
4004
- readonly waitingRoomBehaviour: Readonly<WaitingRoomTypes>;
4005
- readonly plugins: Readonly<PresetPermissions['plugins']>;
4006
- readonly polls: Readonly<PresetPermissions['polls']>;
4007
- readonly produceVideo: Readonly<MediaProductionPermissionType>;
4008
- readonly requestProduce: Readonly<boolean>;
4009
- readonly canProduceVideo: Readonly<MediaProductionPermissionType>;
4010
- readonly produceScreenshare: Readonly<MediaProductionPermissionType>;
4011
- readonly canProduceScreenshare: Readonly<MediaProductionPermissionType>;
4012
- readonly produceAudio: Readonly<MediaProductionPermissionType>;
4013
- readonly canProduceAudio: Readonly<MediaProductionPermissionType>;
4014
- readonly chatPublic: Readonly<PresetPermissions['chat']['public']>;
4015
- readonly chatPrivate: Readonly<PresetPermissions['chat']['private']>;
4016
- readonly chatChannel: Readonly<PresetPermissions['chat']['channel']>;
4017
- readonly chatMessage: Readonly<PresetPermissions['chat']['message']>;
4018
- readonly connectedMeetings: Readonly<PresetPermissions['connectedMeetings']>;
4019
- readonly hiddenParticipant: Readonly<boolean>;
4020
- readonly showParticipantList: Readonly<boolean>;
4021
- readonly canChangeParticipantRole: Readonly<boolean>;
4022
- readonly canChangeParticipantPermissions: Readonly<boolean>;
4023
- readonly canChangeTheme: Readonly<boolean>;
4024
- readonly canPresent: Readonly<boolean>;
4025
- readonly acceptPresentRequests: Readonly<boolean>;
4026
- readonly canEditDisplayName: Readonly<boolean>;
4027
- readonly maxScreenShareCount: Readonly<number>;
4028
- readonly isRecorder: Readonly<boolean>;
4029
- readonly canSpotlight: Readonly<boolean>;
4030
- readonly canLivestream: Readonly<boolean>;
4031
- readonly transcriptionEnabled: Readonly<boolean>;
4032
- }
4033
- interface UserDetailsResponseV2 {
4034
- participant: UserDetailsResponse;
4035
- preset: PresetV2CamelCased;
3731
+ declare class RTKSelectedPeers {
3732
+ constructor();
3733
+ add(peerId: string, priority: number, context: Context<RTKContextState>): number;
3734
+ delete(peerId: string, context: Context<RTKContextState>): void;
3735
+ index(peerId: string): number;
3736
+ readonly peers: string[];
3737
+ readonly compulsoryPeers: string[];
3738
+ readonly activeSpeakerPeers: string[];
4036
3739
  }
4037
- type LeaveRoomState = 'kicked' | 'ended' | 'left' | 'rejected' | 'connected-meeting' | 'disconnected' | 'failed' | 'stageLeft';
4038
- type LivestreamState = 'IDLE' | 'STARTING' | 'WAITING_ON_MANUAL_INGESTION' | 'LIVESTREAMING' | 'STOPPING';
4039
- type LivestreamEvents = {
4040
- ['livestreamUpdate']: (state: LivestreamState) => void;
4041
- ['viewerCountUpdate']: (count: number) => void;
3740
+ type PipEvents = {
3741
+ ['cameraToggled']: () => void;
3742
+ ['micToggled']: () => void;
3743
+ ['hangup']: () => void;
3744
+ ['pipStarted']: () => void;
3745
+ ['pipEnded']: () => void;
4042
3746
  ['*']: (eventName: string, ...args: any[]) => void;
4043
3747
  };
4044
- type StartLivestreamConfig = {
4045
- manualIngestion: boolean;
4046
- };
4047
- interface LivestreamIngestionCredentials {
4048
- ingestionServer: string;
4049
- streamKey: string;
3748
+ declare class RTKPip extends RTKTypedEventEmitter<PipEvents> {
3749
+ private constructor();
3750
+ static _init(context: Context<RTKContextState>, self: RTKSelf$1): Promise<RTKPip>;
3751
+ overrideIcon(icon: 'handRaise' | 'pin', value: string): Promise<void>;
3752
+ isSupported(): boolean;
3753
+ readonly isActive: boolean;
3754
+ init({ height, width }?: {
3755
+ height?: number;
3756
+ width?: number;
3757
+ }): void;
3758
+ enableSource(source: string): void;
3759
+ disableSource(source: string): void;
3760
+ addSource(id: string, element: HTMLVideoElement, enabled: boolean, pinned?: boolean, displayText?: string, imageUrl?: string, handRaised?: boolean): void;
3761
+ updateSource(id: string, source: any): void;
3762
+ removeSource(id: string): void;
3763
+ removePinnedSource(): void;
3764
+ removeAllSources(): void;
3765
+ enable(): void;
3766
+ disable: (partial?: boolean) => void;
4050
3767
  }
4051
- type LivestreamResponse = {
4052
- status: string;
4053
- playbackUrl: string;
4054
- manualIngest: boolean;
4055
- ingestionCredentials?: LivestreamIngestionCredentials;
3768
+ type TranscriptionData = {
3769
+ id: string;
3770
+ name: string;
3771
+ peerId: string;
3772
+ userId: string;
3773
+ customParticipantId: string;
3774
+ transcript: string;
3775
+ isPartialTranscript: boolean;
3776
+ date: Date;
4056
3777
  };
4057
- declare class RTKLivestream$1 extends RTKTypedEventEmitter<LivestreamEvents> {
4058
- state: LivestreamState;
4059
- playbackUrl: string | undefined;
4060
- ingestionCredentials: LivestreamIngestionCredentials;
4061
- viewerCount: number;
4062
- constructor(self: RTKSelf);
4063
- setLivestreamState(livestreamState: LivestreamState): void;
4064
- start(livestreamConfig?: StartLivestreamConfig): Promise<void>;
4065
- stop(): Promise<void>;
4066
- }
4067
- interface RecordingConfig {
4068
- fileNamePrefix?: string;
4069
- videoConfig?: {
4070
- height?: number;
4071
- width?: number;
4072
- codec?: string;
4073
- };
3778
+ type AiEvents = {
3779
+ ['transcript']: (t: TranscriptionData) => void;
3780
+ ['*']: (event: string, ...args: any[]) => void;
3781
+ };
3782
+ declare class RTKAi extends RTKTypedEventEmitter<AiEvents> {
3783
+ transcripts: TranscriptionData[];
3784
+ readonly telemetry: RTKTelemetry;
3785
+ constructor(context: Context<RTKContextState>);
3786
+ static init(context: Context<RTKContextState>, transcriptionEnabled: boolean): Promise<RTKAi>;
3787
+ static parseTranscript(transcriptData: string, isPartialTranscript?: boolean): TranscriptionData | undefined;
3788
+ static parseTranscripts(transcriptData: string): TranscriptionData[];
3789
+ getActiveTranscript(): Promise<void>;
3790
+ onTranscript(transcript: TranscriptionData): Promise<void>;
4074
3791
  }
4075
- interface ReactNativeFile {
4076
- uri: string;
4077
- name: string;
4078
- type: string;
3792
+ type ActiveTabType = 'screenshare' | 'plugin';
3793
+ interface ActiveTab {
3794
+ type: ActiveTabType;
3795
+ id: string;
4079
3796
  }
4080
- declare class APIClient extends API {
4081
- constructor(context: Context<RTKContextState>, options?: APIOptions);
4082
- getIPDetails(): Promise<any>;
4083
- getICEServers(): Promise<any>;
4084
- getPlugins(): Promise<any[]>;
4085
- getPluginDetails(pluginId: string): Promise<RTKPluginResponse>;
4086
- getPluginConfig(pluginBaseUrl: string): Promise<PluginConfig>;
4087
- authorizePlugin(pluginId: string): Promise<string>;
4088
- getPresignedUrls(filename: string, viewType: string): Promise<{
4089
- getLocation: any;
4090
- putLocation: any;
4091
- }>;
4092
- uploadFile(file: File | ReactNativeFile, url: string): Promise<void>;
4093
- startLivestreaming({ manualIngestion, }: StartLivestreamConfig): Promise<LivestreamResponse>;
4094
- stopLivestreaming(): Promise<FetchResponse<any>>;
4095
- getActiveLivestream(): Promise<LivestreamResponse>;
4096
- getUserDetails(): Promise<UserDetailsResponseV2>;
4097
- startRecording(config: RecordingConfig, allowMultiple?: boolean): Promise<string>;
4098
- updateRecording(recordingId: string, action: 'stop' | 'pause' | 'resume'): Promise<FetchResponse<any>>;
4099
- getActiveRecording(): Promise<{
4100
- status: string;
4101
- id: string;
4102
- }>;
4103
- getActiveTranscript(): Promise<{
4104
- transcript: string;
4105
- }>;
4106
- getRoomNodeData(): Promise<RoomDetails>;
3797
+ declare enum TabChangeSource {
3798
+ User = 0,
3799
+ Meeting = 1
4107
3800
  }
4108
- declare enum MessageType {
4109
- text = "text",
4110
- image = "image",
4111
- file = "file",
4112
- custom = "custom",
4113
- poll = "poll"
3801
+ interface MediaConnectionUpdate {
3802
+ transport: 'consuming' | 'producing';
3803
+ state: string;
3804
+ reconnected: boolean;
4114
3805
  }
4115
- interface BaseMessage<T extends MessageType> {
4116
- type: T;
4117
- userId: string;
4118
- displayName: string;
4119
- time: Date;
4120
- timeMs?: number;
4121
- id: string;
4122
- isEdited?: boolean;
4123
- read?: boolean;
4124
- pluginId?: string;
4125
- pinned?: boolean;
4126
- targetUserIds?: string[];
4127
- channelId?: string;
4128
- channelIndex?: string;
3806
+ type MetaEvents = {
3807
+ ['mediaConnectionUpdate']: (payload: MediaConnectionUpdate) => void;
3808
+ ['socketConnectionUpdate']: (state: SocketConnectionState) => void;
3809
+ ['poorConnection']: (payload: {
3810
+ score: number;
3811
+ }) => void;
3812
+ ['meetingStartTimeUpdate']: (payload: {
3813
+ meetingStartedTimestamp: Date;
3814
+ }) => void;
3815
+ ['transcript']: (t: TranscriptionData) => void;
3816
+ ['activeTabUpdate']: (tab: ActiveTab) => void;
3817
+ ['selfTabUpdate']: (tab: ActiveTab) => void;
3818
+ ['broadcastTabChangesUpdate']: (broadcastTabChanges: boolean) => void;
3819
+ ['*']: (event: string, ...args: any[]) => void;
3820
+ };
3821
+ declare class RTKMeta$1 extends RTKTypedEventEmitter<MetaEvents> {
3822
+ selfActiveTab: ActiveTab | undefined;
3823
+ readonly socketState: SocketConnectionState;
3824
+ readonly mediaState: MediaConnectionState;
3825
+ broadcastTabChanges: boolean;
3826
+ viewType: string;
3827
+ meetingStartedTimestamp: Date;
3828
+ meetingTitle: string;
3829
+ sessionId: string;
3830
+ constructor(context: Context<RTKContextState>, self: RTKSelf, viewType: string, roomSocketHandler: RoomSocketHandler, meetingTitle: string);
3831
+ readonly meetingId: string;
3832
+ setBroadcastTabChanges(broadcastTabChanges: boolean): void;
3833
+ setSelfActiveTab(spotlightTab: ActiveTab, tabChangeSource: TabChangeSource): void;
4129
3834
  }
4130
- interface TextMessage extends BaseMessage<MessageType.text> {
4131
- message: string;
3835
+ interface RTKMapEvents<T extends EventMap$1> {
3836
+ onAddEvent?: keyof T;
3837
+ onDeleteEvent?: keyof T;
3838
+ onClearEvent?: keyof T;
4132
3839
  }
4133
- interface CustomMessage extends BaseMessage<MessageType.custom> {
4134
- message?: string;
4135
- html?: string;
4136
- files?: {
4137
- link: string;
4138
- type?: string;
4139
- name?: string;
4140
- size?: number;
4141
- }[];
4142
- images?: {
4143
- link: string;
4144
- type?: string;
4145
- name?: string;
4146
- size?: number;
4147
- }[];
4148
- videos?: {
4149
- link: string;
4150
- type?: string;
4151
- name?: string;
4152
- size?: number;
4153
- }[];
4154
- }
4155
- interface ImageMessage extends BaseMessage<MessageType.image> {
4156
- link: string;
4157
- }
4158
- interface FileMessage extends BaseMessage<MessageType.file> {
4159
- name: string;
4160
- size: number;
4161
- link: string;
4162
- }
4163
- type Message = TextMessage | ImageMessage | FileMessage | CustomMessage;
4164
- interface TextMessagePayload {
4165
- type: 'text';
4166
- message: string;
4167
- replyTo?: TextMessage;
3840
+ type ModifyPrependObject<T extends EventMap$1, U> = {
3841
+ [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3842
+ } & {
3843
+ ['*']: (event: String, ...args: any[]) => void;
3844
+ };
3845
+ declare class RTKMap<T extends (EventMap$1 & WildCardEvent<T>), U extends {
3846
+ id: string;
3847
+ } & RTKTypedEventEmitter<T>, V extends EventMap$1> extends Map<string, U> {
3848
+ readonly onAddEvent: keyof V;
3849
+ readonly onDeleteEvent: keyof V;
3850
+ readonly onClearEvent: keyof V;
3851
+ constructor(options: RTKMapEvents<V>, logger?: RTKLogger$1);
3852
+ emit<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, ...args: Parameters<(V | ModifyPrependObject<T, U>)[E]>): boolean;
3853
+ on<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3854
+ [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3855
+ } & {
3856
+ "*": (event: String, ...args: any[]) => void;
3857
+ } & V>;
3858
+ addListener<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3859
+ [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3860
+ } & {
3861
+ "*": (event: String, ...args: any[]) => void;
3862
+ } & V>;
3863
+ off<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3864
+ [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3865
+ } & {
3866
+ "*": (event: String, ...args: any[]) => void;
3867
+ } & V>;
3868
+ once<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3869
+ [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3870
+ } & {
3871
+ "*": (event: String, ...args: any[]) => void;
3872
+ } & V>;
3873
+ prependListener<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3874
+ [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3875
+ } & {
3876
+ "*": (event: String, ...args: any[]) => void;
3877
+ } & V>;
3878
+ prependOnceListener<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3879
+ [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3880
+ } & {
3881
+ "*": (event: String, ...args: any[]) => void;
3882
+ } & V>;
3883
+ removeListener<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E, callback: (ModifyPrependObject<T, U> & V)[E]): RTKTypedEventEmitter<{
3884
+ [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3885
+ } & {
3886
+ "*": (event: String, ...args: any[]) => void;
3887
+ } & V>;
3888
+ removeAllListeners<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event?: E): RTKTypedEventEmitter<{
3889
+ [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3890
+ } & {
3891
+ "*": (event: String, ...args: any[]) => void;
3892
+ } & V>;
3893
+ listeners<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E): Function[];
3894
+ listenerCount<E extends StringKeyOf<ModifyPrependObject<T, U> & V>>(event: E): number;
3895
+ getMaxListeners(): number;
3896
+ setMaxListeners(n: number): RTKTypedEventEmitter<{
3897
+ [K in keyof T]: (obj: U, ...args: Parameters<T[K]>) => ReturnType<T[K]>;
3898
+ } & {
3899
+ "*": (event: String, ...args: any[]) => void;
3900
+ } & V>;
3901
+ eventNames(): (string | symbol)[];
3902
+ add(obj: U, emitEvent?: boolean): this;
3903
+ set(objId: string, obj: U, emitEvent?: boolean): this;
3904
+ delete(objId: string, emitEvent?: boolean, removeListeners?: boolean): boolean;
3905
+ clear(emitEvent?: boolean, removeListeners?: boolean): void;
3906
+ toArray(): U[];
4168
3907
  }
4169
- interface CustomMessagePayload {
4170
- type: 'custom';
4171
- message?: string;
4172
- html?: string;
4173
- files?: (File | string)[];
4174
- images?: (File | string)[];
4175
- videos?: (File | string)[];
4176
- replyTo?: TextMessage;
3908
+ type ParticipantMapEvents = {
3909
+ ['participantJoined']: (payload: RTKParticipant$1) => void;
3910
+ ['participantLeft']: (payload: RTKParticipant$1) => void;
3911
+ ['participantsCleared']: () => void;
3912
+ ['participantsUpdate']: () => void;
3913
+ ['kicked']: (payload: {
3914
+ id: string;
3915
+ }) => void;
3916
+ };
3917
+ declare class RTKParticipantMap$1<T extends Pick<RTKParticipant$1, 'id' | keyof RTKTypedEventEmitter<ParticipantEvents>> = RTKParticipant$1> extends RTKMap<ParticipantEvents, T, ParticipantMapEvents> {
3918
+ constructor(logger: RTKLogger, options?: RTKMapEvents<ParticipantMapEvents>);
3919
+ add(participant: T, emitEvent?: boolean): this;
3920
+ clear(emitEvent?: boolean, removeListeners?: boolean): void;
3921
+ delete(participantId: string, emitEvent?: boolean, removeListeners?: boolean): boolean;
4177
3922
  }
4178
- interface ImageMessagePayload {
4179
- type: 'image';
4180
- image: File;
3923
+ declare const modes: readonly [
3924
+ "ACTIVE_GRID",
3925
+ "PAGINATED",
3926
+ "MANUAL"
3927
+ ];
3928
+ type ViewMode = (typeof modes)[number];
3929
+ interface BroadcastMessagePayload {
3930
+ [key: string]: boolean | number | string | Date | ActiveTab;
4181
3931
  }
4182
- interface FileMessagePayload {
4183
- type: 'file';
4184
- file: File;
3932
+ interface PeerProducerConfig {
3933
+ audio: boolean;
3934
+ video: boolean;
3935
+ screenshareAudio: boolean;
3936
+ screenshareVideo: boolean;
4185
3937
  }
4186
- type MessagePayload = TextMessagePayload | ImageMessagePayload | FileMessagePayload | CustomMessagePayload;
4187
- interface ChatUpdateParams {
4188
- action: 'add' | 'edit' | 'delete';
4189
- message: Message | {
4190
- id: string;
4191
- channelId: string;
3938
+ type BroadcastMessageTarget = {
3939
+ participantIds: string[];
3940
+ } | {
3941
+ presetNames: string[];
3942
+ } | {
3943
+ meetingIds: string[];
3944
+ };
3945
+ type JoinedPeer = {
3946
+ id: string;
3947
+ userId: string;
3948
+ name: string;
3949
+ stageType?: StageStatus;
3950
+ customParticipantId?: string;
3951
+ presetId?: string;
3952
+ picture?: string;
3953
+ waitlisted: boolean;
3954
+ recorderType?: string;
3955
+ stageStatus?: StageStatus;
3956
+ metadata?: {
3957
+ preset_name?: string;
4192
3958
  };
4193
- messages: Message[];
4194
- }
4195
- type ChatEvents = {
4196
- ['chatUpdate']: (payload: ChatUpdateParams) => void;
4197
- ['pinMessage']: (payload: Pick<ChatUpdateParams, Exclude<keyof ChatUpdateParams, 'action'>>) => void;
4198
- ['unpinMessage']: (payload: Pick<ChatUpdateParams, Exclude<keyof ChatUpdateParams, 'action'>>) => void;
4199
- ['channelCreate']: (channel: ChatChannel) => void;
4200
- ['channelMessageUpdate']: (channel: ChatChannel) => void;
4201
- ['channelUpdate']: (channel?: ChatChannel) => void;
3959
+ flags?: {
3960
+ hiddenParticipant?: boolean;
3961
+ recorder?: boolean;
3962
+ };
3963
+ };
3964
+ type ParticipantsEvents = {
3965
+ ['viewModeChanged']: (payload: {
3966
+ viewMode: string;
3967
+ currentPage: number;
3968
+ pageCount: number;
3969
+ }) => void;
3970
+ ['activeSpeaker']: (payload: {
3971
+ peerId: string;
3972
+ volume: number;
3973
+ }) => void;
3974
+ ['broadcastedMessage']: (payload: {
3975
+ type: string;
3976
+ payload: BroadcastMessagePayload;
3977
+ timestamp: number;
3978
+ }) => void;
3979
+ ['poorConnection']: (payload: {
3980
+ participantId: string;
3981
+ score: number;
3982
+ kind: string;
3983
+ }) => void;
3984
+ ['pageChanged']: (payload: {
3985
+ viewMode: string;
3986
+ currentPage: number;
3987
+ pageCount: number;
3988
+ }) => void;
3989
+ ['mediaScoreUpdate']: (payload: {
3990
+ kind: string;
3991
+ isScreenshare: boolean;
3992
+ score: number;
3993
+ participantId: string;
3994
+ scoreStats: ConsumerScoreStats;
3995
+ }) => void;
3996
+ ['media_decode_error']: (payload: {
3997
+ reason: string;
3998
+ code: '1702' | '1703';
3999
+ }) => void;
4202
4000
  ['*']: (event: string, ...args: any[]) => void;
4203
4001
  };
4204
- declare class RTKChat$1 extends RTKTypedEventEmitter<ChatEvents> {
4205
- messages: Message[];
4206
- channels: ChatChannel[];
4207
- maxTextLimit: number;
4208
- setMaxTextLimit(limit: number): void;
4209
- constructor(context: Context<RTKContextState>, chatSocketHandler: ChatSocketHandler, chatChannelSocketHandler: ChatChannelSocketHandler, self: RTKSelf$1, participants: RTKParticipants$1);
4002
+ declare class RTKParticipants$1 extends RTKTypedEventEmitter<ParticipantsEvents> {
4003
+ readonly waitlisted: Readonly<RTKParticipantMap$1<Pick<RTKParticipant$1, Exclude<keyof RTKParticipant$1, 'audioTrack' | 'videoTrack' | 'screenShareTracks'>>>>;
4004
+ readonly joined: Readonly<RTKParticipantMap$1>;
4005
+ readonly active: Readonly<RTKParticipantMap$1>;
4006
+ readonly videoSubscribed: Readonly<RTKParticipantMap$1>;
4007
+ readonly audioSubscribed: Readonly<RTKParticipantMap$1>;
4008
+ readonly pinned: Readonly<RTKParticipantMap$1>;
4009
+ readonly all: Readonly<RTKBasicParticipantsMap>;
4010
+ readonly pip: RTKPip;
4011
+ rateLimitConfig: {
4012
+ maxInvocations: number;
4013
+ period: number;
4014
+ };
4210
4015
  readonly rateLimits: {
4211
4016
  maxInvocations: number;
4212
4017
  period: number;
4213
4018
  };
4214
4019
  updateRateLimits(num: number, period: number): void;
4215
- sendTextMessage(message: string, peerIds?: string[]): Promise<void>;
4216
- sendCustomMessage(message: CustomMessagePayload, peerIds?: string[]): Promise<void>;
4217
- sendImageMessage(image: File | ReactNativeFile, peerIds?: string[]): Promise<void>;
4218
- sendFileMessage(file: File | ReactNativeFile, peerIds?: string[]): Promise<void>;
4219
- sendMessage(message: MessagePayload, participantIds?: string[]): Promise<void>;
4220
- editTextMessage(messageId: string, message: string, channelId?: string): Promise<void>;
4221
- editImageMessage(messageId: string, image: File | ReactNativeFile, channelId?: string): Promise<void>;
4222
- editFileMessage(messageId: string, file: File | ReactNativeFile, channelId?: string): Promise<void>;
4223
- editMessage(messageId: string, message: MessagePayload, channelId?: string): Promise<void>;
4224
- deleteMessage(messageId: string, channelId?: string): Promise<void>;
4225
- getMessagesByUser(userId: string): Message[];
4226
- getMessagesByType(type: keyof typeof MessageType): Message[];
4227
- pin(id: string): Promise<void>;
4228
- unpin(id: string): Promise<void>;
4229
- getMessages(timeStamp: number, size: number, reversed: boolean, offset?: number, channelId?: string): Promise<{
4230
- messages: Message[];
4231
- next: boolean;
4232
- }>;
4233
- createChannel(channelName: string, memberIds: string[], options?: {
4234
- displayPictureUrl?: string;
4235
- visibility?: string;
4236
- isDirectMessage?: boolean;
4237
- }): Promise<ChatChannel>;
4238
- updateChannel(channelId: string, payload: UpdateChannelRequestPayload): Promise<ChatChannel>;
4239
- sendMessageToChannel(message: MessagePayload, channelId: string, options?: {
4240
- replyTo?: Message;
4241
- }): Promise<void>;
4242
- getChannelMembers(channelId: string): Promise<RTKBasicParticipant[]>;
4243
- searchMessages(query: string, filters?: SearchFilters): Promise<Message[]>;
4244
- markLastReadMessage(channelId: string, message: Message): Promise<void>;
4245
- readonly pinned: Message[];
4246
- }
4247
- declare class PollSocketHandler {
4248
- constructor(socketService: SocketService);
4249
- getPolls(): Promise<{
4250
- id: string;
4251
- payload: Uint8Array;
4252
- }>;
4253
- createPoll(question: string, options: string[], anonymous?: boolean, hideVotes?: boolean): boolean;
4254
- votePoll(id: string, index: number): boolean;
4255
- on(event: number, handler: (message: UpdatePollResponse) => void): void;
4256
- removeListeners(event: number): void;
4020
+ readonly telemetry: RTKTelemetry;
4021
+ viewMode: ViewMode;
4022
+ currentPage: number;
4023
+ lastActiveSpeaker: string;
4024
+ selectedPeers: RTKSelectedPeers;
4025
+ constructor(context: Context<RTKContextState>, self: RTKSelf$1, roomSocketHandler: RoomSocketHandler);
4026
+ setupEvents(): void;
4027
+ readonly count: number;
4028
+ readonly maxActiveParticipantsCount: number;
4029
+ setMaxActiveParticipantsCount(limit: number): void;
4030
+ readonly pageCount: number;
4031
+ acceptWaitingRoomRequest(id: string): void;
4032
+ acceptAllWaitingRoomRequest(userIds: string[]): Promise<void>;
4033
+ rejectWaitingRoomRequest(id: string): Promise<void>;
4034
+ setViewMode(viewMode: ViewMode): Promise<void>;
4035
+ subscribe(peerIds: string[], kinds?: ('audio' | 'video' | 'screenshareAudio' | 'screenshareVideo')[]): Promise<void>;
4036
+ unsubscribe(peerIds: string[], kinds?: ('audio' | 'video' | 'screenshareAudio' | 'screenshareVideo')[]): Promise<void>;
4037
+ getPeerIdsForCurrentPage(): string[];
4038
+ setPage(page: number): Promise<void>;
4039
+ disableAllAudio(allowUnmute: boolean): Promise<void>;
4040
+ disableAllVideo(): Promise<void>;
4041
+ disableAudio(participantId: string): Promise<void>;
4042
+ disableVideo(participantId: string): Promise<void>;
4043
+ kick(participantId: string): Promise<void>;
4044
+ kickAll(): Promise<void>;
4045
+ broadcastMessage(type: Exclude<string, 'spotlight'>, payload: BroadcastMessagePayload, target?: BroadcastMessageTarget): Promise<void>;
4046
+ getAllJoinedPeers(searchQuery: string, limit: number, offset: number): Promise<{
4047
+ id: string;
4048
+ userId: string;
4049
+ name: string;
4050
+ displayName: string;
4051
+ stageType: StageStatus;
4052
+ customParticipantId: string;
4053
+ presetId: string;
4054
+ picture: string;
4055
+ waitlisted: boolean;
4056
+ stageStatus: StageStatus;
4057
+ metadata: {
4058
+ preset_name: string;
4059
+ };
4060
+ recorderType: string;
4061
+ flags: {
4062
+ hiddenParticipant: boolean;
4063
+ hidden_participant: boolean;
4064
+ recorder: boolean;
4065
+ };
4066
+ }[]>;
4067
+ updatePermissions(participantIds: string[], permissions: PresetUpdates): Promise<void>;
4068
+ getParticipantsInMeetingPreJoin(): Promise<RoomPeersInfoResponse>;
4257
4069
  }
4258
- interface PollOption {
4259
- text: string;
4260
- votes: {
4261
- id: string;
4262
- name: string;
4263
- }[];
4264
- count: number;
4070
+ interface FetchRequestConfig {
4071
+ baseURL?: string;
4072
+ url?: string;
4073
+ method?: string;
4074
+ headers?: Record<string, string>;
4075
+ timeout?: number;
4076
+ retry?: number;
4077
+ retryDelay?: number;
4078
+ responseType?: string;
4079
+ data?: any;
4080
+ params?: Record<string, string>;
4265
4081
  }
4266
- interface Poll {
4267
- id: string;
4268
- question: string;
4269
- options: PollOption[];
4270
- anonymous: boolean;
4271
- hideVotes: boolean;
4272
- createdBy: string;
4273
- createdByUserId: string;
4274
- voted: string[];
4082
+ interface FetchResponse<T = any> {
4083
+ data: T;
4084
+ status: number;
4085
+ statusText: string;
4086
+ headers: Record<string, string>;
4087
+ config: FetchRequestConfig;
4275
4088
  }
4276
- type PollsEvents = {
4277
- ['pollsUpdate']: (payload: {
4278
- polls: Poll[];
4279
- newPoll: boolean;
4280
- }) => void;
4281
- ['*']: (eventName: string, ...args: any[]) => void;
4282
- };
4283
- declare class RTKPolls$1 extends RTKTypedEventEmitter<PollsEvents> {
4284
- items: Poll[];
4285
- constructor(context: Context<RTKContextState>, self: RTKSelf$1, pollSocketHandler: PollSocketHandler);
4286
- create(question: string, options: string[], anonymous?: boolean, hideVotes?: boolean): Promise<void>;
4287
- vote(id: string, index: number): Promise<void>;
4089
+ declare class FetchClient {
4090
+ defaults: {
4091
+ baseURL: string;
4092
+ headers: {
4093
+ common: Record<string, string>;
4094
+ };
4095
+ timeout: number;
4096
+ retry: number;
4097
+ retryDelay: number;
4098
+ };
4099
+ constructor(options: {
4100
+ baseURL: string;
4101
+ timeout: number;
4102
+ retry: number;
4103
+ retryDelay: number;
4104
+ responseType?: string;
4105
+ });
4106
+ request<T = any>(config: FetchRequestConfig): Promise<FetchResponse<T>>;
4107
+ get<T = any>(url: string, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
4108
+ post<T = any>(url: string, data?: any, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
4109
+ put<T = any>(url: string, data?: any, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
4288
4110
  }
4289
- type PluginMapEvents = {
4290
- ['pluginAdded']: (plugin: RTKPlugin$1) => void;
4291
- ['pluginDeleted']: (plugin: RTKPlugin$1) => void;
4292
- };
4293
- type PluginEvents$1 = {
4294
- ['stateUpdate']: (payload: {
4295
- active: boolean;
4296
- pluginId: string;
4297
- bind?: (...args: any[]) => void;
4298
- views: any;
4299
- }) => void;
4300
- ['ready']: () => void;
4301
- ['closed']: () => void;
4302
- ['toggleViewMode']: (...args: any[]) => void;
4303
- ['enabled']: () => void;
4111
+ type LivestreamState = 'IDLE' | 'STARTING' | 'WAITING_ON_MANUAL_INGESTION' | 'LIVESTREAMING' | 'STOPPING';
4112
+ type LivestreamEvents = {
4113
+ ['livestreamUpdate']: (state: LivestreamState) => void;
4114
+ ['viewerCountUpdate']: (count: number) => void;
4304
4115
  ['*']: (eventName: string, ...args: any[]) => void;
4305
4116
  };
4306
- declare class RTKPluginMap$1<T extends RTKPlugin$1 = RTKPlugin$1> extends RTKMap<PluginEvents$1, T, PluginMapEvents> {
4307
- constructor();
4308
- add(plugin: T, emitEvent?: boolean): this;
4309
- delete(pluginId: string, emitEvent?: boolean, removeListeners?: boolean): boolean;
4310
- }
4311
- declare class RTKPlugins$1 {
4312
- readonly all: RTKPluginMap$1;
4313
- readonly active: RTKPluginMap$1;
4314
- constructor();
4315
- }
4316
- type PluginSocketMessage = DisablePluginResponse | EnablePluginResponse | PluginEventResponse | PluginStoreResponse | SendChatMessageToPeersResponse | SendChatMessageToRoomResponse;
4317
- declare class PluginSocketHandler {
4318
- constructor(socketService: SocketService);
4319
- addPlugin(pluginId: string, staggered: boolean): void;
4320
- removePlugin(pluginId: string): void;
4321
- getActivePlugins(): Promise<EnablePluginsResponse>;
4322
- customPluginEventToRoom(pluginId: string, data: any, messageId?: string): void;
4323
- customPluginEventToPeers(pluginId: string, peerIds: string[], data: any, messageId?: string): void;
4324
- enablePluginForRoom(pluginId: string, messageId?: string): void;
4325
- enablePluginForPeers(pluginId: string, peerIds: string[], messageId?: string): void;
4326
- disablePluginForRoom(pluginId: string, messageId?: string): void;
4327
- disablePluginForPeers(pluginId: string, peerIds: string[], messageId?: string): void;
4328
- storeInsertKeys(pluginId: string, store: string, insertKeys: {
4329
- key: string;
4330
- payload?: any;
4331
- }[], messageId?: string): void;
4332
- storeGetKeys(pluginId: string, store: string, getKeys: {
4333
- key: string;
4334
- }[], messageId?: string): void;
4335
- storeDeleteKeys(pluginId: string, store: string, deleteKeys: {
4336
- key: string;
4337
- }[], messageId?: string): void;
4338
- storeDelete(pluginId: string, store: string, messageId?: string): void;
4339
- getPluginDataOld(pluginId: string, store: string): void;
4340
- storePluginDataOld(pluginId: string, store: string, data: any): void;
4341
- on(event: number, handler: (socketMessage: PluginSocketMessage, messageId?: string) => void): void;
4342
- }
4343
- declare class RTKSelfMedia extends RTKTypedEventEmitter<SelfEvents> {
4344
- init(options?: {
4345
- video?: boolean;
4346
- audio?: boolean;
4347
- constraints?: MediaConstraints;
4348
- }, skipAwaits?: boolean, context?: Context<RTKContextState>): Promise<void>;
4349
- readonly audioTrack: MediaStreamTrack;
4350
- readonly rawAudioTrack: MediaStreamTrack;
4351
- readonly mediaPermissions: {
4352
- audio?: MediaPermission$1;
4353
- video?: MediaPermission$1;
4354
- screenshare?: MediaPermission$1;
4355
- };
4356
- addAudioMiddleware(audioMiddleware: AudioMiddleware): Promise<{
4357
- success: boolean;
4358
- message: string;
4359
- }>;
4360
- removeAudioMiddleware(audioMiddleware: AudioMiddleware): Promise<{
4361
- success: boolean;
4362
- message: string;
4363
- }>;
4364
- removeAllAudioMiddlewares(): Promise<{
4365
- success: boolean;
4366
- message: string;
4367
- }>;
4368
- readonly videoTrack: MediaStreamTrack;
4369
- readonly rawVideoTrack: MediaStreamTrack;
4370
- addVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<{
4371
- success: boolean;
4372
- message: string;
4373
- }>;
4374
- setVideoMiddlewareGlobalConfig(config?: VideoMiddlewareGlobalConfig): Promise<void>;
4375
- removeVideoMiddleware(videoMiddleware: VideoMiddleware): Promise<{
4376
- success: boolean;
4377
- message: string;
4378
- }>;
4379
- removeAllVideoMiddlewares(): Promise<{
4380
- success: boolean;
4381
- message: string;
4382
- }>;
4383
- readonly screenShareTracks: {
4384
- audio: MediaStreamTrack;
4385
- video: MediaStreamTrack;
4386
- };
4387
- readonly audioEnabled: boolean;
4388
- readonly videoEnabled: boolean;
4389
- readonly screenShareEnabled: boolean;
4390
- enableAudio(): Promise<void>;
4391
- enableVideo(): Promise<void>;
4392
- disableAudio(): Promise<void>;
4393
- enableScreenShare(): Promise<void>;
4394
- disableScreenShare(): Promise<void>;
4395
- disableVideo(): Promise<void>;
4396
- getCurrentDevices(): {
4397
- audio: MediaDeviceInfo;
4398
- video: MediaDeviceInfo;
4399
- speaker: MediaDeviceInfo;
4400
- };
4401
- getAudioDevices(): Promise<MediaDeviceInfo[]>;
4402
- getVideoDevices(): Promise<MediaDeviceInfo[]>;
4403
- getSpeakerDevices(): Promise<MediaDeviceInfo[]>;
4404
- getDeviceById(deviceId: string, kind: 'audio' | 'video' | 'speaker'): Promise<MediaDeviceInfo>;
4405
- setDevice(device: MediaDeviceInfo): Promise<void>;
4406
- }
4407
- type RecordingState = 'IDLE' | 'STARTING' | 'RECORDING' | 'PAUSED' | 'STOPPING';
4408
- type RecordingType = 'BROWSER' | 'TRACK' | 'COMPOSITE';
4409
- type RecordingInfo = {
4410
- state: RecordingState;
4411
- id: string;
4412
- type: RecordingType;
4117
+ type StartLivestreamConfig = {
4118
+ manualIngestion: boolean;
4413
4119
  };
4414
- type RecordingEvents = {
4415
- ['recordingUpdate']: (state: RecordingState) => void;
4416
- ['*']: (eventName: string, ...args: any[]) => void;
4120
+ interface LivestreamIngestionCredentials {
4121
+ ingestionServer: string;
4122
+ streamKey: string;
4123
+ }
4124
+ type LivestreamResponse = {
4125
+ status: string;
4126
+ playbackUrl: string;
4127
+ manualIngest: boolean;
4128
+ ingestionCredentials?: LivestreamIngestionCredentials;
4417
4129
  };
4418
- declare class RTKRecording$1 extends RTKTypedEventEmitter<RecordingEvents> {
4419
- recordingPeerIds: string[];
4420
- readonly recordingState: RecordingState;
4421
- recordings: RecordingInfo[];
4130
+ declare class RTKLivestream$1 extends RTKTypedEventEmitter<LivestreamEvents> {
4131
+ state: LivestreamState;
4132
+ playbackUrl: string | undefined;
4133
+ ingestionCredentials: LivestreamIngestionCredentials;
4134
+ viewerCount: number;
4135
+ readonly telemetry: RTKTelemetry;
4422
4136
  constructor(context: Context<RTKContextState>, self: RTKSelf);
4423
- updateRecordings(recordings: RecordingInfo[]): void;
4424
- start(opts?: {
4425
- allowMultiple: boolean;
4426
- }): Promise<void>;
4427
- stop(recordingId?: string): Promise<void>;
4428
- pause(recordingId?: string): Promise<void>;
4429
- resume(recordingId?: string): Promise<void>;
4137
+ setLivestreamState(livestreamState: LivestreamState): void;
4138
+ start(livestreamConfig?: StartLivestreamConfig): Promise<void>;
4139
+ stop(): Promise<void>;
4430
4140
  }
4431
- declare class BrowserDetection {
4432
- _bowser: any;
4433
- _name: any;
4434
- _version: any;
4435
- init(browserInfo?: any): void;
4436
- getName(): any;
4437
- isChrome(): boolean;
4438
- isOpera(): boolean;
4439
- isFirefox(): boolean;
4440
- isIExplorer(): boolean;
4441
- isSafari(): boolean;
4442
- isNWJS(): boolean;
4443
- isElectron(): boolean;
4444
- isReactNative(): boolean;
4445
- getVersion(): any;
4446
- isMobile(): boolean;
4447
- getDeviceInfo: () => {
4448
- isMobile: boolean;
4449
- browserName: any;
4450
- osName: any;
4451
- browserVersion: any;
4452
- osVersionName: any;
4453
- engineName: any;
4141
+ type PluginSocketMessage = DisablePluginResponse | EnablePluginResponse | PluginEventResponse | PluginStoreResponse | SendChatMessageToPeersResponse | SendChatMessageToRoomResponse;
4142
+ declare class PluginSocketHandler {
4143
+ constructor(context: Context<RTKContextState>, socketService: SocketService);
4144
+ readonly logger: RTKLogger$1;
4145
+ addPlugin(pluginId: string, staggered: boolean): void;
4146
+ removePlugin(pluginId: string): void;
4147
+ getActivePlugins(): Promise<EnablePluginsResponse>;
4148
+ customPluginEventToRoom(pluginId: string, data: any, messageId?: string): void;
4149
+ customPluginEventToPeers(pluginId: string, peerIds: string[], data: any, messageId?: string): void;
4150
+ enablePluginForRoom(pluginId: string, messageId?: string): void;
4151
+ enablePluginForPeers(pluginId: string, peerIds: string[], messageId?: string): void;
4152
+ disablePluginForRoom(pluginId: string, messageId?: string): void;
4153
+ disablePluginForPeers(pluginId: string, peerIds: string[], messageId?: string): void;
4154
+ storeInsertKeys(pluginId: string, store: string, insertKeys: {
4155
+ key: string;
4156
+ payload?: any;
4157
+ }[], messageId?: string): void;
4158
+ storeGetKeys(pluginId: string, store: string, getKeys: {
4159
+ key: string;
4160
+ }[], messageId?: string): void;
4161
+ storeDeleteKeys(pluginId: string, store: string, deleteKeys: {
4162
+ key: string;
4163
+ }[], messageId?: string): void;
4164
+ storeDelete(pluginId: string, store: string, messageId?: string): void;
4165
+ getPluginDataOld(pluginId: string, store: string): void;
4166
+ storePluginDataOld(pluginId: string, store: string, data: any): void;
4167
+ on(event: number, handler: (socketMessage: PluginSocketMessage, messageId?: string) => void): void;
4168
+ }
4169
+ interface RTKPluginResponse {
4170
+ baseURL: string;
4171
+ createdAt: string;
4172
+ description: string;
4173
+ id: string;
4174
+ name: string;
4175
+ organizationId: string;
4176
+ picture: string;
4177
+ private: boolean;
4178
+ published: boolean;
4179
+ staggered: boolean;
4180
+ tags: string[];
4181
+ type: string;
4182
+ updatedAt: string;
4183
+ }
4184
+ interface PluginViews {
4185
+ [viewId: string]: {
4186
+ url: string;
4187
+ suggestedPosition: string;
4454
4188
  };
4455
- _checkCondition(checkTree: any): any;
4456
- isVersionGreaterThan(version: any): any;
4457
- isVersionLessThan(version: any): any;
4458
- isVersionEqualTo(version: any): any;
4459
4189
  }
4460
- declare class BrowserCapabilities extends BrowserDetection {
4461
- doesVideoMuteByStreamRemove(): boolean;
4462
- supportsP2P(): boolean;
4463
- isChromiumBased(): boolean;
4464
- isWebKitBased(): boolean;
4465
- isSupported(): boolean;
4466
- isUserInteractionRequiredForUnmute(): any;
4467
- supportsVideoMuteOnConnInterrupted(): boolean;
4468
- supportsBandwidthStatistics(): boolean;
4469
- supportsCodecPreferences(): boolean;
4470
- supportsDeviceChangeEvent(): boolean;
4471
- supportsLocalCandidateRttStatistics(): boolean;
4472
- supportsPerformanceObserver(): boolean;
4473
- supportsReceiverStats(): boolean;
4474
- supportsRTTStatistics(): boolean;
4475
- usesPlanB(): boolean;
4476
- usesSdpMungingForSimulcast(): boolean;
4477
- usesUnifiedPlan(): boolean;
4478
- usesNewGumFlow(): boolean;
4479
- usesAdapter(): boolean;
4480
- usesRidsForSimulcast(): boolean;
4481
- supportsGetDisplayMedia(): boolean;
4482
- supportsInsertableStreams(): boolean;
4483
- supportsAudioRed(): boolean;
4484
- supportsSdpSemantics(): boolean;
4485
- _getChromiumBasedVersion(): number;
4486
- isIOSMobile(): boolean;
4190
+ interface PluginConfig {
4191
+ name: string;
4192
+ pluginId: string;
4193
+ version: string;
4194
+ description: string;
4195
+ author?: string;
4196
+ repository?: string;
4197
+ tags?: string[];
4198
+ picture?: string;
4199
+ url?: string;
4200
+ files: {
4201
+ include: string[];
4202
+ exclude?: string[];
4203
+ };
4204
+ views?: PluginViews;
4205
+ contentScript?: string;
4206
+ permissions?: {
4207
+ [key: string]: {
4208
+ default: boolean;
4209
+ description: string;
4210
+ };
4211
+ };
4212
+ config?: {
4213
+ [key: string]: string;
4214
+ };
4487
4215
  }
4488
- declare class RTKFeatures {
4489
- constructor(context: Context<RTKContextState>);
4490
- hasFeature(featureName: string): boolean;
4491
- getFeatureValue(featureName: string): _dyteinternals_utils.RTKFlagValues;
4492
- getAllFeatures(): {
4493
- [x: string]: _dyteinternals_utils.RTKFlagsEntry;
4494
- };
4216
+ interface PluginIframeMessage {
4217
+ type: number;
4218
+ uuid: string;
4219
+ payload?: any;
4495
4220
  }
4496
- declare function createSafeToLogError(ex: any): {
4497
- stack?: string;
4498
- message?: string;
4499
- name?: string;
4500
- reason?: string;
4501
- code?: number | string;
4221
+ interface SendDataOptions {
4222
+ eventName: string;
4223
+ data: any;
4224
+ }
4225
+ interface ReactNativeWebViewEvent {
4226
+ nativeEvent: {
4227
+ data: string;
4228
+ };
4229
+ }
4230
+ interface ReactNativeWebView {
4231
+ src: string;
4232
+ allow: string;
4233
+ title: string;
4234
+ props: {
4235
+ onMessage: (event: ReactNativeWebViewEvent) => void;
4236
+ };
4237
+ postMessage: (message: string) => void;
4238
+ }
4239
+ declare const PluginEventKeys: {
4240
+ stateUpdate: string;
4241
+ ready: string;
4242
+ closed: string;
4243
+ toggleViewMode: string;
4244
+ enabled: string;
4245
+ '* ': string;
4502
4246
  };
4503
- declare const enum PRODUCERS_TYPE {
4504
- WEBCAM = "webcam",
4505
- WEBCAM_BACKUP = "webcam_backup",
4506
- MIC = "mic",
4507
- SCREENSHARE_VIDEO = "screenshare_video",
4508
- SCREENSHARE_AUDIO = "screenshare_audio"
4247
+ type _string = string & {
4248
+ _?: any;
4249
+ };
4250
+ type PluginEvents$1 = keyof typeof PluginEventKeys | _string;
4251
+ declare class RTKPlugin$1 extends RTKEventEmitter<PluginEvents$1> {
4252
+ readonly baseURL: string;
4253
+ readonly createdAt: Date;
4254
+ readonly description: string;
4255
+ readonly id: string;
4256
+ readonly name: string;
4257
+ readonly organizationId: string;
4258
+ readonly picture: string;
4259
+ readonly private: boolean;
4260
+ readonly published: boolean;
4261
+ readonly staggered: boolean;
4262
+ readonly tags: string[];
4263
+ readonly type: string;
4264
+ readonly updatedAt: Date;
4265
+ config?: PluginConfig;
4266
+ active: boolean;
4267
+ iframes: Map<string, {
4268
+ iframe: HTMLIFrameElement | ReactNativeWebView;
4269
+ listener?: (message: MessageEvent) => void;
4270
+ }>;
4271
+ enabledBy: string;
4272
+ readonly telemetry: RTKTelemetry;
4273
+ 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);
4274
+ sendIframeEvent(message: PluginIframeMessage): void;
4275
+ sendData(payload: SendDataOptions): void;
4276
+ removePluginView(viewId?: string): void;
4277
+ addPluginView(iframe: HTMLIFrameElement | ReactNativeWebView, viewId?: string): void;
4278
+ activateForSelf(): Promise<void>;
4279
+ deactivateForSelf(): void;
4280
+ enable(): Promise<void>;
4281
+ disable(): void;
4282
+ activate(): Promise<void>;
4283
+ deactivate(): Promise<void>;
4509
4284
  }
4510
- type SupportedEventSeverities = 'info' | 'error' | 'debug' | 'log' | 'warn';
4511
- type LogData$2 = {
4512
- error?: ReturnType<typeof createSafeToLogError>;
4513
- peers?: string;
4514
- flags?: string | {
4515
- [key: string]: {
4516
- enabled: boolean;
4517
- value: string | number | boolean;
4518
- };
4519
- };
4520
- devices?: string | MediaDeviceInfo[];
4521
- debuggingHint?: string;
4522
- constraints?: string | RTKMediaStreamConstraints;
4523
- timeout?: number;
4524
- execTime?: number;
4525
- country?: string;
4526
- media?: {
4527
- audio?: {
4528
- enabled: boolean;
4529
- deviceName?: string;
4530
- deviceId?: string;
4531
- trackId?: string;
4532
- permission?: keyof typeof MediaPermission;
4533
- canProduce?: MediaProductionPermissionType;
4534
- };
4535
- video?: {
4536
- enabled?: boolean;
4537
- deviceName?: string;
4538
- deviceId?: string;
4539
- trackId?: string;
4540
- permission?: keyof typeof MediaPermission;
4541
- canProduce?: MediaProductionPermissionType;
4542
- layer?: number;
4543
- };
4544
- screenshare?: {
4545
- enabled: boolean;
4546
- count?: number;
4547
- maxAllowedCount?: number;
4548
- permission?: keyof typeof MediaPermission;
4549
- deviceName?: string;
4550
- deviceId?: string;
4551
- audio?: {
4552
- enabled: boolean;
4553
- trackId?: string;
4554
- };
4555
- video?: {
4556
- enabled: boolean;
4557
- trackId?: string;
4558
- };
4559
- canProduce?: MediaProductionPermissionType;
4560
- };
4561
- };
4562
- producerInfo?: {
4563
- peerId: string;
4564
- producers: ProducerState[];
4565
- };
4566
- preferredDevice?: {
4567
- kind: 'audio' | 'video';
4568
- preferredDeviceId?: string;
4569
- lastUsedPreferredDeviceId?: string;
4570
- };
4571
- mediaPermissionsErrors?: {
4572
- kind: 'audio' | 'video' | 'screenshare';
4573
- message: string;
4574
- deviceId?: string;
4575
- };
4576
- pip?: {
4577
- id: string;
4578
- handRaised?: boolean;
4579
- source?: any;
4580
- };
4581
- memoize?: {
4582
- doubleInvoked?: {
4583
- property: string;
4584
- };
4585
- };
4586
- dyteClientInitOptions?: RealtimeKitClientOptions;
4587
- plugin?: {
4588
- id?: string;
4589
- name?: string;
4590
- enabledBy?: string;
4591
- duration?: number;
4592
- storeName?: string;
4593
- data?: any;
4594
- };
4595
- roomJoined?: boolean;
4596
- transport?: {
4597
- id?: string;
4598
- type?: 'send' | 'recv';
4599
- status?: RTCPeerConnectionState | 'reconnecting';
4600
- lastDisconnectedTime?: string;
4601
- lastDisconnectedTimeOffset?: number;
4602
- durationPassed?: number;
4603
- remoteOfferAnswer?: RTCSessionDescriptionInit;
4604
- serverId?: string;
4605
- };
4606
- iceCandidate?: RTCIceCandidate;
4607
- iceRestart?: {
4608
- status?: RTCPeerConnectionState | 'reconnecting';
4609
- isSendTransport?: boolean;
4610
- isRecvTransport?: boolean;
4611
- currentAttempt?: number;
4612
- };
4613
- producer?: {
4614
- id: string;
4615
- peerId?: string;
4616
- kind: 'audio' | 'video' | PRODUCERS_TYPE;
4617
- status?: 'initializing' | 'producing' | 'paused' | 'failed' | 'closing' | 'closed' | 'UNKNOWN';
4618
- appData: {
4619
- screenShare?: boolean;
4620
- supportsRemoteControl?: boolean;
4621
- };
4622
- error?: string;
4623
- closureReason?: string;
4624
- remoteAnswer?: SessionDescription;
4625
- trackId?: string;
4626
- };
4627
- consumer?: {
4628
- id: string;
4629
- peerId?: string;
4630
- kind?: string;
4631
- appData?: {
4632
- screenShare?: boolean;
4633
- supportsRemoteControl?: boolean;
4634
- };
4635
- remotelyPaused?: boolean;
4636
- producerId?: string;
4637
- closureReason?: string;
4638
- sessionDescription?: RTCSessionDescriptionInit;
4639
- };
4640
- consumerIds?: string[];
4641
- consumerState?: ConsumerState;
4642
- consumerStateMap?: {
4643
- [key: string]: ConsumerState;
4644
- };
4645
- rtcChannel?: {
4646
- label?: string;
4647
- message?: DCMessage;
4648
- messageStringified?: string;
4649
- };
4650
- localStorage?: {
4651
- key?: string;
4652
- value?: string;
4653
- };
4654
- spotlight?: {
4655
- spotlighter?: {
4656
- id?: string;
4657
- };
4658
- currentTab?: {
4659
- id?: string;
4660
- type?: ActiveTabType;
4661
- };
4662
- };
4663
- networkCall?: {
4664
- status?: number;
4665
- statusText?: string;
4666
- baseURL?: string;
4667
- url?: string;
4668
- retries?: number;
4669
- method?: string;
4670
- isOnline?: string;
4671
- ip?: any;
4672
- timezone?: string;
4673
- };
4674
- ipInfo?: {
4675
- city: string;
4676
- country: string;
4677
- region: string;
4678
- loc: string;
4679
- timezone: string;
4680
- ip: string;
4681
- postal: string;
4682
- };
4683
- dytePolls?: {
4684
- hasQuestion?: boolean;
4685
- optionsLength?: number;
4686
- };
4687
- dyteChat?: {
4688
- imageType?: string;
4689
- messageType?: string;
4690
- };
4691
- dyteParticipant?: {
4692
- id: string;
4693
- };
4694
- actions?: {
4695
- disableAllAudio?: {
4696
- allowUnmute?: boolean;
4697
- };
4698
- trackRobustness?: {
4699
- reacquireTrack?: boolean;
4700
- eventType?: string;
4701
- };
4702
- };
4703
- recording?: {
4704
- id?: string;
4705
- state?: RecordingState;
4706
- };
4707
- selectedPeer?: {
4708
- oldIndex?: number;
4709
- newIndex?: number;
4710
- peerId?: string;
4711
- };
4712
- pageNavigation?: {
4713
- viewMode: ViewMode;
4714
- currentPage: number;
4715
- pageCount: number;
4716
- maxActiveParticipantsCount: number;
4717
- settingPage?: number;
4718
- };
4719
- connectedMeetings?: {
4720
- movement?: {
4721
- sourceMeetingId?: string;
4722
- destinationMeetingId?: string;
4723
- totalParticipantsToMove?: number;
4724
- };
4725
- };
4726
- webinar?: {
4727
- stageStatus?: StageStatus;
4728
- };
4729
- livestream?: {
4730
- stageStatus?: StageStatus;
4731
- latency?: number;
4732
- };
4733
- moduleExists?: {
4734
- self?: boolean;
4735
- };
4736
- performanceObserver?: {
4737
- api: PerformanceEntry;
4738
- };
4739
- dyteLocker?: {
4740
- methodName: string;
4741
- lockName: string;
4742
- };
4743
- socket?: {
4744
- retryAttempt: number;
4745
- };
4746
- connectionState?: {
4747
- joinAttempted: boolean;
4748
- };
4749
- source?: string;
4750
- eventListener?: {
4751
- eventName: string;
4752
- listenerCount: number;
4753
- };
4754
- dataChannelMessageChunk?: {
4285
+ interface RecordingConfig {
4286
+ fileNamePrefix?: string;
4287
+ videoConfig?: {
4288
+ height?: number;
4289
+ width?: number;
4290
+ codec?: string;
4291
+ };
4292
+ }
4293
+ interface ReactNativeFile {
4294
+ uri: string;
4295
+ name: string;
4296
+ type: string;
4297
+ }
4298
+ declare class APIClient extends API {
4299
+ telemetry: RTKTelemetry;
4300
+ constructor(context: Context<RTKContextState>, options?: APIOptions);
4301
+ getIPDetails(): Promise<any>;
4302
+ getICEServers(): Promise<any>;
4303
+ getPlugins(): Promise<any[]>;
4304
+ getPluginDetails(pluginId: string): Promise<RTKPluginResponse>;
4305
+ getPluginConfig(pluginBaseUrl: string): Promise<PluginConfig>;
4306
+ authorizePlugin(pluginId: string): Promise<string>;
4307
+ getPresignedUrls(filename: string, viewType: string): Promise<{
4308
+ getLocation: any;
4309
+ putLocation: any;
4310
+ }>;
4311
+ uploadFile(file: File | ReactNativeFile, url: string): Promise<void>;
4312
+ startLivestreaming({ manualIngestion, }: StartLivestreamConfig): Promise<LivestreamResponse>;
4313
+ stopLivestreaming(): Promise<FetchResponse<any>>;
4314
+ getActiveLivestream(): Promise<LivestreamResponse>;
4315
+ getUserDetails(): Promise<UserDetailsResponseV2>;
4316
+ startRecording(config: RecordingConfig, allowMultiple?: boolean): Promise<string>;
4317
+ updateRecording(recordingId: string, action: 'stop' | 'pause' | 'resume'): Promise<FetchResponse<any>>;
4318
+ getActiveRecording(): Promise<{
4319
+ status: string;
4755
4320
  id: string;
4756
- count: number;
4757
- chunkIndex: number;
4758
- chunk: string;
4759
- transprtId: string;
4760
- };
4761
- peerIds?: string[];
4762
- producers?: ProducerState[];
4763
- sdp?: RTCSessionDescription['sdp'];
4764
- awaitQueueTask?: {
4765
- id?: string | number;
4766
- metadata?: Record<string, unknown>;
4767
- queueSizeAtStart?: number;
4768
- taskStartTime?: number;
4769
- execTime?: number;
4770
- };
4321
+ }>;
4322
+ getActiveTranscript(): Promise<{
4323
+ transcript: string;
4324
+ }>;
4325
+ getRoomNodeData(): Promise<RoomDetails>;
4326
+ }
4327
+ declare enum MessageType {
4328
+ text = "text",
4329
+ image = "image",
4330
+ file = "file",
4331
+ custom = "custom",
4332
+ poll = "poll"
4333
+ }
4334
+ interface BaseMessage<T extends MessageType> {
4335
+ type: T;
4336
+ userId: string;
4337
+ displayName: string;
4338
+ time: Date;
4339
+ timeMs?: number;
4340
+ id: string;
4341
+ isEdited?: boolean;
4342
+ read?: boolean;
4343
+ pluginId?: string;
4344
+ pinned?: boolean;
4345
+ targetUserIds?: string[];
4346
+ channelId?: string;
4347
+ channelIndex?: string;
4348
+ }
4349
+ interface TextMessage extends BaseMessage<MessageType.text> {
4350
+ message: string;
4351
+ }
4352
+ interface CustomMessage extends BaseMessage<MessageType.custom> {
4353
+ message?: string;
4354
+ html?: string;
4355
+ files?: {
4356
+ link: string;
4357
+ type?: string;
4358
+ name?: string;
4359
+ size?: number;
4360
+ }[];
4361
+ images?: {
4362
+ link: string;
4363
+ type?: string;
4364
+ name?: string;
4365
+ size?: number;
4366
+ }[];
4367
+ videos?: {
4368
+ link: string;
4369
+ type?: string;
4370
+ name?: string;
4371
+ size?: number;
4372
+ }[];
4373
+ }
4374
+ interface ImageMessage extends BaseMessage<MessageType.image> {
4375
+ link: string;
4376
+ }
4377
+ interface FileMessage extends BaseMessage<MessageType.file> {
4378
+ name: string;
4379
+ size: number;
4380
+ link: string;
4381
+ }
4382
+ type Message = TextMessage | ImageMessage | FileMessage | CustomMessage;
4383
+ interface TextMessagePayload {
4384
+ type: 'text';
4385
+ message: string;
4386
+ replyTo?: TextMessage;
4387
+ }
4388
+ interface CustomMessagePayload {
4389
+ type: 'custom';
4390
+ message?: string;
4391
+ html?: string;
4392
+ files?: (File | string)[];
4393
+ images?: (File | string)[];
4394
+ videos?: (File | string)[];
4395
+ replyTo?: TextMessage;
4396
+ }
4397
+ interface ImageMessagePayload {
4398
+ type: 'image';
4399
+ image: File;
4400
+ }
4401
+ interface FileMessagePayload {
4402
+ type: 'file';
4403
+ file: File;
4404
+ }
4405
+ type MessagePayload = TextMessagePayload | ImageMessagePayload | FileMessagePayload | CustomMessagePayload;
4406
+ interface ChatUpdateParams {
4407
+ action: 'add' | 'edit' | 'delete';
4408
+ message: Message | {
4409
+ id: string;
4410
+ channelId: string;
4411
+ };
4412
+ messages: Message[];
4413
+ }
4414
+ type ChatEvents = {
4415
+ ['chatUpdate']: (payload: ChatUpdateParams) => void;
4416
+ ['pinMessage']: (payload: Pick<ChatUpdateParams, Exclude<keyof ChatUpdateParams, 'action'>>) => void;
4417
+ ['unpinMessage']: (payload: Pick<ChatUpdateParams, Exclude<keyof ChatUpdateParams, 'action'>>) => void;
4418
+ ['channelCreate']: (channel: ChatChannel) => void;
4419
+ ['channelMessageUpdate']: (channel: ChatChannel) => void;
4420
+ ['channelUpdate']: (channel?: ChatChannel) => void;
4421
+ ['*']: (event: string, ...args: any[]) => void;
4771
4422
  };
4772
- type EventSeverities = SupportedEventSeverities;
4773
- type LogData$1 = LogData$2;
4774
- declare class RTKTelemetry {
4775
- static logsCache: {
4776
- [key: string]: any;
4777
- }[];
4778
- static logsProcessorTimer: NodeJS.Timer;
4779
- static location: {
4780
- country: string;
4781
- };
4782
- static readonly logsEndpoint: string;
4783
- static tracingEnabled: boolean;
4784
- static initialized: boolean;
4785
- static readonly logsProcessingInterval = 7000;
4786
- static logExclusionList: string[];
4787
- static meetingMetadata: {
4788
- peerId?: string;
4789
- roomName?: string;
4790
- organizationId?: string;
4791
- sdkVersion?: string;
4792
- deviceInfo?: object;
4793
- visitedUrl?: string;
4794
- userId?: string;
4423
+ declare class RTKChat$1 extends RTKTypedEventEmitter<ChatEvents> {
4424
+ messages: Message[];
4425
+ channels: ChatChannel[];
4426
+ maxTextLimit: number;
4427
+ readonly telemetry: RTKTelemetry;
4428
+ setMaxTextLimit(limit: number): void;
4429
+ constructor(context: Context<RTKContextState>, chatSocketHandler: ChatSocketHandler, chatChannelSocketHandler: ChatChannelSocketHandler, self: RTKSelf$1, participants: RTKParticipants$1);
4430
+ readonly rateLimits: {
4431
+ maxInvocations: number;
4432
+ period: number;
4795
4433
  };
4796
- static resetPeerId(peerId: string): void;
4797
- static init(context: Context<RTKContextState>, enableTracing: boolean): void;
4798
- static trace(spanName: string, metadata?: LogData$1 | undefined): (_target: Object, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
4799
- static injectContext(injectionReceiver: any): void;
4800
- static addLogInCurrentSpan(eventSeverity: EventSeverities, eventName: string, metadata?: LogData$1, noCache?: boolean): void;
4801
- static sendOtelLogsToNewRelic(logs: object[]): void;
4802
- static processCachedLogs(): void;
4803
- static destruct(): void;
4434
+ updateRateLimits(num: number, period: number): void;
4435
+ sendTextMessage(message: string, peerIds?: string[]): Promise<void>;
4436
+ sendCustomMessage(message: CustomMessagePayload, peerIds?: string[]): Promise<void>;
4437
+ sendImageMessage(image: File | ReactNativeFile, peerIds?: string[]): Promise<void>;
4438
+ sendFileMessage(file: File | ReactNativeFile, peerIds?: string[]): Promise<void>;
4439
+ sendMessage(message: MessagePayload, participantIds?: string[]): Promise<void>;
4440
+ editTextMessage(messageId: string, message: string, channelId?: string): Promise<void>;
4441
+ editImageMessage(messageId: string, image: File | ReactNativeFile, channelId?: string): Promise<void>;
4442
+ editFileMessage(messageId: string, file: File | ReactNativeFile, channelId?: string): Promise<void>;
4443
+ editMessage(messageId: string, message: MessagePayload, channelId?: string): Promise<void>;
4444
+ deleteMessage(messageId: string, channelId?: string): Promise<void>;
4445
+ getMessagesByUser(userId: string): Message[];
4446
+ getMessagesByType(type: keyof typeof MessageType): Message[];
4447
+ pin(id: string): Promise<void>;
4448
+ unpin(id: string): Promise<void>;
4449
+ getMessages(timeStamp: number, size: number, reversed: boolean, offset?: number, channelId?: string): Promise<{
4450
+ messages: Message[];
4451
+ next: boolean;
4452
+ }>;
4453
+ createChannel(channelName: string, memberIds: string[], options?: {
4454
+ displayPictureUrl?: string;
4455
+ visibility?: string;
4456
+ isDirectMessage?: boolean;
4457
+ }): Promise<ChatChannel>;
4458
+ updateChannel(channelId: string, payload: UpdateChannelRequestPayload): Promise<ChatChannel>;
4459
+ sendMessageToChannel(message: MessagePayload, channelId: string, options?: {
4460
+ replyTo?: Message;
4461
+ }): Promise<void>;
4462
+ getChannelMembers(channelId: string): Promise<RTKBasicParticipant[]>;
4463
+ searchMessages(query: string, filters?: SearchFilters): Promise<Message[]>;
4464
+ markLastReadMessage(channelId: string, message: Message): Promise<void>;
4465
+ readonly pinned: Message[];
4466
+ }
4467
+ declare class PollSocketHandler {
4468
+ readonly logger: RTKLogger$1;
4469
+ readonly telemetry: RTKTelemetry;
4470
+ constructor(context: Context<RTKContextState>, socketService: SocketService);
4471
+ getPolls(): Promise<{
4472
+ id: string;
4473
+ payload: Uint8Array;
4474
+ }>;
4475
+ createPoll(question: string, options: string[], anonymous?: boolean, hideVotes?: boolean): boolean;
4476
+ votePoll(id: string, index: number): boolean;
4477
+ on(event: number, handler: (message: UpdatePollResponse) => void): void;
4478
+ removeListeners(event: number): void;
4479
+ }
4480
+ interface PollOption {
4481
+ text: string;
4482
+ votes: {
4483
+ id: string;
4484
+ name: string;
4485
+ }[];
4486
+ count: number;
4487
+ }
4488
+ interface Poll {
4489
+ id: string;
4490
+ question: string;
4491
+ options: PollOption[];
4492
+ anonymous: boolean;
4493
+ hideVotes: boolean;
4494
+ createdBy: string;
4495
+ createdByUserId: string;
4496
+ voted: string[];
4497
+ }
4498
+ type PollsEvents = {
4499
+ ['pollsUpdate']: (payload: {
4500
+ polls: Poll[];
4501
+ newPoll: boolean;
4502
+ }) => void;
4503
+ ['*']: (eventName: string, ...args: any[]) => void;
4504
+ };
4505
+ declare class RTKPolls$1 extends RTKTypedEventEmitter<PollsEvents> {
4506
+ items: Poll[];
4507
+ constructor(context: Context<RTKContextState>, self: RTKSelf$1, pollSocketHandler: PollSocketHandler);
4508
+ create(question: string, options: string[], anonymous?: boolean, hideVotes?: boolean): Promise<void>;
4509
+ vote(id: string, index: number): Promise<void>;
4510
+ }
4511
+ type PluginMapEvents = {
4512
+ ['pluginAdded']: (plugin: RTKPlugin$1) => void;
4513
+ ['pluginDeleted']: (plugin: RTKPlugin$1) => void;
4514
+ };
4515
+ type PluginEvents = {
4516
+ ['stateUpdate']: (payload: {
4517
+ active: boolean;
4518
+ pluginId: string;
4519
+ bind?: (...args: any[]) => void;
4520
+ views: any;
4521
+ }) => void;
4522
+ ['ready']: () => void;
4523
+ ['closed']: () => void;
4524
+ ['toggleViewMode']: (...args: any[]) => void;
4525
+ ['enabled']: () => void;
4526
+ ['*']: (eventName: string, ...args: any[]) => void;
4527
+ };
4528
+ declare class RTKPluginMap$1<T extends RTKPlugin$1 = RTKPlugin$1> extends RTKMap<PluginEvents, T, PluginMapEvents> {
4529
+ constructor(logger: RTKLogger$1);
4530
+ add(plugin: T, emitEvent?: boolean): this;
4531
+ delete(pluginId: string, emitEvent?: boolean, removeListeners?: boolean): boolean;
4532
+ }
4533
+ declare class RTKPlugins$1 {
4534
+ readonly all: RTKPluginMap$1;
4535
+ readonly active: RTKPluginMap$1;
4536
+ constructor(logger: RTKLogger);
4537
+ }
4538
+ type RecordingState = 'IDLE' | 'STARTING' | 'RECORDING' | 'PAUSED' | 'STOPPING';
4539
+ type RecordingType = 'BROWSER' | 'TRACK' | 'COMPOSITE';
4540
+ type RecordingInfo = {
4541
+ state: RecordingState;
4542
+ id: string;
4543
+ type: RecordingType;
4544
+ };
4545
+ type RecordingEvents = {
4546
+ ['recordingUpdate']: (state: RecordingState) => void;
4547
+ ['*']: (eventName: string, ...args: any[]) => void;
4548
+ };
4549
+ declare class RTKRecording$1 extends RTKTypedEventEmitter<RecordingEvents> {
4550
+ recordingPeerIds: string[];
4551
+ readonly recordingState: RecordingState;
4552
+ recordings: RecordingInfo[];
4553
+ constructor(context: Context<RTKContextState>, self: RTKSelf);
4554
+ readonly telemetry: RTKTelemetry;
4555
+ updateRecordings(recordings: RecordingInfo[]): void;
4556
+ start(opts?: {
4557
+ allowMultiple: boolean;
4558
+ }): Promise<void>;
4559
+ stop(recordingId?: string): Promise<void>;
4560
+ pause(recordingId?: string): Promise<void>;
4561
+ resume(recordingId?: string): Promise<void>;
4804
4562
  }
4805
- type LogData = LogData$1;
4806
- declare class RTKLogger$1 {
4807
- static info(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
4808
- static error(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
4809
- static debug(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
4810
- static log(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
4811
- static warn(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
4563
+ declare class BrowserDetection {
4564
+ _bowser: any;
4565
+ _name: any;
4566
+ _version: any;
4567
+ init(browserInfo?: any): void;
4568
+ getName(): any;
4569
+ isChrome(): boolean;
4570
+ isOpera(): boolean;
4571
+ isFirefox(): boolean;
4572
+ isIExplorer(): boolean;
4573
+ isSafari(): boolean;
4574
+ isNWJS(): boolean;
4575
+ isElectron(): boolean;
4576
+ isReactNative(): boolean;
4577
+ getVersion(): any;
4578
+ isMobile(): boolean;
4579
+ getDeviceInfo: () => {
4580
+ isMobile: boolean;
4581
+ browserName: any;
4582
+ osName: any;
4583
+ browserVersion: any;
4584
+ osVersionName: any;
4585
+ engineName: any;
4586
+ };
4587
+ _checkCondition(checkTree: any): any;
4588
+ isVersionGreaterThan(version: any): any;
4589
+ isVersionLessThan(version: any): any;
4590
+ isVersionEqualTo(version: any): any;
4591
+ }
4592
+ declare class BrowserCapabilities extends BrowserDetection {
4593
+ doesVideoMuteByStreamRemove(): boolean;
4594
+ supportsP2P(): boolean;
4595
+ isChromiumBased(): boolean;
4596
+ isWebKitBased(): boolean;
4597
+ isSupported(): boolean;
4598
+ isUserInteractionRequiredForUnmute(): any;
4599
+ supportsVideoMuteOnConnInterrupted(): boolean;
4600
+ supportsBandwidthStatistics(): boolean;
4601
+ supportsCodecPreferences(): boolean;
4602
+ supportsDeviceChangeEvent(): boolean;
4603
+ supportsLocalCandidateRttStatistics(): boolean;
4604
+ supportsPerformanceObserver(): boolean;
4605
+ supportsReceiverStats(): boolean;
4606
+ supportsRTTStatistics(): boolean;
4607
+ usesPlanB(): boolean;
4608
+ usesSdpMungingForSimulcast(): boolean;
4609
+ usesUnifiedPlan(): boolean;
4610
+ usesNewGumFlow(): boolean;
4611
+ usesAdapter(): boolean;
4612
+ usesRidsForSimulcast(): boolean;
4613
+ supportsGetDisplayMedia(): boolean;
4614
+ supportsInsertableStreams(): boolean;
4615
+ supportsAudioRed(): boolean;
4616
+ supportsSdpSemantics(): boolean;
4617
+ _getChromiumBasedVersion(): number;
4618
+ isIOSMobile(): boolean;
4619
+ }
4620
+ declare class RTKFeatures {
4621
+ constructor(context: Context<RTKContextState>);
4622
+ hasFeature(featureName: string): boolean;
4623
+ getFeatureValue(featureName: string): _dyteinternals_utils.RTKFlagValues;
4624
+ getAllFeatures(): {
4625
+ [x: string]: _dyteinternals_utils.RTKFlagsEntry;
4626
+ };
4812
4627
  }
4813
4628
  declare class RTKInternals {
4814
4629
  logger: typeof RTKLogger$1;
@@ -4867,6 +4682,13 @@ declare class RTKStoreManager {
4867
4682
  constructor(context: Context<RTKContextState>, handler: PluginSocketHandler);
4868
4683
  create(name: string): Promise<RTKStore$1>;
4869
4684
  }
4685
+ declare const enum PRODUCERS_TYPE {
4686
+ WEBCAM = "webcam",
4687
+ WEBCAM_BACKUP = "webcam_backup",
4688
+ MIC = "mic",
4689
+ SCREENSHARE_VIDEO = "screenshare_video",
4690
+ SCREENSHARE_AUDIO = "screenshare_audio"
4691
+ }
4870
4692
  interface MediaPermissions {
4871
4693
  canProduceAudio?: MediaProductionPermissionType;
4872
4694
  canProduceVideo?: MediaProductionPermissionType;
@@ -4886,6 +4708,8 @@ declare class MediaNodeClient {
4886
4708
  readonly authToken: string;
4887
4709
  readonly e2ee: boolean;
4888
4710
  readonly peerId: string;
4711
+ readonly telemetry: RTKTelemetry;
4712
+ readonly logger: RTKLogger$1;
4889
4713
  constructor(context: Context<RTKContextState>, nodeType: MediaNodeType, options: MediaNodeClientOptions);
4890
4714
  mediaJoined: boolean;
4891
4715
  reset(): void;
@@ -5081,7 +4905,7 @@ interface DefaultOptions {
5081
4905
  video?: boolean;
5082
4906
  audio?: boolean;
5083
4907
  recording?: RecordingConfig;
5084
- mediaHandler?: RTKSelfMedia;
4908
+ mediaHandler?: RTKSelfMedia$1;
5085
4909
  autoSwitchAudioDevice?: boolean;
5086
4910
  mediaConfiguration?: {
5087
4911
  video?: VideoQualityConstraints;
@@ -5199,7 +5023,7 @@ declare const ERROR_CODES: {
5199
5023
  };
5200
5024
  declare class RTKError extends Error {
5201
5025
  code: keyof typeof ERROR_CODES;
5202
- constructor(message: string, code?: keyof typeof ERROR_CODES, log?: boolean);
5026
+ constructor(message: string, code?: keyof typeof ERROR_CODES, logger?: RTKLogger$1 | undefined, log?: boolean);
5203
5027
  }
5204
5028
  type EventMap = {
5205
5029
  [key: string]: (...args: any[]) => void;
@@ -5332,7 +5156,7 @@ declare class AudioPlaybackManager extends AudioPlayback {
5332
5156
  removeParticipantTrack(participantId: string): void;
5333
5157
  }
5334
5158
  type RTKContextState = {
5335
- authToken: string;
5159
+ authToken?: string;
5336
5160
  peerId?: string;
5337
5161
  apiBase?: string;
5338
5162
  baseURI?: string;
@@ -5368,6 +5192,8 @@ type RTKContextState = {
5368
5192
  audioPlayback?: AudioPlaybackManager;
5369
5193
  options?: RealtimeKitClientOptions;
5370
5194
  self?: RTKSelf;
5195
+ telemetry?: RTKTelemetry;
5196
+ logger?: RTKLogger$1;
5371
5197
  meeting?: RealtimeKitClient;
5372
5198
  };
5373
5199
  interface Context<T extends Record<string, any>> {
@@ -5391,277 +5217,487 @@ declare class SocketService {
5391
5217
  readonly authToken: string;
5392
5218
  readonly capabilities: SocketServiceCapabilities;
5393
5219
  joinAttempted: boolean;
5220
+ readonly telemetry: RTKTelemetry;
5221
+ readonly logger: RTKLogger$1;
5394
5222
  readonly peerId: string;
5395
5223
  constructor(context: Context<RTKContextState>, { peerId, meetingId, authToken, capabilities, }: {
5224
+ peerId: string;
5225
+ meetingId: string;
5226
+ authToken: string;
5227
+ capabilities: SocketServiceCapabilities;
5228
+ });
5229
+ updateURL(peerID: string): void;
5230
+ readonly url: string;
5231
+ connect(): Promise<void>;
5232
+ disconnect(): Promise<void>;
5233
+ readonly isConnected: boolean;
5234
+ sendMessage(event: number, protobuf?: Uint8Array, messageId?: string): boolean;
5235
+ sendMessagePromise(event: number, protobuf?: Uint8Array, messageId?: string, resp?: number): Promise<{
5236
+ id: string;
5237
+ payload: Uint8Array;
5238
+ }>;
5239
+ sendMessagePromiseWithTimeout({ event, timeout, protobuf, messageId, resp, }: {
5240
+ timeout: number;
5241
+ event: number;
5242
+ protobuf?: Uint8Array;
5243
+ messageId?: string;
5244
+ resp?: number;
5245
+ }): Promise<{
5246
+ id: string;
5247
+ payload: Uint8Array;
5248
+ }>;
5249
+ on(event: number, listener: (message: {
5250
+ id?: string;
5251
+ payload?: Uint8Array;
5252
+ }) => void): void;
5253
+ onStateEvent(event: SocketStateEvent, listener: (...args: any) => void): void;
5254
+ removeListener(event: number, listener: (message: {
5255
+ id?: string;
5256
+ payload?: Uint8Array;
5257
+ }) => void): void;
5258
+ removeListeners(event: number): void;
5259
+ flush(): any;
5260
+ handleSocketConnectionEvents(): void;
5261
+ }
5262
+ type EventHandlerTypes = PeerInfoResponse | GetWaitingRoomRequests | RecordingEvent | UpdatePeersPresetResponse | PeerJoinBroadcastResponse | PeerJoinCompleteResponse | GlobalPeerPinningBroadcastResponse | PeerLeaveResponse | SelectedPeersResponse | SelectedPeersDiffResponse;
5263
+ declare class RoomSocketHandler {
5264
+ socket: SocketService;
5265
+ readonly telemetry: RTKTelemetry;
5266
+ readonly logger: RTKLogger$1;
5267
+ cleanup(): Promise<void>;
5268
+ constructor(context: Context<RTKContextState>, socketService: SocketService);
5269
+ joinRoom(opts: {
5270
+ name: string;
5271
+ id: string;
5272
+ userId: string;
5273
+ customParticipantId: string;
5274
+ picture?: string;
5275
+ }): Promise<{
5276
+ peer: Peer;
5277
+ }>;
5278
+ getAllAddedParticipants(): Promise<RTKBasicParticipant[]>;
5279
+ getRoomPeers(searchQuery: string, limit: number, offset: number): Promise<RoomPeersInfoResponse>;
5280
+ getRoomPeersNonPaginated(): Promise<RoomPeersInfoResponse>;
5281
+ getStagePeers(): Promise<RoomPeersInfoResponse>;
5282
+ getPeerInfo(peerId: string): Promise<PeerInfoResponse>;
5283
+ getRoomState(): Promise<RoomInfoResponse>;
5284
+ getRoomStageState(): Promise<GetRoomStageStateResponse>;
5285
+ broadcastMessage(type: string, payload: BroadcastMessagePayload): Promise<{
5286
+ id: string;
5287
+ payload: Uint8Array;
5288
+ }>;
5289
+ broadcastToMeetings(type: string, meetingIds: string[], payload: BroadcastMessagePayload): Promise<{
5290
+ id: string;
5291
+ payload: Uint8Array;
5292
+ }>;
5293
+ broadcastToPeers(type: string, peerIds: string[], payload: BroadcastMessagePayload): Promise<boolean>;
5294
+ leaveRoom(): Promise<void>;
5295
+ kick(peerId: string): Promise<void>;
5296
+ kickAll(propagateKickAll?: boolean): Promise<void>;
5297
+ getWaitingRoomRequests(): void;
5298
+ acceptWaitingRoomRequest(userIds: string[]): void;
5299
+ rejectWaitingRoomRequest(userIds: string[]): void;
5300
+ updatePermissions(userIds: string[], patch: PresetUpdates): Promise<{
5301
+ id: string;
5302
+ payload: Uint8Array;
5303
+ }>;
5304
+ on(event: number, handler: (message: EventHandlerTypes) => void): void;
5305
+ getUserPermissions(userId: string): Promise<Pick<PresetTypeV2['permissions'], 'chat' | 'polls' | 'plugins'>>;
5306
+ }
5307
+ interface DeviceConfig {
5308
+ browserName: string;
5309
+ browserVersion: string;
5310
+ isMobile: boolean;
5311
+ engineName: string;
5312
+ osName: string;
5313
+ }
5314
+ interface ProducerState {
5315
+ producerId: string;
5316
+ kind: 'audio' | 'video';
5317
+ pause: boolean;
5318
+ screenShare: boolean;
5319
+ producingTransportId: string;
5320
+ producingPeerId: string;
5321
+ mimeType?: string;
5322
+ }
5323
+ interface Participant {
5324
+ id: string;
5325
+ userId: string;
5326
+ displayName: string;
5327
+ device?: DeviceConfig;
5328
+ picture?: string;
5329
+ isHost: boolean;
5330
+ flags: {
5331
+ [key: string]: string | boolean;
5332
+ };
5333
+ clientSpecificId?: string;
5334
+ customParticipantId?: string;
5335
+ stageStatus?: StageStatus;
5336
+ audioMuted: boolean;
5337
+ audioTrack: MediaStreamTrack;
5338
+ videoTrack: MediaStreamTrack;
5339
+ videoEnabled: boolean;
5340
+ producers?: ProducerState[];
5341
+ metadata?: {
5342
+ preset_name?: string;
5343
+ };
5344
+ recorderType?: string;
5345
+ }
5346
+ declare class RTKParticipant$1 extends RTKTypedEventEmitter<ParticipantEvents> {
5347
+ id: string;
5348
+ userId: string;
5349
+ name: string;
5350
+ picture: string;
5351
+ isHost: boolean;
5352
+ customParticipantId?: string;
5353
+ readonly clientSpecificId: string;
5354
+ flags: {
5355
+ [key: string]: string | boolean;
5356
+ };
5357
+ device: DeviceConfig;
5358
+ videoTrack: MediaStreamTrack;
5359
+ audioTrack: MediaStreamTrack;
5360
+ screenShareTracks: {
5361
+ audio: MediaStreamTrack;
5362
+ video: MediaStreamTrack;
5363
+ };
5364
+ videoEnabled: boolean;
5365
+ audioEnabled: boolean;
5366
+ screenShareEnabled: boolean;
5367
+ producers: ProducerState[];
5368
+ manualProducerConfig: PeerProducerConfig;
5369
+ supportsRemoteControl: boolean;
5370
+ presetName?: string;
5371
+ readonly stageStatus: StageStatus;
5372
+ readonly telemetry: RTKTelemetry;
5373
+ constructor(context: Context<RTKContextState>, participant: Participant, self: RTKSelf, roomSocket: RoomSocketHandler);
5374
+ setVideoEnabled(videoEnabled: boolean, emitEvent?: boolean): void;
5375
+ setAudioEnabled(audioEnabled: boolean, emitEvent?: boolean): void;
5376
+ setScreenShareEnabled(screenShareEnabled: boolean, emitEvent?: boolean): void;
5377
+ pin(): Promise<void>;
5378
+ unpin(): Promise<void>;
5379
+ setIsPinned(isPinned: boolean, emitEvent?: boolean): void;
5380
+ disableAudio(): Promise<void>;
5381
+ kick(): Promise<void>;
5382
+ disableVideo(): Promise<void>;
5383
+ getPermissions(): Promise<Pick<_dyteinternals_utils.Permissions, "plugins" | "polls" | "chat">>;
5384
+ setStageStatus(stageStatus: StageStatus): void;
5385
+ readonly isPinned: boolean;
5386
+ registerVideoElement(videoElem: HTMLVideoElement): void;
5387
+ deregisterVideoElement(videoElem?: HTMLVideoElement): void;
5388
+ }
5389
+ declare function createSafeToLogError(ex: any): {
5390
+ stack?: string;
5391
+ message?: string;
5392
+ name?: string;
5393
+ reason?: string;
5394
+ code?: number | string;
5395
+ };
5396
+ type SupportedEventSeverities = 'info' | 'error' | 'debug' | 'log' | 'warn';
5397
+ type LogData$2 = {
5398
+ error?: ReturnType<typeof createSafeToLogError>;
5399
+ peers?: string;
5400
+ flags?: string | {
5401
+ [key: string]: {
5402
+ enabled: boolean;
5403
+ value: string | number | boolean;
5404
+ };
5405
+ };
5406
+ devices?: string | MediaDeviceInfo[];
5407
+ debuggingHint?: string;
5408
+ constraints?: string | RTKMediaStreamConstraints;
5409
+ timeout?: number;
5410
+ execTime?: number;
5411
+ country?: string;
5412
+ media?: {
5413
+ audio?: {
5414
+ enabled: boolean;
5415
+ deviceName?: string;
5416
+ deviceId?: string;
5417
+ trackId?: string;
5418
+ permission?: keyof typeof MediaPermission;
5419
+ canProduce?: MediaProductionPermissionType;
5420
+ };
5421
+ video?: {
5422
+ enabled?: boolean;
5423
+ deviceName?: string;
5424
+ deviceId?: string;
5425
+ trackId?: string;
5426
+ permission?: keyof typeof MediaPermission;
5427
+ canProduce?: MediaProductionPermissionType;
5428
+ layer?: number;
5429
+ };
5430
+ screenshare?: {
5431
+ enabled: boolean;
5432
+ count?: number;
5433
+ maxAllowedCount?: number;
5434
+ permission?: keyof typeof MediaPermission;
5435
+ deviceName?: string;
5436
+ deviceId?: string;
5437
+ audio?: {
5438
+ enabled: boolean;
5439
+ trackId?: string;
5440
+ };
5441
+ video?: {
5442
+ enabled: boolean;
5443
+ trackId?: string;
5444
+ };
5445
+ canProduce?: MediaProductionPermissionType;
5446
+ };
5447
+ };
5448
+ producerInfo?: {
5396
5449
  peerId: string;
5397
- meetingId: string;
5398
- authToken: string;
5399
- capabilities: SocketServiceCapabilities;
5400
- });
5401
- updateURL(peerID: string): void;
5402
- readonly url: string;
5403
- connect(): Promise<void>;
5404
- disconnect(): Promise<void>;
5405
- readonly isConnected: boolean;
5406
- sendMessage(event: number, protobuf?: Uint8Array, messageId?: string): boolean;
5407
- sendMessagePromise(event: number, protobuf?: Uint8Array, messageId?: string, resp?: number): Promise<{
5408
- id: string;
5409
- payload: Uint8Array;
5410
- }>;
5411
- sendMessagePromiseWithTimeout({ event, timeout, protobuf, messageId, resp, }: {
5412
- timeout: number;
5413
- event: number;
5414
- protobuf?: Uint8Array;
5415
- messageId?: string;
5416
- resp?: number;
5417
- }): Promise<{
5450
+ producers: ProducerState[];
5451
+ };
5452
+ preferredDevice?: {
5453
+ kind: 'audio' | 'video';
5454
+ preferredDeviceId?: string;
5455
+ lastUsedPreferredDeviceId?: string;
5456
+ };
5457
+ mediaPermissionsErrors?: {
5458
+ kind: 'audio' | 'video' | 'screenshare';
5459
+ message: string;
5460
+ deviceId?: string;
5461
+ };
5462
+ pip?: {
5418
5463
  id: string;
5419
- payload: Uint8Array;
5420
- }>;
5421
- on(event: number, listener: (message: {
5464
+ handRaised?: boolean;
5465
+ source?: any;
5466
+ };
5467
+ memoize?: {
5468
+ doubleInvoked?: {
5469
+ property: string;
5470
+ };
5471
+ };
5472
+ dyteClientInitOptions?: RealtimeKitClientOptions;
5473
+ plugin?: {
5422
5474
  id?: string;
5423
- payload?: Uint8Array;
5424
- }) => void): void;
5425
- onStateEvent(event: SocketStateEvent, listener: (...args: any) => void): void;
5426
- removeListener(event: number, listener: (message: {
5475
+ name?: string;
5476
+ enabledBy?: string;
5477
+ duration?: number;
5478
+ storeName?: string;
5479
+ data?: any;
5480
+ };
5481
+ roomJoined?: boolean;
5482
+ transport?: {
5427
5483
  id?: string;
5428
- payload?: Uint8Array;
5429
- }) => void): void;
5430
- removeListeners(event: number): void;
5431
- flush(): any;
5432
- handleSocketConnectionEvents(): void;
5433
- }
5434
- type StageSocketMessage = GetStageRequestsResponse | GetStagePeersResponse | DenyStageAccessRequest | PeerStatusUpdate;
5435
- declare class StageSocketHandler {
5436
- constructor(socketService: SocketService);
5437
- getStageRequests(): Promise<GetStageRequestsResponse>;
5438
- requestAccess(): void;
5439
- cancelRequestAccess(): void;
5440
- grantAccess(userIds: string[]): Promise<void>;
5441
- denyAccess(userIds: string[]): Promise<void>;
5442
- joinStage(): Promise<{
5443
- id: string;
5444
- payload: Uint8Array;
5445
- }>;
5446
- leaveStage(userId: string): Promise<{
5447
- id: string;
5448
- payload: Uint8Array;
5449
- }>;
5450
- kick(userIds: string[]): Promise<{
5451
- id: string;
5452
- payload: Uint8Array;
5453
- }>;
5454
- on(event: number, handler: (socketMessage: StageSocketMessage, messageId?: string) => void): void;
5455
- getPeerInfo(peerId: string): Promise<PeerInfoResponse>;
5456
- }
5457
- type StageStatus = 'OFF_STAGE' | 'REQUESTED_TO_JOIN_STAGE' | 'ACCEPTED_TO_JOIN_STAGE' | 'ON_STAGE';
5458
- interface StageRequestPayload {
5459
- displayName: string;
5460
- userId: string;
5461
- peerId: string;
5462
- }
5463
- type StageEvents = {
5464
- ['stageAccessRequestUpdate']: (requests?: StageRequestPayload[]) => void;
5465
- ['stageStatusUpdate']: (status: StageStatus) => void;
5466
- ['newStageRequest']: (payload: {
5467
- count: number;
5468
- }) => void;
5469
- ['stageRequestApproved']: () => void;
5470
- ['stageRequestRejected']: () => void;
5471
- ['*']: (eventName: string, ...args: any[]) => void;
5472
- };
5473
- declare class RTKStage extends RTKTypedEventEmitter<StageEvents> {
5474
- constructor(context: Context<RTKContextState>, self: RTKSelf$1, participants: RTKParticipants, stageSocketHandler: StageSocketHandler, roomSocketHandler: RoomSocketHandler);
5475
- readonly status: StageStatus;
5476
- getAccessRequests(): {
5477
- stageRequests: StageRequestPayload[];
5484
+ type?: 'send' | 'recv';
5485
+ status?: RTCPeerConnectionState | 'reconnecting';
5486
+ lastDisconnectedTime?: string;
5487
+ lastDisconnectedTimeOffset?: number;
5488
+ durationPassed?: number;
5489
+ remoteOfferAnswer?: RTCSessionDescriptionInit;
5490
+ serverId?: string;
5491
+ };
5492
+ iceCandidate?: RTCIceCandidate;
5493
+ iceRestart?: {
5494
+ status?: RTCPeerConnectionState | 'reconnecting';
5495
+ isSendTransport?: boolean;
5496
+ isRecvTransport?: boolean;
5497
+ currentAttempt?: number;
5498
+ };
5499
+ producer?: {
5500
+ id: string;
5501
+ peerId?: string;
5502
+ kind: 'audio' | 'video' | PRODUCERS_TYPE;
5503
+ status?: 'initializing' | 'producing' | 'paused' | 'failed' | 'closing' | 'closed' | 'UNKNOWN';
5504
+ appData: {
5505
+ screenShare?: boolean;
5506
+ supportsRemoteControl?: boolean;
5507
+ };
5508
+ error?: string;
5509
+ closureReason?: string;
5510
+ remoteAnswer?: SessionDescription;
5511
+ trackId?: string;
5512
+ };
5513
+ consumer?: {
5514
+ id: string;
5515
+ peerId?: string;
5516
+ kind?: string;
5517
+ appData?: {
5518
+ screenShare?: boolean;
5519
+ supportsRemoteControl?: boolean;
5520
+ };
5521
+ remotelyPaused?: boolean;
5522
+ producerId?: string;
5523
+ closureReason?: string;
5524
+ sessionDescription?: RTCSessionDescriptionInit;
5525
+ };
5526
+ consumerIds?: string[];
5527
+ consumerState?: ConsumerState;
5528
+ consumerStateMap?: {
5529
+ [key: string]: ConsumerState;
5530
+ };
5531
+ rtcChannel?: {
5532
+ label?: string;
5533
+ message?: DCMessage;
5534
+ messageStringified?: string;
5535
+ };
5536
+ localStorage?: {
5537
+ key?: string;
5538
+ value?: string;
5539
+ };
5540
+ spotlight?: {
5541
+ spotlighter?: {
5542
+ id?: string;
5543
+ };
5544
+ currentTab?: {
5545
+ id?: string;
5546
+ type?: ActiveTabType;
5547
+ };
5548
+ };
5549
+ networkCall?: {
5550
+ status?: number;
5551
+ statusText?: string;
5552
+ baseURL?: string;
5553
+ url?: string;
5554
+ retries?: number;
5555
+ method?: string;
5556
+ isOnline?: string;
5557
+ ip?: any;
5558
+ timezone?: string;
5559
+ };
5560
+ ipInfo?: {
5561
+ city: string;
5562
+ country: string;
5563
+ region: string;
5564
+ loc: string;
5565
+ timezone: string;
5566
+ ip: string;
5567
+ postal: string;
5568
+ };
5569
+ dytePolls?: {
5570
+ hasQuestion?: boolean;
5571
+ optionsLength?: number;
5572
+ };
5573
+ dyteChat?: {
5574
+ imageType?: string;
5575
+ messageType?: string;
5576
+ };
5577
+ dyteParticipant?: {
5578
+ id: string;
5579
+ };
5580
+ actions?: {
5581
+ disableAllAudio?: {
5582
+ allowUnmute?: boolean;
5583
+ };
5584
+ trackRobustness?: {
5585
+ reacquireTrack?: boolean;
5586
+ eventType?: string;
5587
+ };
5588
+ };
5589
+ recording?: {
5590
+ id?: string;
5591
+ state?: RecordingState;
5592
+ };
5593
+ selectedPeer?: {
5594
+ oldIndex?: number;
5595
+ newIndex?: number;
5596
+ peerId?: string;
5478
5597
  };
5479
- requestAccess(): Promise<void>;
5480
- cancelRequestAccess(): Promise<void>;
5481
- grantAccess(userIds: string[]): Promise<void>;
5482
- denyAccess(userIds: string[]): Promise<void>;
5483
- join(): Promise<void>;
5484
- leave(): Promise<void>;
5485
- kick(userIds: string[]): Promise<{
5598
+ pageNavigation?: {
5599
+ viewMode: ViewMode;
5600
+ currentPage: number;
5601
+ pageCount: number;
5602
+ maxActiveParticipantsCount: number;
5603
+ settingPage?: number;
5604
+ };
5605
+ connectedMeetings?: {
5606
+ movement?: {
5607
+ sourceMeetingId?: string;
5608
+ destinationMeetingId?: string;
5609
+ totalParticipantsToMove?: number;
5610
+ };
5611
+ };
5612
+ webinar?: {
5613
+ stageStatus?: StageStatus;
5614
+ };
5615
+ livestream?: {
5616
+ stageStatus?: StageStatus;
5617
+ latency?: number;
5618
+ };
5619
+ moduleExists?: {
5620
+ self?: boolean;
5621
+ };
5622
+ performanceObserver?: {
5623
+ api: PerformanceEntry;
5624
+ };
5625
+ dyteLocker?: {
5626
+ methodName: string;
5627
+ lockName: string;
5628
+ };
5629
+ socket?: {
5630
+ retryAttempt: number;
5631
+ };
5632
+ connectionState?: {
5633
+ joinAttempted: boolean;
5634
+ };
5635
+ source?: string;
5636
+ eventListener?: {
5637
+ eventName: string;
5638
+ listenerCount: number;
5639
+ };
5640
+ dataChannelMessageChunk?: {
5486
5641
  id: string;
5487
- payload: Uint8Array;
5488
- }>;
5489
- }
5490
- interface UserDetailsResponse {
5491
- id: string;
5492
- name: string;
5493
- email: string;
5494
- picture?: string;
5495
- loggedIn?: boolean;
5496
- scope?: string[];
5497
- clientSpecificId?: string;
5498
- customParticipantId?: string;
5642
+ count: number;
5643
+ chunkIndex: number;
5644
+ chunk: string;
5645
+ transprtId: string;
5646
+ };
5647
+ peerIds?: string[];
5648
+ producers?: ProducerState[];
5649
+ sdp?: RTCSessionDescription['sdp'];
5650
+ awaitQueueTask?: {
5651
+ id?: string | number;
5652
+ metadata?: Record<string, unknown>;
5653
+ queueSizeAtStart?: number;
5654
+ taskStartTime?: number;
5655
+ execTime?: number;
5656
+ };
5657
+ };
5658
+ type EventSeverities = SupportedEventSeverities;
5659
+ type LogData$1 = LogData$2;
5660
+ interface MeetingMetadata {
5661
+ peerId?: string;
5662
+ roomName?: string;
5499
5663
  organizationId?: string;
5664
+ sdkVersion?: string;
5665
+ deviceInfo?: object;
5666
+ visitedUrl?: string;
5667
+ userId?: string;
5500
5668
  }
5501
- declare class RTKSelf$1 extends RTKSelfMedia {
5502
- name: string;
5503
- picture: string;
5504
- customParticipantId: string;
5505
- waitlistStatus: 'accepted' | 'waiting' | 'rejected' | 'none';
5506
- role: any;
5507
- userId: string;
5508
- organizationId: string;
5509
- supportsRemoteControl: boolean;
5510
- device: DeviceConfig;
5511
- hidden: boolean;
5512
- readonly stageStatus: StageStatus;
5513
- readonly id: string;
5514
- presetName: string;
5515
- roomState: 'init' | 'joined' | 'waitlisted' | LeaveRoomState;
5516
- private constructor();
5517
- static __init__(context: Context<RTKContextState>, details: UserDetailsResponse, permissions: RTKPermissionsPreset$1, theme: RTKThemePreset$1, presetName: string, skipAwaits?: boolean): Promise<RTKSelf$1>;
5518
- cleanupEvents(): void;
5519
- readonly permissions: RTKPermissionsPreset$1;
5520
- readonly config: RTKThemePreset$1;
5521
- readonly roomJoined: boolean;
5522
- setName(name: string): void;
5523
- setupTracks(options?: {
5524
- video?: boolean;
5525
- audio?: boolean;
5526
- forceReset?: boolean;
5527
- }): Promise<void>;
5528
- destructMediaHandler(): Promise<void>;
5529
- removeDocumentEventListeners(): Promise<void>;
5530
- enableAudio(customTrack?: MediaStreamTrack): Promise<void>;
5531
- enableVideo(customTrack?: MediaStreamTrack): Promise<void>;
5532
- updateVideoConstraints(resolution: VideoQualityConstraints): Promise<void>;
5533
- enableScreenShare(): Promise<void>;
5534
- updateScreenshareConstraints(resolution: VideoQualityConstraints): Promise<void>;
5535
- disableAudio(): Promise<void>;
5536
- disableVideo(): Promise<void>;
5537
- disableScreenShare(): Promise<void>;
5538
- getAllDevices(): Promise<InputDeviceInfo[]>;
5539
- setIsPinned(isPinned: boolean, emitEvent?: boolean): void;
5540
- readonly isPinned: boolean;
5541
- pin(): Promise<void>;
5542
- unpin(): Promise<void>;
5543
- hide(): Promise<void>;
5544
- show(): void;
5545
- setDevice(device: MediaDeviceInfo): Promise<void>;
5546
- cleanUpTracks(): void;
5547
- playAudio(): Promise<void>;
5548
- registerVideoElement(videoElem: HTMLVideoElement, isPreview?: boolean): void;
5549
- deregisterVideoElement(videoElem?: HTMLVideoElement, isPreview?: boolean): void;
5550
- }
5551
- interface RTKPluginResponse {
5552
- baseURL: string;
5553
- createdAt: string;
5554
- description: string;
5555
- id: string;
5556
- name: string;
5557
- organizationId: string;
5558
- picture: string;
5559
- private: boolean;
5560
- published: boolean;
5561
- staggered: boolean;
5562
- tags: string[];
5563
- type: string;
5564
- updatedAt: string;
5565
- }
5566
- interface PluginViews {
5567
- [viewId: string]: {
5568
- url: string;
5569
- suggestedPosition: string;
5570
- };
5571
- }
5572
- interface PluginConfig {
5573
- name: string;
5574
- pluginId: string;
5575
- version: string;
5576
- description: string;
5577
- author?: string;
5578
- repository?: string;
5579
- tags?: string[];
5580
- picture?: string;
5581
- url?: string;
5582
- files: {
5583
- include: string[];
5584
- exclude?: string[];
5585
- };
5586
- views?: PluginViews;
5587
- contentScript?: string;
5588
- permissions?: {
5589
- [key: string]: {
5590
- default: boolean;
5591
- description: string;
5592
- };
5593
- };
5594
- config?: {
5595
- [key: string]: string;
5596
- };
5597
- }
5598
- interface PluginIframeMessage {
5599
- type: number;
5600
- uuid: string;
5601
- payload?: any;
5602
- }
5603
- interface SendDataOptions {
5604
- eventName: string;
5605
- data: any;
5606
- }
5607
- interface ReactNativeWebViewEvent {
5608
- nativeEvent: {
5609
- data: string;
5610
- };
5611
- }
5612
- interface ReactNativeWebView {
5613
- src: string;
5614
- allow: string;
5615
- title: string;
5616
- props: {
5617
- onMessage: (event: ReactNativeWebViewEvent) => void;
5618
- };
5619
- postMessage: (message: string) => void;
5669
+ declare class RTKTelemetry {
5670
+ logsCache: {
5671
+ [key: string]: any;
5672
+ }[];
5673
+ logsProcessorTimer: NodeJS.Timer;
5674
+ static location: {
5675
+ country: string;
5676
+ };
5677
+ readonly logsEndpoint: string;
5678
+ tracingEnabled: boolean;
5679
+ initialized: boolean;
5680
+ readonly logsProcessingInterval = 7000;
5681
+ logExclusionList: string[];
5682
+ meetingMetadata: MeetingMetadata;
5683
+ resetPeerId(peerId: string): void;
5684
+ init(context: Context<RTKContextState>, options: MeetingMetadata, enableTracing: boolean): void;
5685
+ static trace(spanName: string, metadata?: LogData$1 | undefined): (_target: Object, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
5686
+ injectContext(injectionReceiver: any): void;
5687
+ addLogInCurrentSpan(eventSeverity: EventSeverities, eventName: string, metadata?: LogData$1, noCache?: boolean): void;
5688
+ sendOtelLogsToNewRelic(logs: object[]): void;
5689
+ processCachedLogs(): void;
5690
+ destruct(): void;
5620
5691
  }
5621
- declare const PluginEventKeys: {
5622
- stateUpdate: string;
5623
- ready: string;
5624
- closed: string;
5625
- toggleViewMode: string;
5626
- enabled: string;
5627
- '* ': string;
5628
- };
5629
- type _string = string & {
5630
- _?: any;
5631
- };
5632
- type PluginEvents = keyof typeof PluginEventKeys | _string;
5633
- declare class RTKPlugin$1 extends RTKEventEmitter<PluginEvents> {
5634
- readonly baseURL: string;
5635
- readonly createdAt: Date;
5636
- readonly description: string;
5637
- readonly id: string;
5638
- readonly name: string;
5639
- readonly organizationId: string;
5640
- readonly picture: string;
5641
- readonly private: boolean;
5642
- readonly published: boolean;
5643
- readonly staggered: boolean;
5644
- readonly tags: string[];
5645
- readonly type: string;
5646
- readonly updatedAt: Date;
5647
- config?: PluginConfig;
5648
- active: boolean;
5649
- iframes: Map<string, {
5650
- iframe: HTMLIFrameElement | ReactNativeWebView;
5651
- listener?: (message: MessageEvent) => void;
5652
- }>;
5653
- enabledBy: string;
5654
- 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);
5655
- sendIframeEvent(message: PluginIframeMessage): void;
5656
- sendData(payload: SendDataOptions): void;
5657
- removePluginView(viewId?: string): void;
5658
- addPluginView(iframe: HTMLIFrameElement | ReactNativeWebView, viewId?: string): void;
5659
- activateForSelf(): Promise<void>;
5660
- deactivateForSelf(): void;
5661
- enable(): Promise<void>;
5662
- disable(): void;
5663
- activate(): Promise<void>;
5664
- deactivate(): Promise<void>;
5692
+ type LogData = LogData$1;
5693
+ declare class RTKLogger$1 {
5694
+ readonly telemetry: RTKTelemetry;
5695
+ init(context: Context<RTKContextState>): void;
5696
+ info(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
5697
+ error(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
5698
+ debug(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
5699
+ log(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
5700
+ warn(humanReadableLogIdentifier: string, logData?: LogData, isCrucial?: boolean): void;
5665
5701
  }
5666
5702
  interface IceServerInformation {
5667
5703
  url: string;
@@ -5688,6 +5724,7 @@ declare class API {
5688
5724
  ipInfo: any;
5689
5725
  readonly peerId: string;
5690
5726
  context: Context<RTKContextState>;
5727
+ readonly logger: RTKLogger$1;
5691
5728
  constructor(context: Context<RTKContextState>, options?: APIOptions);
5692
5729
  setAuthToken(token: string, options?: {
5693
5730
  bearer?: boolean;
@@ -5713,6 +5750,12 @@ interface RealtimeKitClientOptions {
5713
5750
  }
5714
5751
  declare class RealtimeKitClient {
5715
5752
  private constructor();
5753
+ readonly peerId: string;
5754
+ static initMedia(options?: {
5755
+ video?: boolean;
5756
+ audio?: boolean;
5757
+ constraints?: MediaConstraints;
5758
+ }, skipAwaits?: boolean, cachedUserDetails?: CachedUserDetails): RTKSelfMedia$1;
5716
5759
  static init(options: RealtimeKitClientOptions): Promise<RealtimeKitClient>;
5717
5760
  join(): Promise<void>;
5718
5761
  leave(state?: LeaveRoomState): Promise<void>;
@@ -5744,6 +5787,7 @@ type RTKPlugins = Readonly<RTKPlugins$1>;
5744
5787
  type RTKPluginMap = Readonly<RTKPluginMap$1>;
5745
5788
  type RTKMeta = Readonly<RTKMeta$1>;
5746
5789
  type RTKSelf = Readonly<RTKSelf$1>;
5790
+ type RTKSelfMedia = Readonly<RTKSelfMedia$1>;
5747
5791
  type RTKChat = Readonly<RTKChat$1>;
5748
5792
  type RTKPolls = Readonly<RTKPolls$1>;
5749
5793
  type RTKRecording = Readonly<RTKRecording$1>;
@@ -5752,6 +5796,7 @@ type RTKStore = RTKStore$1;
5752
5796
  type RTKConnectedMeetings = Readonly<RTKConnectedMeetings$1>;
5753
5797
  type RTKPermissionsPreset = Readonly<RTKPermissionsPreset$1>;
5754
5798
  type RTKThemePreset = Readonly<RTKThemePreset$1>;
5799
+ type RTKLogger = RTKLogger$1;
5755
5800
  type RTKType = {
5756
5801
  callStats?: unknown;
5757
5802
  RTKTelemetry?: typeof RTKTelemetry;
@@ -5769,4 +5814,4 @@ declare global {
5769
5814
  TransformStream?: any;
5770
5815
  }
5771
5816
  }
5772
- 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 };
5817
+ 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, RTKSelfMedia, RTKStore, RTKThemePreset, FileMessage, ImageMessage, JoinedPeer, LeaveRoomState, LivestreamIngestionCredentials, LivestreamState, LogData, MediaConnectionState, MediaConnectionUpdate, MediaKind$1 as MediaKind, MediaPermission, Message, ProducerScoreStats, RecordingState, RequestToJoinType, SocketConnectionState, StageStatus, StartLivestreamConfig, TextMessage, VideoConsumerScoreStats, VideoMiddleware, VideoProducerScoreStats, VideoQualityConstraints, RealtimeKitClient as default, LeaveRoomState as leaveRoomState };