import { AddedRoleToMember, Attachment, AttachmentRequest, AttachmentStatus, Calendar, CalendarEvent, SfuSpaceCategory, ChannelSendPolicy, Chat, ChatMap, ChatMessagesCount, ChatReceivePolicy, ChatType, ConnectionDetails, FirstAndLastChatMessage, InternalMessage, LastReadMessageUpdated, LoadMessagesWithMentionsResult, Message, MessageAttachment, MessageAttachmentData, MessageAttachmentMediaType, MessageAttachmentsSearchResult, MessageStatus, RoomInfo, SfuEvent, SignUpStatus, SortOrder, SfuSpace, SfuSpaceRole, State, UserEmail, UserHostKey, UserId, UserInfo, UserNickname, UserPassword, UserPhoneNumber, UserPmiSettings, UserSpecificChatInfo, UserTimezone, SfuSpaceInvite, SfuSpaceChannel, SpaceRoleDeleted, RemovedRoleFromMember, SfuSpaceThread, SpaceChannelUpdated, SfuSpaceRolePermissionSection, SpaceRoleUpdated, SpaceChannelMoved, SpaceEvent, MessageTargetEntityType, MessageTargetEntityId, MeetingSyncEvent, UnreadMessagesCountEvent, FriendInviteDeleted, UserContacts, PresenceStatus, Contact, ExamplesUser, UserEncryptionInfo, UserChatEncryptedPassword, AddedRemovedReactionOnMessage, AddedMembersToThread, RemovedMemberFromThread, UserSpaceNicknameUpdated, SpaceNotificationSettingsUpdated, ChannelNotificationSettingsUpdated, ThreadNotificationSettingsUpdated, NotificationMode, ChatNotificationSettingsUpdated, ChatMuted, SpaceMuted, ChannelMuted, ThreadMuted, SpaceUnmuted, ChannelUnmuted, ThreadUnmuted, ChatUnmuted, ContactPersonalSettings, MeetingsHistoryEvent, ConferenceType, SystemConfig, AttachmentListResult, AttachmentSizeInfo, AttachmentType } from "./constants"; import { RoomExtended } from "./room-extended"; import { SendingAttachmentsHandler } from "./sending-attachments-handler"; import { PrefixFunction, Verbosity } from "./logger"; import { ResetPasswordHandler } from "./reset-password-handler"; import { RTCMetricsServerDescription } from "@flashphoner/web-sdk-metrics"; export declare type NotifyUnion = InternalMessage | Message | MessageStatus | AttachmentStatus | Calendar | UserSpecificChatInfo | ChatMap | Chat | ArrayBuffer | CalendarEvent | Attachment | UserInfo | Array | Contact; export declare type EventUnion = SfuEvent | SpaceEvent | MeetingSyncEvent; export declare class SfuExtended { #private; constructor(logLevel?: Verbosity, prefix?: PrefixFunction, log?: any); /** * Connects the user to the server. * * The user can connect using either a username and password or an authToken. * * Once the connection is successful, the {@link state} will change to {@link State.AUTHENTICATED}. * After that, the sfu-sdk will emit the event {@link SfuEvent.CONNECTED}. * * @param options.username - The user's username (optional if `authToken` is provided). * @param options.password - The user's password (optional if `authToken` is provided). * @param options.authToken - The authentication token for direct login (optional if `username` and `password` are provided). * * After successfully connection user contacts will receive an {@link SfuEvent.USER_PRESENCE_STATUS_UPDATED} with {@link UserPresenceStatusUpdated} */ connect(options: { url: string; username?: UserId; password?: string; nickname?: UserNickname; timeout?: number; binaryChunkSize?: number; failedProbesThreshold?: number; authToken?: string; pingInterval?: number; device?: string; details?: ConnectionDetails; }): Promise<{ username: UserId; email: UserEmail; nickname: UserNickname; pmi: string; authToken: string; }>; /** * Method to disconnect from the server * * When disconnecting, user leaves all active rooms * * {@link state} changed to {@link State.DISCONNECTED | DISCONNECTED} * * After disconnection user contacts will receive an {@link SfuEvent.USER_PRESENCE_STATUS_UPDATED} with {@link UserPresenceStatusUpdated} */ disconnect(): Promise; /** * Sign up for new users * * Works in a separate connection */ signUp(options: { url: string; timeout?: number; username: string; email: string; password: string; }): Promise; /** * Ensure username available * * If the username is not taken, the promise will resolve with `void`. * * If the username is taken, the promise will reject with {@link UserManagementError.USERNAME_ALREADY_IN_USE}. */ ensureUsernameAvailable(options: { url: string; timeout?: number; username: string; }): Promise; /** * Reset password * * When calls, returns {@link ResetPasswordHandler} then need to call {@link ResetPasswordHandler.resetPassword} to reset the password */ resetPassword(options: { url: string; timeout?: number; email: string; }): Promise; /** * Remove user (internal using) */ removeUser(options: { url: string; timeout?: number; id: string; }): Promise; /** * Logout from app */ logout(): Promise; /** * Load messages for Direct chat | Channel | Thread * * @param params.timeFrame to load by start date to end date. For load all messages used with start = 0, end = -1. * @param params.boundaries to load messages by specifying a particular message using its date, * along with the number of messages above and below it. Upper limit includes message with date dateMark. */ loadMessages(params: { targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; timeFrame?: { start: number; end: number; limit?: number; }; boundaries?: { dateMark: number; lowerLimit: number; upperLimit: number; }; }): Promise; /** * Send a message to a Direct chat | Channel | Thread * * Members will receive {@link SfuEvent.MESSAGE} with {@link Message} * * @param msg.parentId to send reply message * @param msg.to to send a private message */ sendMessage(msg: { body?: string; to?: string; parentId?: string; targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; attachments?: Array; }): Promise; /** * Edit a message in a Direct chat | Channel | Thread * * Members will receive {@link SfuEvent.CHAT_MESSAGE_EDITED} with {@link MessageEdited} * * @param msg.attachmentsToSend to add attachments to sent message * @param msg.attachmentIdsToDelete to send a private message */ editMessage(msg: { targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; messageId: string; body: string; attachmentsToSend?: Array; attachmentIdsToDelete?: string[]; }): Promise; /** * Delete a message in a Direct chat | Channel | Thread * * The message body will be changed to an empty string. * The {@link Message.status} will be changed to {@link MessageState.DELETED} * * Attachments will be removed. * * Members will receive {@link SfuEvent.CHAT_MESSAGE_DELETED} with {@link MessageDeleted} */ deleteMessage(msg: { targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; messageId: string; }): Promise; /** * Add reaction on message in a Direct chat | Channel | Thread * * Members will receive {@link SfuEvent.REACTION_ON_MESSAGE_ADDED} with {@link AddedRemovedReactionOnMessage} */ addReactionOnMessage(msg: { targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; messageId: string; reaction: string; }): Promise; /** * Remove reaction on message in a Direct chat | Channel | Thread * * Members will receive {@link SfuEvent.REACTION_ON_MESSAGE_REMOVED} with {@link AddedRemovedReactionOnMessage} */ removeReactionOnMessage(msg: { targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; messageId: string; reaction: string; }): Promise; /** * Mark message as read in a Direct chat | Channel | Thread * * In targetEntity will change lastReadMessageId and lastReadMessageDate * * All unread messages with a {@link Message.date} earlier than or equal to the marked one will be marked as read. * The sender of each message will receive {@link SfuEvent.UPDATE_MESSAGES_DELIVERY_STATUS} * with {@link UpdateMessagesDeliveryStatusEvent} and {@link Message.deliveryStatus} will be changed at the server side to {@link DeliveryStatus.READ}. */ markMessageRead(msg: { id: string; targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; }): Promise; /** * Mark message as unread in a Direct chat | Channel | Thread * * In targetEntity will change lastReadMessageId and lastReadMessageDate. {@link Message.deliveryStatus} * * {@link Message.deliveryStatus} will not be changed at the server side. Senders will not receive events, * however if the previous lastReadMessageDate is earlier than the updated value, * the senders of those messages will receive {@link SfuEvent.UPDATE_MESSAGES_DELIVERY_STATUS} * with {@link UpdateMessagesDeliveryStatusEvent} and {@link Message.deliveryStatus} will be changed at the server side to {@link DeliveryStatus.READ}. */ markMessageUnread(msg: { id: string; targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; }): Promise; /** * Get messages count in entity from {@link MessageTargetEntityType} */ getMessagesCount(options: { targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; }): Promise; /** * List user attachments * * @param filter.offset starting point for retrieving a subset of attachments * @param filter.pageSize number of items retrieved and displayed per page */ listAttachments(filter: { offset: number; pageSize: number; }): Promise; /** * Get total size of attachments * * @param type {@link AttachmentType} */ getAttachmentsSize(type?: AttachmentType): Promise; /** * Get first message and last message in entity from {@link MessageTargetEntityType} */ getFirstAndLastMessage(options: { targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; }): Promise; /** * Get count of unread messages in entity from {@link MessageTargetEntityType} */ getUnreadMessagesCount(options: { targetEntityType: MessageTargetEntityType; targetEntityId: MessageTargetEntityId; }): Promise; /** * This method is recommended for using to generate attachment id before sending. * Sending and downloading attachments may not work with other generating options. * @return string of 36 ASCII characters **/ static generateAttachmentId(): string; /** * Get handler for send or cancel sending attachments * * Can't cancel sent attachment */ getSendingAttachmentsHandler(attachments: Array, messageId: string): SendingAttachmentsHandler; /** * Load attachment from server * * On client side should receive {@link SfuEvent.MESSAGE_ATTACHMENT_STATE} with {@link AttachmentStatus} to show progress */ getMessageAttachment(attachment: AttachmentRequest): Promise; private downloadAttachment; /** * Get user contacts. * * Returns users who are friends or with whom there are mutual space channels or direct chats, incoming and outgoing friend invites, banned users. */ getContacts(): Promise; /** * Add a friend * * Sends a friend invite. * Users will receive {@link SfuEvent.NEW_OUTGOING_FRIEND_INVITE} and {@link SfuEvent.NEW_INCOMING_FRIEND_INVITE} with {@link NewFriendInvite}. * * If an invite was sent to this user previously, it will be replaced with a new one. * Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted} for previously invite. * Users will receive {@link SfuEvent.NEW_OUTGOING_FRIEND_INVITE} and {@link SfuEvent.NEW_INCOMING_FRIEND_INVITE} with {@link NewFriendInvite} for new friend invite. * * If the user that you are trying to add as a friend has already sent you an invite, sending a counter-invite will automatically add you as friends. * Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted} for invites. * Users will receive {@link SfuEvent.CONTACT_UPDATED} with {@link ContactUpdated} if they have mutual space channels or direct chats. * Will receive {@link SfuEvent.NEW_CONTACT} with {@link NewContact} if haven't. */ addFriend(user: { userId: UserId; }): Promise; /** * Remove friend * * Users will receive {@link SfuEvent.CONTACT_UPDATED} with {@link ContactUpdated} if they have mutual space channels or direct chats. * Will receive {@link SfuEvent.CONTACT_DELETED} with {@link ContactDeleted} if haven't. */ removeFriend(friend: { userId: UserId; }): Promise; /** * Revoke friend invite * * Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted}. */ revokeFriendInvite(invite: { inviteId: string; }): Promise; /** * Accept friend invite * * Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted} for invites. * Users will receive {@link SfuEvent.CONTACT_UPDATED} with {@link ContactUpdated} if they have mutual space channels or direct chats. * Will receive {@link SfuEvent.NEW_CONTACT} with {@link NewContact} if haven't. */ acceptFriendInvite(invite: { inviteId: string; }): Promise; /** * Reject friend invite * * Promise will resolve with {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted}. * Outgoing friend invite will not delete. */ rejectFriendInvite(invite: { inviteId: string; }): Promise; /** * Update contact volume * * Used to change and store the contact's volume in meetings. * * @param options.value - whole number * * Returns {@link ContactPersonalSettings}, and other connected devices will receive {@link ContactPersonalSettingsUpdated} for synchronization. */ updateContactVolume(options: { userId: string; value: number; }): Promise; /** * Get all user calendar events */ getUserCalendar(): Promise; /** * Add calendar event * * @param event.usePMI - if true then user PMI settings will be updated and user will receive {@link SfuEvent.UPDATE_USER_PMI_SETTINGS} with {@link UserPmiSettings} */ addCalendarEvent(event: { title: string; description: string; start: number; end: number; recurring: boolean; accessCode?: string; waitingRoom: boolean; usePMI: boolean; ownerVideo: boolean; participantVideo: boolean; allowJoinAtAnyTime: boolean; useMuteAudioOnJoin: boolean; useLocalAutoRecord: boolean; }): Promise; removeCalendarEvent(event: { id: string; }): Promise; /** * Update calendar event * * @param event.usePMI - if true then user PMI settings will be updated and user will receive {@link SfuEvent.UPDATE_USER_PMI_SETTINGS} with {@link UserPmiSettings} */ updateCalendarEvent(event: { id: string; title: string; description: string; start: number; end: number; recurring: boolean; accessCode?: string; waitingRoom: boolean; usePMI: boolean; ownerVideo: boolean; participantVideo: boolean; allowJoinAtAnyTime: boolean; useMuteAudioOnJoin: boolean; useLocalAutoRecord: boolean; }): Promise; /** * Get user pmi settings * * Used for create meetings */ getUserPmiSettings(): Promise; /** * Update user pmi settings */ updateUserPmiSettings(settings: { allowJoinAtAnyTime: boolean; useMuteAudioOnJoin: boolean; useLocalAutoRecord: boolean; useAccessCode: boolean; useWaitingRoom: boolean; useOwnerVideo: boolean; useParticipantsVideo: boolean; accessCode: string; }): Promise; /** * Get user info * * Usually used to display profile info */ getUserInfo(): Promise; /** * Change user email */ changeUserEmail(email: UserEmail): Promise; changeUserPassword(currentPassword: UserPassword, newPassword: UserPassword): Promise; /** * Change user email * * Users will receive {@link SfuEvent.CONTACT_UPDATED} with changed nickname */ changeUserNickname(nickname: UserNickname): Promise; changeUserPhoneNumber(phoneNumber: UserPhoneNumber): Promise; changeUserHostKey(hostKey: UserHostKey): Promise; changeUserTimezone(timezone: UserTimezone): Promise; /** * Update presence status * * Friends and users with whom there are mutual space channels or direct chats will receive {@link SfuEvent.USER_PRESENCE_STATUS_UPDATED} with {@link UserPresenceStatusUpdated}. * The selected status is saved and will persist across subsequent connects. It can be retrieved using the {@link getUserInfo}. */ updatePresenceStatus(status: PresenceStatus): Promise; /** * Update user activity * * Working with selected {@link PresenceStatus.ONLINE} by {@link updatePresenceStatus}. * Does not work with other statuses. * * The user client that called this method will receive {@link UserInfoChangedEvent} with {@link PresenceStatus.ONLINE} or {@link PresenceStatus.IDLE}. * Other user clients will not receive events. * * {@param isActive} = false: * If the user hasn't other connected active clients then user contacts will receive {@link UserPresenceStatusUpdated} with {@link PresenceStatus.IDLE}. * If the user has other connected active clients then user contacts will not receive events. * * {@param isActive} = true: * If all user clients was inactive then user contacts will receive {@link UserPresenceStatusUpdated} with {@link PresenceStatus.ONLINE}. * If the user has at least one active connected client, then the contacts will not receive any events. */ updateActivityStatus(isActive: boolean): Promise; /** * After adding: * * User's contacts will see {@link Contact.encryptionEnabled} and {@link Contact.publicKey}. * The remaining information is not used on the server and is only stored; it can be requested using {@link getUserEncryptionInfo}. * * verificationHash, salt, and iv are optional; the client chooses the private key encryption method. * * salt - Cryptographic Salt * * iv - Initialization Vector for Encryption */ addUserEncryptionInfo(info: { privateKey: string; publicKey: string; verificationHash?: string; salt?: string; iv?: string; }): Promise; getUserEncryptionInfo(): Promise; /** * @deprecated */ getPublicChannels(): Promise; /** * @deprecated */ searchChatMessages(params: { chatId: string; searchString: string; searchId?: string; limit?: number; }): Promise; /** * @deprecated */ searchMessageAttachments(params: { chatId?: string; attachmentsType?: MessageAttachmentMediaType; from?: UserId; timeFrame?: { start: number; end: number; limit?: number; }; boundaries?: { dateMark: number; lowerLimit: number; upperLimit: number; }; searchString?: string; sortOrder: SortOrder; }): Promise; /** * @deprecated */ loadMessagesWithMentions(params: { chatId?: string; userTag: string; timeFrame?: { start: number; end: number; limit?: number; }; boundaries?: { dateMark: number; lowerLimit: number; upperLimit: number; }; sortOrder: SortOrder; }): Promise; /** * Get chats. * * To work with messages in the chat, you need to use {@link MessageTargetEntityType.CHAT} */ getUserChats(): Promise; loadChat(chat: { id: string; }): Promise; /** * Create chat * * @param chat.members - these members will receive {@link SfuEvent.NEW_CHAT} with {@link UserSpecificChatInfo} * @param chat.type - @deprecated * @param chat.channelSendPolicy - @deprecated * @param chat.sendPermissionList - @deprecated * @param chat.allowedToAddExternalUser - @deprecated * * Creating a Secure Chat with Encryption: * @param chat.isEncryptionEnabled must be true for a Secure Chat * @param chat.publicKey - the public key of the chat used to encrypt messages * @param chat.encryptedPrivateKey - the private key of the chat, encrypted with a chat password, used to decrypt messages * @param chat.encryptedChatPasswords - an array of chat passwords for each member encrypted with the member's public keys, which must be decrypted using the user's private key. * @param chat.encryptedAttachmentsSecretKey - encrypted key for encrypting attachments. */ createChat(chat: { id?: string; name?: string; members?: Array; favourite?: boolean; channel?: boolean; type?: ChatType; channelSendPolicy?: ChannelSendPolicy; sendPermissionList?: Array; allowedToAddExternalUser?: boolean; isEncryptionEnabled?: boolean; encryptedPrivateKey?: string; publicKey?: string; encryptedChatPasswords?: Array; encryptedAttachmentsSecretKey?: string; }): Promise; /** * Delete chat * * Chat members will receive {@link SfuEvent.CHAT_DELETED} with {@link UserSpecificChatInfo} * * If a direct meeting was started, it will end, and chat participants will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}. */ deleteChat(chat: { id: string; }): Promise; /** * Update chat * * Chat members will receive {@link SfuEvent.CHAT_UPDATED} with {@link UserSpecificChatInfo} */ renameChat(chat: { id: string; name: string; }): Promise; /** * Update chat notification settings * * Used to modify and store chat notification settings specified in {@link UserSpecificChatInfo.notificationSettings}. * * Returns {@link ChatNotificationSettingsUpdated}, and other connected devices will also receive this event for synchronization. */ updateChatNotificationSettings(options: { id: string; value: NotificationMode; }): Promise; /** * Mute chat * * @param options.muteTime – the duration for which the sound is muted. The final event will contain {@link MuteSettings.mutedUntil}, which is the current time plus the specified duration. * @param options.mutedIndefinitely – indicates whether the sound is muted indefinitely. * * Returns {@link ChatMuted}, and other connected devices will also receive this event for synchronization. */ muteChat(options: { id: string; muteTime?: number; mutedIndefinitely?: boolean; }): Promise; /** * Unmute chat * * {@link UserSpecificChatInfo.muteSettings} wil be null - that means the chat is not muted. * * Returns {@link ChatUnmuted}, and other connected devices will also receive this event for synchronization. */ unmuteChat(options: { id: string; }): Promise; /** * Add a member to chat * * Chat members will receive {@link SfuEvent.CHAT_UPDATED} with {@link UserSpecificChatInfo} * * If a direct meeting was started, user will receive {@link SfuEvent.NEW_MEETING} with {@link NewMeeting}. * * @param chat.member - user will receive {@link SfuEvent.NEW_CHAT} with {@link UserSpecificChatInfo}. * @param chat.encryptedChatPassword - required for adding to a secure encrypted chat. * chat password encrypted with the member's public key, which must be decrypted using the user's private key. */ addMemberToChat(chat: { id: string; member: UserId; encryptedChatPassword?: string; }): Promise; /** * Remove a member to chat * * Chat members will receive {@link SfuEvent.CHAT_UPDATED} with {@link UserSpecificChatInfo} * * If a direct meeting was started and user was , user will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}. * If the user was a participant in the meeting, users will receive {@link RoomEvent.EVICTED} with {@link EvictedFromRoom}. * * @param chat.member - user will receive {@link SfuEvent.CHAT_DELETED} with {@link UserSpecificChatInfo}. */ removeMemberFromChat(chat: { id: string; member: UserId; }): Promise; /** * @deprecated */ updateChannelSendPolicy(channel: { id: string; channelSendPolicy: ChannelSendPolicy; }): Promise; updateChatReceivePolicy(channel: { id: string; chatReceivePolicy: ChatReceivePolicy; }): Promise; /** * @deprecated */ addChannelSendPermissionListMember(channel: { id: string; member: UserId; }): Promise; /** * @deprecated */ removeChannelSendPermissionListMember(channel: { id: string; member: UserId; }): Promise; /** * @deprecated */ updateChatConfiguration(chat: { id: string; type?: ChatType; channelSendPolicy?: ChannelSendPolicy; sendPermissionList?: Array; allowedToAddExternalUser?: boolean; }): Promise; /** * Used to change {@link UserSpecificChatInfo.favourite} to true */ addChatToFavourites(chat: { id: string; }): Promise; /** * Used to change {@link UserSpecificChatInfo.favourite} to false */ removeChatFromFavourites(chat: { id: string; }): Promise; /** * Used to change {@link UserSpecificChatInfo.hidden} */ updateChatHiding(chat: { id: string; hidden: boolean; }): Promise; /** * Create room * * To create with PMI settings, PMI must be specified as the ID. * * To join, you need to use room.join. * * @return {@link RoomExtended} with {@link RoomExtended.conferenceType()} that equal {@link ConferenceType.GLOBAL} */ createRoom(options: { name?: string; pin?: string; id?: string; }): Promise; /** * Create channel meeting * * {@link Room.id()} will be equal channelId * * @return {@link RoomExtended} with {@link RoomExtended.conferenceType()} that equal {@link ConferenceType.CHANNEL} */ createChannelMeeting(options: { spaceId: string; channelId: string; }): Promise; /** * Create channel meeting * * {@link Room.id()} will be equal directChatId * * @return {@link RoomExtended} with {@link RoomExtended.conferenceType()} that equal {@link ConferenceType.DIRECT} */ createDirectMeeting(options: { directChatId: string; }): Promise; /** * Creating a room based on a calendar event created using {@link addCalendarEvent}. * * To join, you need to use room.join() */ createRoomFromEvent(event: { id: string; title: string; description: string; start: number; end: number; recurring: boolean; accessCode?: string; waitingRoom: boolean; usePMI: boolean; ownerVideo: boolean; participantVideo: boolean; allowJoinAtAnyTime: boolean; useMuteAudioOnJoin: boolean; useLocalAutoRecord: boolean; }): Promise; /** * Get running rooms */ loadActiveRooms(): Promise; /** * Check and get an available room. * * To join, you need to use room.join() */ roomAvailable(options: { id: string; pin?: string; nickname?: string; }): Promise; /** * Checks for the existence of a running room. */ roomExists(options: { id: string; pin?: string; }): Promise; getRoom(options: { id: string; }): RoomExtended; /** * Get user spaces * * If channel meetings were started, user will receive {@link SfuEvent.USER_MEETINGS} with {@link MeetingsPreviewEvent}. */ getUserSpaces(): Promise; /** * The space is created with the default category Category1, default channel Channel1 and default role "@everyone". */ createSpace(space: { name: string; }): Promise; /** * Update space overview * * Space members will receive {@link SpaceEvent.SPACE_OVERVIEW_UPDATED} with {@link SpaceOverviewUpdated} */ updateSpaceOverview(space: { id: string; name: string; }): Promise; /** * Delete space * * Space members will receive {@link SpaceEvent.SPACE_DELETED} with {@link SpaceDeletedEvent} * * If channel meetings were started, users will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}. */ deleteSpace(space: { id: string; }): Promise; /** * Leave space * * Space members will receive {@link SpaceEvent.USER_LEFT_SPACE} with {@link UserLeftSpace} * * After receiving the event, it is necessary to remove the user from the list of members in the space and channels/threads. * * If channel meetings were started, user will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}. * If the user was a participant in the meeting, users will receive {@link RoomEvent.EVICTED} with {@link EvictedFromRoom}. */ leaveSpace(space: { id: string; }): Promise; /** * Update space notification settings * * Used to modify and store space notification settings specified in {@link SfuSpace.notificationSettings}. * * Returns {@link SpaceNotificationSettingsUpdated}, and other connected devices will also receive this event for synchronization. */ updateSpaceNotificationSettings(options: { spaceId: string; value: NotificationMode; }): Promise; /** * Mute space * * @param options.muteTime – the duration for which the sound is muted. The final event will contain {@link MuteSettings.mutedUntil}, which is the current time plus the specified duration. * @param options.mutedIndefinitely – indicates whether the sound is muted indefinitely. * * Returns {@link SpaceMuted}, and other connected devices will also receive this event for synchronization. */ muteSpace(options: { spaceId: string; muteTime?: number; mutedIndefinitely?: boolean; }): Promise; /** * Unmute space * * {@link SfuSpace.muteSettings} wil be null - that means the space is not muted. * * Returns {@link SpaceUnmuted}, and other connected devices will also receive this event for synchronization. */ unmuteSpace(options: { spaceId: string; }): Promise; /** * Generate space invite * * If user has permission to create a space invite - generating invite code with 8 symbols. * To create invite link - use 'ws:{serverUrl}:{port}/join-space/inviteCode' */ generateNewSpaceInvite(options: { spaceId: string; lifespan: number; }): Promise; /** * Removing the space invite */ revokeSpaceInvite(options: { spaceId: string; inviteCode: string; }): Promise; /** * Join space by invite code * * Space members will receive {@link SpaceEvent.USER_JOINED_TO_SPACE} with {@link UserJoinedToSpaceEvent}. * On the client side, this user should be added to the list of participants in public channels and threads. * * If channel meetings were started, user will receive {@link SfuEvent.USER_MEETINGS} with {@link MeetingsPreviewEvent}. */ joinSpaceByInviteCode(inviteCode: string): Promise; /** * Create space category * * For space owner/user that has permission to manage categories * * Space members will receive {@link SpaceEvent.NEW_SPACE_CATEGORY} with {@link NewSpaceCategoryEvent} */ createSpaceCategory(category: { spaceId: string; name: string; }): Promise; /** * Delete space category * * For space owner/category creator/user that has permission to manage categories * * Space members will receive {@link SpaceEvent.SPACE_CATEGORY_DELETED} with {@link SpaceCategoryDeleted} */ deleteSpaceCategory(options: { spaceId: string; categoryId: string; }): Promise; /** * Delete space category * * For space owner/category creator/user that has permission to manage categories * * Space members will receive {@link SpaceEvent.SPACE_CATEGORY_UPDATED} with {@link SpaceCategoryUpdated} */ updateSpaceCategory(options: { spaceId: string; categoryId: string; name: string; }): Promise; /** * Create space channel * * For space owner/user that has permission to manage channels * * Channel members will receive {@link SpaceEvent.NEW_SPACE_CHANNEL} with {@link NewSpaceChannelEvent} * * @param channel.roles - used to create a private channel. Array of role ids or empty array. * @param channel.members - used to create a private channel. Array of member ids or empty array. */ createSpaceChannel(channel: { spaceId: string; categoryId?: string; name: string; isPrivate: boolean; roles?: Array; members?: Array; }): Promise; /** * Update space channel * * For space owner/user that has permission to manage channels * * Channel members will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated} * In the private channel added members will receive {@link SpaceEvent.NEW_SPACE_CHANNEL} with {@link NewSpaceChannelEvent}. * If the channel meeting was started, added members will receive {@link SfuEvent.NEW_MEETING} with {@link NewMeeting}. * * In the private channel deleted members will receive {@link SpaceEvent.SPACE_CHANNEL_DELETED} with {@link SpaceChannelDeleted} * If the channel meeting was started, deleted members will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}. * If the deleted user was a participant in the meeting, users will receive {@link RoomEvent.EVICTED} with {@link EvictedFromRoom}. * * @param channel.roles - used to create a private channel. Array of role ids or empty array. * @param channel.members - used to create a private channel. Array of member ids or empty array. */ updateSpaceChannel(channel: { spaceId: string; channelId: string; name: string; isPrivate: boolean; roles?: Array; members?: Array; }): Promise; /** * Move space channel * * Channel members will receive {@link SpaceEvent.SPACE_CHANNEL_MOVED} with {@link SpaceChannelMoved} * * @param channel.categoryId - Specify the identifier of the category to which you want to move the channel, or an empty string to leave the channel uncategorized. */ moveSpaceChannel(channel: { spaceId: string; categoryId: string; channelId: string; }): Promise; /** * Delete space channel * * Channel members will receive {@link SpaceEvent.SPACE_CHANNEL_DELETED} with {@link SpaceChannelDeleted} * * If the channel meeting was started, members will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}. */ deleteSpaceChannel(options: { spaceId: string; channelId: string; }): Promise; /** * Update channel notification settings * * Used to modify and store channel notification settings specified in {@link SfuSpaceChannel.notificationSettings}. * * Returns {@link ChannelNotificationSettingsUpdated}, and other connected devices will also receive this event for synchronization. */ updateChannelNotificationSettings(options: { spaceId: string; channelId: string; value: NotificationMode; }): Promise; /** * Mute channel * * @param options.muteTime – the duration for which the sound is muted. The final event will contain {@link MuteSettings.mutedUntil}, which is the current time plus the specified duration. * @param options.mutedIndefinitely – indicates whether the sound is muted indefinitely. * * Returns {@link ChannelMuted}, and other connected devices will also receive this event for synchronization. */ muteChannel(options: { spaceId: string; channelId: string; muteTime?: number; mutedIndefinitely?: boolean; }): Promise; /** * Unmute channel * * {@link SfuSpaceChannel.muteSettings} wil be null - that means the channel is not muted. * * Returns {@link ChannelUnmuted}, and other connected devices will also receive this event for synchronization. */ unmuteChannel(options: { spaceId: string; channelId: string; }): Promise; /** * Create space thread * * Thread members will receive {@link SpaceEvent.NEW_SPACE_THREAD} with {@link NewSpaceThreadEvent} */ createSpaceThread(thread: { spaceId: string; channelId: string; name: string; isPrivate: boolean; }): Promise; /** * Update space thread * * For space owner/thread creator * * Thread members will receive {@link SpaceEvent.SPACE_THREAD_UPDATED} with {@link SpaceThreadUpdated} */ updateSpaceThread(options: { spaceId: string; channelId: string; threadId: string; name: string; }): Promise; /** * Add members to thread * * Thread members will receive {@link SpaceEvent.ADDED_MEMBERS_TO_THREAD} with {@link AddedMembersToThread} * * New members will receive {@link NEW_SPACE_THREAD} with {@link NewSpaceThreadEvent} * */ addMembersToThread(options: { spaceId: string; channelId: string; threadId: string; members: Array; }): Promise; /** * Remove member from thread * * For space owner/thread creator only * * Thread members will receive {@link SpaceEvent.REMOVED_MEMBER_FROM_THREAD} with {@link RemovedMemberFromThread} * * The removed member will receive {@link SpaceEvent.SPACE_THREAD_DELETED} with {@link SpaceThreadDeleted} */ removeMemberFromThread(options: { spaceId: string; channelId: string; threadId: string; member: string; }): Promise; /** * Delete space thread * * For space owner/thread creator * * Thread members will receive {@link SpaceEvent.SPACE_THREAD_DELETED} with {@link SpaceThreadDeleted} */ deleteSpaceThread(options: { spaceId: string; channelId: string; threadId: string; }): Promise; /** * Update thread notification settings * * Used to modify and store thread notification settings specified in {@link SfuSpaceThread.notificationSettings}. * * Returns {@link ThreadNotificationSettingsUpdated}, and other connected devices will also receive this event for synchronization. */ updateThreadNotificationSettings(options: { spaceId: string; channelId: string; threadId: string; value: NotificationMode; }): Promise; /** * Mute thread * * @param options.muteTime – the duration for which the sound is muted. The final event will contain {@link MuteSettings.mutedUntil}, which is the current time plus the specified duration. * @param options.mutedIndefinitely – indicates whether the sound is muted indefinitely. * * Returns {@link ThreadMuted}, and other connected devices will also receive this event for synchronization. */ muteThread(options: { spaceId: string; channelId: string; threadId: string; muteTime?: number; mutedIndefinitely?: boolean; }): Promise; /** * Unmute thread * * {@link SfuSpaceThread.muteSettings} wil be null - that means the thread is not muted. * * Returns {@link ThreadUnmuted}, and other connected devices will also receive this event for synchronization. */ unmuteThread(options: { spaceId: string; channelId: string; threadId: string; }): Promise; /** * Add space role * * For space owner/user that has permission to manage roles * * Space members will receive {@link SpaceEvent.NEW_SPACE_ROLE} with {@link NewSpaceRoleAdded} * * On the client side, a new role must be added to the participants listed in the {@link NewSpaceRoleAdded.members} */ addSpaceRole(role: { spaceId: string; name: string; color: string; permissions: Array; members: Array; }): Promise; /** * Update space role * * For space owner/user that has permission to manage roles * * Space members will receive {@link SpaceEvent.SPACE_ROLE_UPDATED} with {@link SpaceRoleUpdated} * * On the client side, a new role must be added to the participants listed in the {@link SpaceRoleUpdated.membersForAddRole} * and must be removed from participants listed in the {@link SpaceRoleUpdated.membersForDeleteRole} * * Participants from whom this role will be removed will receive {@link SpaceEvent.SPACE_CHANNEL_DELETED} with {@link SpaceChannelDeleted} for each channel they were part of because of this role. * * Participants who are assigned this role will receive {@link SpaceEvent.NEW_SPACE_CHANNEL} with {@link NewSpaceChannelEvent} for each channel that has this role in its access rights. * * Participants who had the role before the update and still have it afterward will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated} for each channel that has this role in its access rights. */ updateSpaceRole(role: { spaceId: string; roleId: string; name: string; color: string; permissions: Array; members: Array; }): Promise; /** * Delete space role * * For space owner/user that has permission to manage roles * * Space members will receive {@link SpaceEvent.SPACE_ROLE_DELETED} with {@link SpaceRoleDeleted} * * On the client side, should remove this role from channel's access rights and update channel members list */ deleteSpaceRole(options: { spaceId: string; roleId: string; }): Promise; /** * Add space role to member * * For space owner/user that has permission to manage roles * * Space members will receive {@link SpaceEvent.ADDED_ROLE_TO_MEMBER} with {@link AddedRoleToMember} * * Member who are assigned this role will receive {@link SpaceEvent.NEW_SPACE_CHANNEL} with {@link NewSpaceChannelEvent} for each channel that has this role in its access rights. * Other members of these channels will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated}. */ addRoleToMember(options: { spaceId: string; roleId: string; memberId: string; }): Promise; /** * Remove space role from member * * For space owner/user that has permission to manage roles * * Space members will receive {@link SpaceEvent.REMOVED_ROLE_FROM_MEMBER} with {@link RemovedRoleFromMember} * * Participant from whom this role will be removed will receive {@link SpaceEvent.SPACE_CHANNEL_DELETED} with {@link SpaceChannelDeleted} for each channel they were part of because of this role. * Other members of these channels will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated}. */ removeRoleFromMember(options: { spaceId: string; roleId: string; memberId: string; }): Promise; getRolePermissions(): Promise; /** * Update nickname in the space * Updates a user's nickname in the space. * * A custom nickname, if set, takes precedence over the user's global nickname. * If no custom nickname is provided (or an empty string is passed), the user's global nickname must be displayed. * * To remove a previously set the custom nickname and revert to the global one, pass an empty string. * * @param options.userId - Optional. The ID of the user whose nickname is being updated. * If this field is omitted or set to the caller's own ID, the caller's nickname is updated. * The space owner can update anyone's nickname by specifying user ID. * If a non-owner attempts to update another user's nickname, a {@link SpaceError.UPDATE_NICKNAME_ACCESS_RIGHTS_ERROR} is thrown. * All space members receive a {@link SpaceEvent.USER_SPACE_NICKNAME_UPDATED} event * with a {@link UserSpaceNicknameUpdated} payload when the nickname is updated. */ updateSpaceNickname(options: { spaceId: string; userId?: string; nickname: string; }): Promise; /** * Load meetings history * * Used to load the history of global meetings. * * The response returns a {@link MeetingsHistoryEvent} with the requested items and the total size. */ loadMeetingsHistory(params: { timeFrame?: { start: number; end: number; limit?: number; }; boundaries?: { dateMark: number; lowerLimit: number; upperLimit: number; }; pageRequest?: { page: number; pageSize: number; }; }): Promise; /** * Remove meeting from history * * Used to remove meeting from history. Any user can remove it. This does not affect other users' history in any way. */ removeMeetingFromHistory(id: string): Promise; /** * Removes the meeting recording (video). * * The right to remove is granted to the following roles: * In global meetings – the meeting owner * In channel meetings – the space owner * In group direct chats – the chat creator * In personal direct chats – no one * * Users will receive {@link MeetingRecordDeleted} for global meetings and {@link MessageEdited} for others, because it's system message */ removeMeetingRecord(options: { meetingHistoryItemId: string; recordId: string; meetingType: ConferenceType; meetingId?: string; spaceId?: string; }): Promise; /** * Get system config (settings) * * Used to receive {@link SystemConfig} */ getSystemConfig(): Promise; private updateSpaceIconRequest; /** * Update space icon * * Used to update space icon. * * Space members will receive {@link SpaceOverviewUpdated} with {@link SpaceOverviewUpdated.icon} as download url. * * Returns download url or null if removed. */ updateSpaceIcon(options: { id: string; icon?: File; remove?: boolean; }): Promise; private updateUserIconRequest; /** * Update user avatar * * Used to update user avatar. * * User will receive {@link UserInfoChangedEvent} and {@link ContactUpdated} with self. * User's contacts will receive {@link ContactUpdated} * * Returns download url or null if removed. */ updateUserIcon(options: { icon?: File; remove?: boolean; }): Promise; private updateChatIconRequest; /** * Update chat icon * * Used to update direct chat icon. * * Chat members will receive {@link ChatIconUpdated} with {@link ChatIconUpdated.icon} as download url. * * Returns download url or null if removed. */ updateChatIcon(options: { id: string; icon?: File; remove?: boolean; }): Promise; user(): { username: string; email: string; nickname: string; authToken: string; pmi: string; webRTCMetricsServerDescription?: RTCMetricsServerDescription; }; server(): string; state(): State; on(event: EventUnion, callback: (arg0: NotifyUnion) => void): SfuExtended; off(event: EventUnion, callback: (arg0: NotifyUnion) => void): SfuExtended; getExamplesFreeUser(options: { url: string; timeout?: number; }): Promise; static strToUTF8Array(str: string): Array; static fromUTF8ArrayToStr(data: Uint8Array): string; private closePcAndFireEvent; }