UNPKG

laudantiumculpa

Version:
1,455 lines (1,396 loc) 227 kB
import type AsyncStorage from '@react-native-async-storage/async-storage'; export /** * @description Object representing an admin message. */ declare class AdminMessage extends BaseMessage { /** The message text of the message. */ message: string; /** The translated messages (key-value map) for the language codes in key. */ translations: object; /** * @param ts * @param params * @returns * @description Retrieves the threaded replies of the current message depending on the timestamp. * If the current message doesn’t have replies, the result is an empty list. */ getThreadedMessagesByTimestamp( ts: number, params: ThreadedMessageListParams, ): Promise<{ parentMessage: BaseMessage; threadedMessages: BaseMessage[]; }>; } export /** * @description Represents information obtained from the application settings. The values for this will be set after a connection has been made. */ declare class AppInfo { /** The current registered emoji version hash. */ readonly emojiHash: string; /** The maximum limit of file size in bytes for uploading. */ readonly uploadSizeLimit: number; /** Whether an application is using the reaction feature. */ readonly useReaction: boolean; /** List of all attributes that the application is using. */ readonly applicationAttributes: string[]; /** List of all premium features that application is using. */ readonly premiumFeatureList: string[]; /** Whether device tokens would be cached. */ readonly deviceTokenCache: boolean; readonly enabledChannelMemberShipHistory: boolean; /** The maximum count of files that can be included in a single MultipleFilesMessage. */ readonly multipleFilesMessageFileCountLimit: number; /** Whether the SDK stat would be uploaded. */ readonly allowSdkStatsUpload: boolean; /** Notification info. */ readonly notificationInfo: NotificationInfo | null; readonly uikitConfigInfo: UIKitConfigInfo; readonly messageTemplateInfo: MessageTemplateInfo | null; } export /** * @description A class that can be used to send apple's critical alert. */ declare class AppleCriticalAlertOptions { /** The name of the critical alert option. */ readonly name: string; /** The volumne of the critical alert option. */ readonly volume: number; } export /** * @description A class representing query to retrieve lists related to User. */ declare class ApplicationUserListQuery extends BaseListQuery { /** * @description User IDs filter. User list containing the passed User IDs will be returned. */ readonly userIdsFilter: string[] | null; /** * @description User meta data key filter. User list containing only and exactly the passed User meta data will be returned. */ readonly metaDataKeyFilter: string | null; /** * @description User meta data values filter. User list containing only and exactly the passed User meta data will be returned. */ readonly metaDataValuesFilter: string[] | null; /** * @description A filter to return users whose nicknames start with the specified string. */ readonly nicknameStartsWithFilter: string | null; /** * @returns * @description Gets the list of Users. * If this method is repeatedly called after each next is finished, it retrieves the following pages of the User list. * If there is no more pages to be read, an empty List (not null) is returned. */ next(): Promise<User[]>; } export declare interface ApplicationUserListQueryParams extends BaseListQueryParams { /** * @description User IDs filter. User list containing the passed User IDs will be returned. */ userIdsFilter?: string[]; /** * @description User meta data key filter. User list containing only and exactly the passed User meta data will be returned. */ metaDataKeyFilter?: string; /** * @description User meta data values filter. User list containing only and exactly the passed User meta data will be returned. */ metaDataValuesFilter?: string[]; /** * @description A filter to return users whose nicknames start with the specified string. */ nicknameStartsWithFilter?: string; } export /** * @description A class representing query to retrieve lists related to banned User. */ declare class BannedUserListQuery extends ChannelDataListQuery { /** * @returns * @description Gets the list of RestrictedUsers. * If this method is repeatedly called after each next is finished, * it retrieves the following pages of the RestrictedUser list. * If there is no more pages to be read, an empty List (not null) is returned. */ next(): Promise<RestrictedUser[]>; } export declare interface BannedUserListQueryParams extends BaseListQueryParams {} export /** * @description Objects representing a channel. */ declare class BaseChannel { /** The unique channel URL. */ get url(): string; /** The topic or name of the channel. */ get name(): string; set name(value: string); /** The creation time of the channel in milliseconds. */ get createdAt(): number; channelType: ChannelType; /** The cover image URL. */ coverUrl: string; /** The custom type of the channel. */ customType: string; /** The channel data. */ data: string; /** Whether the channel is frozen. */ isFrozen: boolean; /** Whether the channel is ephemeral. */ isEphemeral: boolean; /** A {@link User} who created the channel. `null` if it's created by system. */ creator: User | null; /** * @returns * @description Whether the instance is {@link GroupChannel} type. */ isGroupChannel(): this is GroupChannel; /** * @returns * @description Whether the instance is {@link OpenChannel} type. */ isOpenChannel(): this is OpenChannel; /** * @returns * @description Whether the instance is {@link FeedChannel} type. */ isFeedChannel(): this is FeedChannel; /** All locally cached metadata as a map. */ get cachedMetaData(): object; /** The local timestamp of when this channel has been used in a {@link MessageCollection}. */ get messageCollectionLastAccessedAt(): number; /** * @param channel * @returns * @description Whether the given channel is identical to this channel. */ isIdentical(channel: BaseChannel): boolean; /** * @param channel * @returns * @description Whether the given channel is equal in all the values of this channel. */ isEqual(channel: BaseChannel): boolean; /** * @param params * @returns * @description Creates a query instance to get the operator list from this channel. */ createOperatorListQuery(params?: OperatorListQueryParams): OperatorListQuery; /** * @param params * @returns * @description Creates a query instance to get the muted user (online and offline both) list of this channel. */ createMutedUserListQuery(params?: MutedUserListQueryParams): MutedUserListQuery; /** * @param params * @returns * @description Creates a query instance to get the banned user list from this channel. */ createBannedUserListQuery(params?: BannedUserListQueryParams): BannedUserListQuery; /** * @param params * @returns * @description Creates previous message list query for this channel. */ createPreviousMessageListQuery(params?: PreviousMessageListQueryParams): PreviousMessageListQuery; /** * @param userIds * @description Add operators to the channel. */ addOperators(userIds: string[]): Promise<void>; /** * @param userIds * @description Remove operators from the channel. */ removeOperators(userIds: string[]): Promise<void>; /** * @returns * @description Gets my muted information in this channel. */ getMyMutedInfo(): Promise<MutedInfo>; /** * @param keys * @returns * @description Gets meta data. */ getMetaData(keys: string[]): Promise<MetaData>; /** * @returns * @description Gets all meta data. */ getAllMetaData(): Promise<MetaData>; /** * @param data * @returns * @description Creates meta data. This can be used to customize the channel. */ createMetaData(data: MetaData): Promise<MetaData>; /** * @param data * @param upsert * @returns * @description Updates meta data. */ updateMetaData(data: MetaData, upsert?: boolean): Promise<MetaData>; /** * @param key * @description Deletes a meta data. */ deleteMetaData(key: string): Promise<void>; /** * @description Deletes all meta data. */ deleteAllMetaData(): Promise<void>; /** * @param keys * @returns * @description Gets meta counters. */ getMetaCounters(keys: string[]): Promise<MetaCounter>; /** * @returns * @description Get all meta counters. */ getAllMetaCounters(): Promise<MetaCounter>; /** * @param data * @returns * @description Creates meta counters. This can be used to customize the channel. */ createMetaCounters(data: MetaCounter): Promise<MetaCounter>; /** * @param data * @param upsert * @returns * @description Updates meta counters. */ updateMetaCounters(data: MetaCounter, upsert?: boolean): Promise<MetaCounter>; /** * @param data * @returns * @description Increases meta counters. This increases atomically the keyed meta counter by the specified value. */ increaseMetaCounters(data: MetaCounter): Promise<MetaCounter>; /** * @param data * @returns * @description Decreases meta counters. This decreases atomically the keyed meta counter by the specified value. */ decreaseMetaCounters(data: MetaCounter): Promise<MetaCounter>; /** * @param key * @description Deletes a meta counter. */ deleteMetaCounter(key: string): Promise<void>; /** * @description Deletes all meta counters. */ deleteAllMetaCounters(): Promise<void>; /** * @param user * @param duration * @param description * @returns * @description Mutes a {@link User}. A muted user cannot send a message. */ muteUser(user: User, duration?: number, description?: string): Promise<void>; /** * @param userId * @param duration * @param description * @description Mutes a {@link User} with `userId`. A muted user cannot send a message. */ muteUserWithUserId(userId: string, duration?: number, description?: string): Promise<void>; /** * @param user * @returns * @description Unmutes {@link User}. The unmuted user could send a message again. */ unmuteUser(user: User): Promise<void>; /** * @param userId * @description Unmutes {@link User} with `userId`. The unmuted user could send a message again. */ unmuteUserWithUserId(userId: string): Promise<void>; /** * @param user * @param duration * @param description * @returns * @description Bans a member. Operators can ban members from this channel. * Banned member is kicked out of this channel and cannot enter during the specified seconds. * If you want to ban the user indefinitely, pass -1 to seconds as the argument. */ banUser(user: User, duration?: number, description?: string): Promise<void>; /** * @param userId * @param duration * @param description * @description Bans a member with `userId`. */ banUserWithUserId(userId: string, duration?: number, description?: string): Promise<void>; /** * @param user * @returns * @description Unbans {@link User}. Operators can unban User who has been banned from this channel. */ unbanUser(user: User): Promise<void>; /** * @param userId * @description Unbans {@link User} with `userId`. */ unbanUserWithUserId(userId: string): Promise<void>; /** * @description Freezes the channel. No one could send a message in a frozen channel. */ freeze(): Promise<void>; /** * @description Unfreezes the channel. */ unfreeze(): Promise<void>; /** * @param messageId * @param params * @returns * @description Retrieves previous or next messages based on the message ID in a specific channel. */ getMessagesByMessageId(messageId: number, params: MessageListParams): Promise<BaseMessage[]>; /** * @param ts * @param params * @returns * @description Retrieves previous or next messages based on the timestamp in a specific channel. */ getMessagesByTimestamp(ts: number, params: MessageListParams): Promise<BaseMessage[]>; /** * @param ts * @param params * @returns * @description Requests message change logs after given timestamp. */ getMessageChangeLogsSinceTimestamp(ts: number, params?: MessageChangeLogsParams): Promise<MessageChangelogs>; /** * * @param token * @param params * @returns * @description Requests message change logs after given token. */ getMessageChangeLogsSinceToken(token: string, params?: MessageChangeLogsParams): Promise<MessageChangelogs>; /** * @param params * @returns * @description Sends a user message. */ sendUserMessage(params: UserMessageCreateParams): MessageRequestHandler; /** * @deprecated since v4.9.8. Use resendMessage() instead. * @description Resends a failed user message. */ resendUserMessage(failedMessage: UserMessage): Promise<UserMessage>; /** * @param messageId * @param params * @returns * @description Updates a {@link UserMessage} that was previously sent in the channel. */ updateUserMessage(messageId: number, params: UserMessageUpdateParams): Promise<UserMessage>; /** * @deprecated since v4.9.8. Use copyMessage() instead. * @description Copies a user message from this channel to the target channel. */ copyUserMessage(targetChannel: BaseChannel, message: UserMessage): Promise<UserMessage>; /** * @param targetMessage * @param languages * @returns * @description Translates a user message. */ translateUserMessage(targetMessage: UserMessage, languages: string[]): Promise<UserMessage>; /** * @param params * @returns * @description Sends a file with given file information. */ sendFileMessage(params: FileMessageCreateParams): MessageRequestHandler; /** * @param params * @returns * @description Sends a multiple files or file URLs as a single {@link MultipleFilesMessage}. */ sendMultipleFilesMessage(params: MultipleFilesMessageCreateParams): MultipleFilesMessageRequestHandler; /** * @param paramsList * @returns * @description Sends files with given files information. * The maximum number of files is 20. This method handles FileMessageCreateParams only which have set binary file not URL. */ sendFileMessages(paramsList: FileMessageCreateParams[]): MessageRequestHandler; /** * @deprecated since v4.9.8. Use resendMessage() instead. * @description Resends a file with given file information. */ resendFileMessage(failedMessage: FileMessage, file?: FileCompat): Promise<FileMessage>; /** * @param failedMessage * @param file * @description Resends a failed message. */ resendMessage(failedMessage: FileMessage, file?: FileCompat): MessageRequestHandler<FileMessage>; /** * @param failedMessage * @param file * @description Resends a failed message. */ resendMessage(failedMessage: UserMessage): MessageRequestHandler<UserMessage>; /** * @param messageId * @param params * @returns * @description Updates a FileMessage that was previously sent in the channel. * Note that the file itself cannot be changed; only the fields stored within the message can be modified. */ updateFileMessage(messageId: number, params: FileMessageUpdateParams): Promise<FileMessage>; /** * @param params * @returns * @description Uploads a file and gets the URL and thumbnails. * It takes `progressHandler` as a parameter to keep track of upload progress. */ uploadFile(params: FileUploadParams): Promise<FileUploadResult>; /** * @param requestId * @returns * @description Cancels an ongoing {@link FileMessage} upload. */ cancelUploadingFileMessage(requestId: string): Promise<boolean>; /** * @deprecated since v4.9.8. Use copyMessage() instead. * @description Copies a file message from this channel to the target channel. */ copyFileMessage(targetChannel: BaseChannel, message: FileMessage): Promise<FileMessage>; /** * @param channel * @param message * @description Copies a message from this channel to the target channel. */ copyMessage(channel: BaseChannel, message: FileMessage): MessageRequestHandler<FileMessage>; /** * @param channel * @param message * @description Copies a message from this channel to the target channel. */ copyMessage(channel: BaseChannel, message: UserMessage): MessageRequestHandler<UserMessage>; /** * @param message * @description Deletes a message. */ deleteMessage(message: BaseMessage): Promise<void>; /** * @param message * @param key * @returns * @description Adds {@link Reaction}. */ addReaction(message: BaseMessage, key: string): Promise<ReactionEvent>; /** * @param message * @param key * @returns * @description Deletes {@link Reaction}. */ deleteReaction(message: BaseMessage, key: string): Promise<ReactionEvent>; /** * @param message * @param keys * @returns * @description Creates message meta array keys. */ createMessageMetaArrayKeys(message: BaseMessage, keys: string[]): Promise<BaseMessage>; /** * @param message * @param keys * @returns * @description Deletes message meta array keys. */ deleteMessageMetaArrayKeys(message: BaseMessage, keys: string[]): Promise<BaseMessage>; /** * @param message * @param metaArrays * @returns * @description Adds message meta array values. */ addMessageMetaArrayValues(message: BaseMessage, metaArrays: MessageMetaArray[]): Promise<BaseMessage>; /** * @param message * @param metaArrays * @returns * @description Removes message meta array values. */ removeMessageMetaArrayValues(message: BaseMessage, metaArrays: MessageMetaArray[]): Promise<BaseMessage>; /** * @param category * @param description * @description Reports this channel of inappropriate activities. */ report(category: ReportCategory, description: string): Promise<void>; /** * @param user * @param category * @param description * @description Reports a user of suspicious activities. */ reportUser(user: User, category: ReportCategory, description: string): Promise<void>; /** * @param message [UserMessage], [FileMessage] or [MultipleMessage] * @param category * @param description * @description Reports a malicious message. */ reportMessage( message: UserMessage | FileMessage | MultipleFilesMessage, category: ReportCategory, description: string, ): Promise<void>; /** * @param pollId * @param params * @returns * @description Updates fields of this poll with given params. * Once updated successfully, a non-null {@link Poll} instance will be passed to the result. */ updatePoll(pollId: number, params: PollUpdateParams): Promise<Poll>; /** * @param pollId * @description Deletes this poll. Once deleted successfully, `null` will be passed to the result. */ deletePoll(pollId: number): Promise<void>; /** * @param pollId * @returns * @description Closes this poll. Once closed successfully, a non-null {@link Poll} instance will be passed to the result. */ closePoll(pollId: number): Promise<Poll>; /** * @param pollId * @param optionText * @returns * @description Adds an option with optionText to this poll. Once added successfully, a non-null {@link Poll} instance will be passed to the result. */ addPollOption(pollId: number, optionText: string): Promise<Poll>; /** * @param pollId * @param pollOptionId * @param optionText * @returns * @description Updates optionText fields of this poll option. Once updated successfully, a non-null {@link Poll} instance will be passed to the result. */ updatePollOption(pollId: number, pollOptionId: number, optionText: string): Promise<Poll>; /** * @param pollId * @param pollOptionId * @description Deletes this poll option. */ deletePollOption(pollId: number, pollOptionId: number): Promise<void>; /** * @param pollId * @param pollOptionIds * @returns * @description Vote on pollOptionIds. * This operation overrides previous vote actions, so to update previous vote, pass new pollOptionIds as parameter. * To cancel votes, pass an empty list as pollOptionIds. */ votePoll(pollId: number, pollOptionIds: number[]): Promise<PollVoteEvent>; /** * @param ts * @returns * @description Requests poll change logs after given timestamp. */ getPollChangeLogsSinceTimestamp(ts: number): Promise<PollChangelogs>; /** * @param token * @returns * @description Requests poll change logs after given token. */ getPollChangeLogsSinceToken(token: string | null): Promise<PollChangelogs>; /** * @param limit * @returns * @description Creates a query instance to get the poll list from this channel. */ createPollListQuery(limit?: number): PollListQuery; /** * @param pollId * @param pollOptionId * @param limit * @returns * @description Creates a query instance to get the voters of a poll option. */ createPollVoterListQuery(pollId: number, pollOptionId: number, limit?: number): PollVoterListQuery; } /** * @description The context of channel-related events in colletions. */ declare class BaseChannelEventContext { /** The {@link CollectionEventSource} of the current context. */ readonly source: CollectionEventSource; } declare abstract class BaseListQuery { /** * @description The maximum number of data per queried page. */ readonly limit: number; /** * @description Whether there is a next page. */ get hasNext(): boolean; /** * @description Whether the current query is in communication progress with server. */ get isLoading(): boolean; } declare interface BaseListQueryParams { /** * @description The maximum number of data per queried page. */ limit?: number; } export declare class BaseMessage extends MessagePrototype { /** The ID of the message. */ messageId: number; /** The parent message's ID if this is a reply message. */ parentMessageId: number; /** The parent message of this message. Only NonNull if this message is a reply message. It does not contain all properties of the parent message. */ parentMessage: BaseMessage | null; /** Checks whether the message is silent or not. */ silent: boolean; /** Whether the message was sent from an operator. */ isOperatorMessage: boolean; /** The thread info of the message. */ threadInfo: ThreadInfo | null; /** The reactions on the message. */ reactions: Reaction[]; /** The {@link OGMetaData} of the message. Might be null if */ ogMetaData: OGMetaData | null; /** The apple critical alert options of the message. */ appleCriticalAlertOptions: AppleCriticalAlertOptions | null; /** The scheduled info of the message if this is a scheduled message */ scheduledInfo: ScheduledInfo | null; /** The suggested replies of the message. */ suggestedReplies: string[] | null; /** * My feedback of the message. Not null, if its {@link FeedbackStatus} is <b>FeedbackStatus.SUBMITTED</b> Null, * if its FeedbackStatus is <b>FeedbackStatus.NOT_APPLICABLE</b> or <b>FeedbackStatus.NO_FEEDBACK/b>. */ myFeedback: Feedback | null; /** My feedback status of the message. */ myFeedbackStatus: FeedbackStatus; /** List of {@link Form} that allow users to input their information or opinions */ forms: Form[] | null; isIdentical(message: BaseMessage): boolean; /** * @param threadInfoUpdateEvent * @returns * @description Applies {@link ThreadInfoUpdateEvent} to a message. */ applyThreadInfoUpdateEvent(threadInfoUpdateEvent: ThreadInfoUpdateEvent): boolean; /** * @param reactionEvent * @description Applies {@link ReactionEvent} to message. */ applyReactionEvent(reactionEvent: ReactionEvent): void; /** * @param parentMessage * @returns * @description When parent message is updated, you can update the child message's parent message through this method. * If you use {@link MessageCollection}, messages in the collection are automatically updated, so don't need to call it. */ applyParentMessage(parentMessage: BaseMessage): boolean; /** * @description Marks the message thread as read. */ markThreadAsRead(): Promise<void>; /** * @param pushEnabled * @description Sets push notification enabled for the thread. */ setPushNotificationEnabled(pushEnabled: boolean): Promise<void>; /** * @deprecated since v4.10.6. Use submitForm({ form: Form }) instead. */ submitForm(data: { formId?: string; answers?: Record<string, string> }): Promise<void>; /** * @param data * @description Submits the feedback for the message. * The feedback can be submitted only when the {@link FeedbackStatus} is {@link FeedbackStatus.NO_FEEDBACK}. */ submitFeedback(data: Pick<Feedback, 'rating' | 'comment'>): Promise<void>; /** * @param data * @description Updates the feedback for the message. * The feedback can be updated only when the {@link FeedbackStatus} is {@link FeedbackStatus.SUBMITTED}. */ updateFeedback(data: Feedback): Promise<void>; /** * @param feedbackId * @description Deletes the feedback for the message. * The feedback can be deleted only when the {@link FeedbackStatus} is {@link FeedbackStatus.SUBMITTED}. */ deleteFeedback(feedbackId: number): Promise<void>; } /** * @description Collection that handles message lists, also supporting local caching. */ declare abstract class BaseMessageCollection< Channel extends BaseChannel, Message extends MessagePrototype, MessageKeyType extends number | string, > { /** The filter to show matched messages only. */ readonly filter: MessageFilter; /** The channel of the messages. */ get channel(): Channel; /** The list of succeeded message list in this collection. */ get succeededMessages(): Message[]; /** The failed message lists. */ get failedMessages(): (UserMessage | FileMessage | MultipleFilesMessage)[]; /** The pending message lists. */ get pendingMessages(): (UserMessage | FileMessage | MultipleFilesMessage)[]; /** Whether there's more data to load in previous (oldest) direction. */ get hasPrevious(): boolean; /** Whether there's more data to load in next (latest) direction. */ get hasNext(): boolean; /** * @param policy * @returns * @description Initializes this collection from `startingPoint`. */ initialize(policy: MessageCollectionInitPolicy): MessageCollectionInitHandler<Message>; /** * @returns * @description Loads previous (oldest direction) message lists. */ loadPrevious(): Promise<Message[]>; /** * @returns * @description Loads next (latest direction) message lists. */ loadNext(): Promise<Message[]>; /** * @param reqId * @description Remove specific failed message of the channel. */ removeFailedMessage(reqId: string): Promise<void>; /** * @returns * @description Disposes current {@link BaseMessageCollection} and stops all events from being received. */ dispose(): void; } /** * @description An interface used in {@link MessageCollection}. */ declare interface BaseMessageCollectionEventHandler< Channel extends BaseChannel, Message extends MessagePrototype, MessageKeyType, ChannelEventContext extends BaseChannelEventContext, MessageEventContext extends BaseMessageEventContext, > { /** * @param context * @param channel * @returns * @description Called when there's a change in the channel this collection holds. */ onChannelUpdated?: (context: ChannelEventContext, channel: Channel) => void; /** * @param context * @param channelUrl * @returns * @description Called when the channel this collection holds is deleted. */ onChannelDeleted?: (context: ChannelEventContext, channelUrl: string) => void; /** * @param context * @param channel * @param messages * @returns * @description Called when one or more {@link BaseMessage} is added to this collection. */ onMessagesAdded?: (context: MessageEventContext, channel: Channel, messages: Message[]) => void; /** * @param context * @param channel * @param messages * @returns * @description Called when one or more {@link BaseMessage} is update in this collection. */ onMessagesUpdated?: (context: MessageEventContext, channel: Channel, messages: Message[]) => void; /** * @param context * @param channel * @param messageIds Deprecated since v4.3.1. Use messages instead. * @param messages * @returns * @description Called when one or more {@link BaseMessage} is deleted from this collection. */ onMessagesDeleted?: ( context: MessageEventContext, channel: Channel, messageIds: MessageKeyType[], messages: Message[], ) => void; /** * @returns * @description Called when the collection has detected a huge gap between current message list. * This can happen SDK checks for missing messages, which occurs in two cases. */ onHugeGapDetected?: () => void; } declare interface BaseMessageCollectionParams { filter?: MessageFilter; startingPoint?: number; /** * @deprecated since v4.10.5. Use `prevResultLimit`/`nextResultLimit` instead. */ limit?: number; prevResultLimit?: number; nextResultLimit?: number; } export /** * @description Represents a base message params. */ declare interface BaseMessageCreateParams { /** The data of the message. */ data?: string; /** The custom type of the message. */ customType?: string; /** The mention type of the message. (default: {@link MentionType.USERS}). */ mentionType?: MentionType; /** The mentioned user IDs of the message. */ mentionedUserIds?: string[]; /** The mentioned users of the message. */ mentionedUsers?: User[]; /** The mentioned message template. */ mentionedMessageTemplate?: string; /** The meta arrays of the message. */ metaArrays?: MessageMetaArray[]; /** The parent message ID of the message. */ parentMessageId?: number; /** Whether the message should also be sent to the channel. (default: false) */ isReplyToChannel?: boolean; /** The push notification delivery option user of the message. */ pushNotificationDeliveryOption?: PushNotificationDeliveryOption; /** The apple critical alert options of the message. */ appleCriticalAlertOptions?: AppleCriticalAlertOptions; /** Whether the message should be pinned to the channel. (default: false) */ isPinnedMessage?: boolean; } /** * @description The context of message-related events in colletions. */ declare class BaseMessageEventContext { /** The {@link CollectionEventSource} of the current context. */ readonly source: CollectionEventSource; } export /** * @description Represents a base message params. */ declare interface BaseMessageUpdateParams { /** The data of the message. */ data?: string; /** The custom type of the message. */ customType?: string; /** The mention type of the message. */ mentionType?: MentionType; /** The mentioned user IDs of the message. */ mentionedUserIds?: string[]; /** The mentioned users of the message. */ mentionedUsers?: User[]; /** The mentioned message template. */ mentionedMessageTemplate?: string; /** The meta arrays of the message. */ metaArrays?: MessageMetaArray[]; /** The push notification delivery option user of the message. */ pushNotificationDeliveryOption?: PushNotificationDeliveryOption; /** The apple critical alert options of the message. */ appleCriticalAlertOptions?: AppleCriticalAlertOptions; } declare abstract class BaseStore { dbname: string; readonly itemSizeLimit: number; readonly metadataBuffer: number; readonly encryption: Encryption; constructor(props: BaseStoreParams); abstract checkAvailability(): Promise<void>; abstract init(dbname: string): Promise<void>; abstract clear(): Promise<void>; get adjustedItemSizeLimit(): number; usage(): Promise<number>; getAllKeys(): Promise<string[]>; get(key: string): Promise<object | null>; set(item: StoreItem): Promise<object>; setMany(items: StoreItem[]): Promise<object[]>; remove(key: string): Promise<boolean>; removeMany(keys: string[]): Promise<string[]>; } declare interface BaseStoreParams { encryption?: Encryption; itemSizeLimit?: number; metadataBuffer?: number; } export /** * @description A class representing query to retrieve lists related to blocked User. */ declare class BlockedUserListQuery extends BaseListQuery { /** * @description User IDs filter. User list containing the passed User IDs will be returned. */ readonly userIdsFilter: string[] | null; /** * @returns * @description Gets the list of Users. * If this method is repeatedly called after each next is finished, * it retrieves the following pages of the User list. * If there is no more pages to be read, an empty List (not null) is returned. */ next(): Promise<User[]>; } export declare interface BlockedUserListQueryParams extends BaseListQueryParams { /** * @description User IDs filter. User list containing the passed User IDs will be returned. */ userIdsFilter?: string[]; } export declare class CachedChannelInfo { get channel(): GroupChannel; get cachedMessageCount(): number; } export declare enum CachedDataClearOrder { CUSTOM = 'custom', MESSAGE_COLLECTION_ACCESSED_AT = 'messagecollection_accessed_at', } declare abstract class ChannelDataListQuery extends BaseListQuery { /** * @description A channel URL. */ readonly channelUrl: string; /** * @description A channel type. */ readonly channelType: ChannelType; } declare interface ChannelDataListQueryParams extends BaseListQueryParams { /** * @description A channel URL. */ channelUrl: string; /** * @description A channel type. */ channelType: ChannelType; } export /** Represents channel types. */ declare enum ChannelType { BASE = 'base', GROUP = 'group', OPEN = 'open', FEED = 'feed', } export /** * @description Represents the source of the collection event. */ declare enum CollectionEventSource { UNKNOWN = 'UNKNOWN', EVENT_CHANNEL_CREATED = 'EVENT_CHANNEL_CREATED', EVENT_CHANNEL_UPDATED = 'EVENT_CHANNEL_UPDATED', EVENT_CHANNEL_DELETED = 'EVENT_CHANNEL_DELETED', EVENT_CHANNEL_READ = 'EVENT_CHANNEL_READ', EVENT_CHANNEL_DELIVERED = 'EVENT_CHANNEL_DELIVERED', EVENT_CHANNEL_INVITED = 'EVENT_CHANNEL_INVITED', EVENT_CHANNEL_JOINED = 'EVENT_CHANNEL_JOINED', EVENT_CHANNEL_LEFT = 'EVENT_CHANNEL_LEFT', EVENT_CHANNEL_ACCEPTED_INVITE = 'EVENT_CHANNEL_ACCEPTED_INVITE', EVENT_CHANNEL_DECLINED_INVITE = 'EVENT_CHANNEL_DECLINED_INVITE', EVENT_CHANNEL_OPERATOR_UPDATED = 'EVENT_CHANNEL_OPERATOR_UPDATED', EVENT_CHANNEL_BANNED = 'EVENT_CHANNEL_BANNED', EVENT_CHANNEL_UNBANNED = 'EVENT_CHANNEL_UNBANNED', EVENT_CHANNEL_MUTED = 'EVENT_CHANNEL_MUTED', EVENT_CHANNEL_UNMUTED = 'EVENT_CHANNEL_UNMUTED', EVENT_CHANNEL_FROZEN = 'EVENT_CHANNEL_FROZEN', EVENT_CHANNEL_UNFROZEN = 'EVENT_CHANNEL_UNFROZEN', EVENT_CHANNEL_HIDDEN = 'EVENT_CHANNEL_HIDDEN', EVENT_CHANNEL_UNHIDDEN = 'EVENT_CHANNEL_UNHIDDEN', EVENT_CHANNEL_RESET_HISTORY = 'EVENT_CHANNEL_RESET_HISTORY', EVENT_CHANNEL_TYPING_STATUS_UPDATE = 'EVENT_CHANNEL_TYPING_STATUS_UPDATE', EVENT_CHANNEL_MEMBER_COUNT_UPDATED = 'EVENT_CHANNEL_MEMBER_COUNT_UPDATED', EVENT_CHANNEL_METADATA_CREATED = 'EVENT_CHANNEL_METADATA_CREATED', EVENT_CHANNEL_METADATA_UPDATED = 'EVENT_CHANNEL_METADATA_UPDATED', EVENT_CHANNEL_METADATA_DELETED = 'EVENT_CHANNEL_METADATA_DELETED', EVENT_CHANNEL_METACOUNTER_CREATED = 'EVENT_CHANNEL_METACOUNTER_CREATED', EVENT_CHANNEL_METACOUNTER_UPDATED = 'EVENT_CHANNEL_METACOUNTER_UPDATED', EVENT_CHANNEL_METACOUNTER_DELETED = 'EVENT_CHANNEL_METACOUNTER_DELETED', EVENT_THREAD_INFO_UPDATED = 'EVENT_THREAD_INFO_UPDATED', EVENT_MESSAGE_SENT = 'EVENT_MESSAGE_SENT', EVENT_MESSAGE_RECEIVED = 'EVENT_MESSAGE_RECEIVED', EVENT_MESSAGE_UPDATED = 'EVENT_MESSAGE_UPDATED', EVENT_PINNED_MESSAGE_UPDATED = 'EVENT_PINNED_MESSAGE_UPDATED', REQUEST_CHANNEL = 'REQUEST_CHANNEL', REQUEST_CHANNEL_CHANGELOGS = 'REQUEST_CHANNEL_CHANGELOGS', REFRESH_CHANNEL = 'REFRESH_CHANNEL', CHANNEL_LASTACCESSEDAT_UPDATED = 'CHANNEL_LASTACCESSEDAT_UPDATED', SYNC_CHANNEL_BACKGROUND = 'SYNC_CHANNEL_BACKGROUND', SYNC_CHANNEL_CHANGELOGS = 'SYNC_CHANNEL_CHANGELOGS', EVENT_MESSAGE_SENT_SUCCESS = 'EVENT_MESSAGE_SENT_SUCCESS', EVENT_MESSAGE_SENT_FAILED = 'EVENT_MESSAGE_SENT_FAILED', EVENT_MESSAGE_SENT_PENDING = 'EVENT_MESSAGE_SENT_PENDING', EVENT_MESSAGE_DELETED = 'EVENT_MESSAGE_DELETED', EVENT_MESSAGE_FEEDBACK_ADDED = 'EVENT_MESSAGE_FEEDBACK_ADDED', EVENT_MESSAGE_FEEDBACK_UPDATED = 'EVENT_MESSAGE_FEEDBACK_UPDATED', EVENT_MESSAGE_FEEDBACK_DELETED = 'EVENT_MESSAGE_FEEDBACK_DELETED', /** * @deprecated since v4.3.1 */ EVENT_MESSAGE_READ = 'EVENT_MESSAGE_READ', /** * @deprecated since v4.3.1 */ EVENT_MESSAGE_DELIVERED = 'EVENT_MESSAGE_DELIVERED', EVENT_MESSAGE_REACTION_UPDATED = 'EVENT_MESSAGE_REACTION_UPDATED', EVENT_MESSAGE_THREADINFO_UPDATED = 'EVENT_MESSAGE_THREADINFO_UPDATED', EVENT_MESSAGE_OFFSET_UPDATED = 'EVENT_MESSAGE_OFFSET_UPDATED', REQUEST_MESSAGE = 'REQUEST_MESSAGE', EVENT_POLL_UPDATED = 'EVENT_POLL_UPDATED', EVENT_POLL_VOTED = 'EVENT_POLL_VOTED', SYNC_POLL_CHANGELOGS = 'SYNC_POLL_CHANGELOGS', REQUEST_RESEND_MESSAGE = 'REQUEST_RESEND_MESSAGE', REQUEST_THREADED_MESSAGE = 'REQUEST_THREADED_MESSAGE', REQUEST_MESSAGE_CHANGELOGS = 'REQUEST_MESSAGE_CHANGELOGS', SYNC_MESSAGE_FILL = 'SYNC_MESSAGE_FILL', SYNC_MESSAGE_BACKGROUND = 'SYNC_MESSAGE_BACKGROUND', SYNC_MESSAGE_CHANGELOGS = 'SYNC_MESSAGE_CHANGELOGS', LOCAL_MESSAGE_PENDING_CREATED = 'LOCAL_MESSAGE_PENDING_CREATED', LOCAL_MESSAGE_FAILED = 'LOCAL_MESSAGE_FAILED', LOCAL_MESSAGE_CANCELED = 'LOCAL_MESSAGE_CANCELED', LOCAL_MESSAGE_RESEND_STARTED = 'LOCAL_MESSAGE_RESEND_STARTED', } declare type Comparator<T> = (value: T, other: T) => number; export /** * @description Connection handler. This handler provides callbacks for automatically managed reconnection events. * SendbirdChat tries reconnection when the connection is lost. This handler can be used to track the reconnection state. * To add or remove this handler, refer to sendbirdChat.addConnectionHandler() and sendbirdChat.removeConnectionHandler(). */ declare class ConnectionHandler extends ConnectionHandlerParams { constructor(params?: ConnectionHandlerParams); } declare abstract class ConnectionHandlerParams { /** A callback for when SendbirdChat is connected. */ onConnected?: (userId: string) => void; /** A callback for when SendbirdChat tries to reconnect. */ onReconnectStarted?: () => void; /** A callback for when connection is reestablished. */ onReconnectSucceeded?: () => void; /** A callback for when reconnection is failed. */ onReconnectFailed?: () => void; /** A callback for when SendbirdChat is disconnected. */ onDisconnected?: (userId: string) => void; } export /** * @description SDK connection state. */ declare enum ConnectionState { CONNECTING = 'CONNECTING', OPEN = 'OPEN', CLOSED = 'CLOSED', } export /** The count preference. Refer to {@link GroupChannel.setMyCountPreference}. */ declare enum CountPreference { ALL = 'all', UNREAD_MESSAGE_COUNT_ONLY = 'unread_message_count_only', UNREAD_MENTION_COUNT_ONLY = 'unread_mention_count_only', OFF = 'off', } export /** * @description Object representing delivery status. */ declare class DeliveryStatus { /** The channel URL of the channel that the message is delivered. */ readonly channelUrl: string; /** The channel type of the channel that the message is delivered. */ readonly channelType: string; /** The member of the channel. The delivery time of this member can be got by calling timestamp. */ readonly member: User; /** The delivery time of a member. */ readonly deliveryAt: number; } export declare interface DeviceOsInfo { platform: DeviceOsPlatform; version?: string; } export declare enum DeviceOsPlatform { ANDROID = 'android', IOS = 'ios', WEB = 'web', MOBILE_WEB = 'mobile_web', WINDOWS = 'windows', } export declare interface DoNotDisturbPreference { doNotDisturbOn: boolean; startHour?: number; startMin?: number; endHour?: number; endMin?: number; timezone?: string; } export /** * @description Represents an emoji. */ declare class Emoji { /** The key of the emoji. */ readonly key: string; /** The url of the emoji. */ readonly url: string; } export /** * @description Represents an emoji category. */ declare class EmojiCategory { /** The ID of the emoji category. */ readonly id: number; /** The name of the emoji category. */ readonly name: string; /** The url of the emoji category. */ readonly url: string; /** The list of emojis. */ readonly emojis: Emoji[]; } export /** * @description Represents an emoji container. */ declare class EmojiContainer { /** The hash value of emoji information. */ readonly emojiHash: string; /** The list of emoji categories. */ readonly emojiCategories: EmojiCategory[]; } export declare interface Encryption { encrypt: (obj: object) => object; decrypt: (encrypted: object) => object; } export declare type FailedMessageHandler<T> = (err: Error, message: T | null) => void; export /** * @description User's feedback data about the message. */ declare class Feedback { /** The feedback ID. This is used for deleting the feedback. */ readonly id: number; /** The feedback rating. */ readonly rating: FeedbackRating; /** The feedback comment. */ readonly comment?: string; } export /** * @description The feedback rating the user gave. */ declare enum FeedbackRating { GOOD = 'good', BAD = 'bad', } export /** The status of the feedback in the message. */ declare type FeedbackStatus = /** Feedback is unavailable for this message. */ | 'NOT_APPLICABLE' /** Feedback can be set for this message, but nothing has been submitted yet. */ | 'NO_FEEDBACK' /** Feedback can be set for this message, and something has been submitted. */ | 'SUBMITTED'; export /** * @description Represents a feed channel. */ declare class FeedChannel extends BaseChannel { /** Weather the category filter is enabled or not. */ readonly isCategoryFilterEnabled: boolean; /** Weather the template label is enabled or not. */ readonly isTemplateLabelEnabled: boolean; /** The list of notification categories. */ readonly notificationCategories: NotificationCategory[]; /** The last message of the channel. */ lastMessage: NotificationMessage | null; get url(): string; get name(): string; set name(value: string); get createdAt(): number; /** Member list for this channel. */ get members(): Member[]; /** The total member count for this channel. */ get memberCount(): number; /** My member state. */ get myMemberState(): MemberState; /** Current user's last read receipt timestamp in channel. */ get myLastRead(): number; /** The unread message count for this channel for the currentUser. */ get unreadMessageCount(): number; /** * @returns * @description Serializes the FeedChannel instance. * The instance can be restored by {@link FeedChannelModule.buildFeedChannelFromSerializedData}. */ serialize(): object; /** * @returns * @description Refreshes all the data of this channel. */ refresh(): Promise<FeedChannel>; /** * @param messages * @description Sends mark as read for given messages. * If the messages are not given, all the messages would get marked as read. */ markAsRead(messages?: NotificationMessage[]): Promise<void>; /** * @param messages * @description Sends mark as clicked for given messages. */ markAsClicked(messages: NotificationMessage[]): Promise<void>; /** * @param messages * @returns * @description Logging impression for statistics. Limitation: IMPRESSION_LOG_LIMIT messages at once. */ logImpression(messages: NotificationMessage[]): Promise<boolean>; /** * @param topic * @param messages * @returns * @description Logging custom stat for statistics. */ logCustom(topic: string, messages: NotificationMessage[]): Promise<boolean>; /** * @param params * @returns * @description Creates NotificationCollection instance for this channel. */ createNotificationCollection(params?: NotificationCollectionParams): NotificationCollection; } export declare class FeedChannelEventContext extends BaseChannelEventContext {} declare type FieldAnswer = string; export declare type FileCompat = File | Blob | FileInfo; export /** * @description File information in React Native. */ declare interface FileInfo { name: string; uri: string; type: string; } export /** * @description Object representing a file message. */ declare class FileMessage extends SendableMessage { /** The messageParams object that used for sending this message For more details. */ messageParams: FileMessageCreateParams | null; /** * The plain file URL, which does not contain sendbirdChat.ekey as a parameter. * If the file authentication feature is enabled, accessing this plainUrl will be denied. */ readonly plainUrl: string; readonly requireAuth: boolean; /** Represents the name of the file. */ readonly name: string; /** Represents the size of the file. */ readonly size: number; /** Represents the type of the file. <b>MIME preferred</b>. */ readonly type: string; /** Represents the thumbnail information of image file. */ readonly thumbnails: Thumbnail[]; /** The message's survival seconds. */ readonly messageSurvivalSeconds: number; /** * The file URL. If the file encryption feature is enabled, this will have sendbirdChat.eKey combined with the plainUrl so the file can be accessed. * For caching the file, it is recommended to use plainUrl as the key of the file cache. */ get url(): string; /** * @param ts * @param params * @returns * @description Retrieves the threaded replies of the current message depending on the timestamp. * If the current message doesn’t have replies, the result is an empty list. */ getThreadedMessagesByTimestamp( ts: number, params: ThreadedMessageListParams, ): Promise<{ parentMessage: BaseMessage; threadedMessages: BaseMessage[]; }>; } export /** * @description Represents a file message params. */ declare interface FileMessageCreateParams extends BaseMessageCreateParams { /** The file object of the message. */ file?: FileCompat; /** The file's url of the message. */ fileUrl?: string; /** The file's name of the message. */ fileName?: string; /** The file's size of the message. */ fileSize?: number; /** The file's mime type of the message. */ mimeType?: string; /** The file's thumbnail sizes of the message. */ thumbnailSizes?: ThumbnailSize[]; } export /** * @description Represents a file message params. */ declare interface FileMessageUpdateParams extends BaseMessageUpdateParams {} export declare type FileUploadHandler = ( requestId: string, index: number, uploadableFileInfo: UploadableFileInfo, err?: Error, ) => void; export /** * @description Represents a file upload params. */ declare interface FileUploadParams { /** A file binary to upload. */ file: File | Blob; /** The file's thumbnail sizes. */ thumbnailSizes?: ThumbnailSize[]; /** A upload started event handler. It gives a `requestId` that could be used to cancel the upload. */ uploadStartedHandler?: UploadStartedHandler; /** A file upload progress handler to catch the status of uploading progress. */ progressHandler?: UploadProgressHandler; } export /** File upload result with URL and thumbnails. */ declare interface FileUploadResult { requestId: string; url: string; thumbnails?: Thumbnail[]; } export /** * @description Represents a form. */ declare class Form { /** The ID of the message to which the corresponding form belongs. */ readonly messageId: number; /** The key of the form. */ readonly key: FormKey; /** * @deprecated * The key of the form. Use `key` instead. */ formKey: FormKey; /** A set of fields representing a single question and its corresponding response. */ fields: FormField[]; /** The submitted answer to this form field. `null` if it is not submitted yet. */ answers?: FormAnswers; /** Whether this form is submitted or not. */ get isSubmitted(): boolean; /** Whether this form is submittable or not. */ get isSubmittable(): boolean; /** * @param key * @returns * @description Gets a field answer for the key. */ getFieldAnswer(key: FormKey): FieldAnswer | undefined; } declare type FormAnswers = Record<FormFieldKey, FieldAnswer>; export /** * @description Represents a form field where users can enter values. */ declare class FormField { /** The key of the form field. */ readonly key: FormFieldKey; /** The title of the form field. */ readonly title: string; /** The input type of the form field. */ readonly inputType: FormFieldInputType; /** Whether this form field is required or not. */ readonly required: boolean; /** The regular expression of this form field to validate the input value. */ readonly regex?: string; /** The placeholder of this form field when the input value is empty. */ readonly placeholder?: string; /** * @deprecated Use `FormField.key` instead. * */ read