stream-chat
Version:
JS SDK for the Stream Chat API
94 lines (93 loc) • 4.96 kB
TypeScript
import type { StreamChat } from './client';
import type { APIResponse, BatchChannelDataUpdate, NewMemberPayload, UpdateChannelsBatchFilters, UpdateChannelsBatchResponse } from './types';
/**
* ChannelBatchUpdater - A class that provides convenience methods for batch channel operations
*/
export declare class ChannelBatchUpdater {
client: StreamChat;
constructor(client: StreamChat);
/**
* addMembers - Add members to channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @param {string[] | NewMemberPayload[]} members Members to add
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
addMembers(filter: UpdateChannelsBatchFilters, members: string[] | NewMemberPayload[]): Promise<APIResponse & UpdateChannelsBatchResponse>;
/**
* removeMembers - Remove members from channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @param {string[]} members Member IDs to remove
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
removeMembers(filter: UpdateChannelsBatchFilters, members: string[]): Promise<APIResponse & UpdateChannelsBatchResponse>;
/**
* inviteMembers - Invite members to channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @param {string[] | NewMemberPayload[]} members Members to invite
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
inviteMembers(filter: UpdateChannelsBatchFilters, members: string[] | NewMemberPayload[]): Promise<APIResponse & UpdateChannelsBatchResponse>;
/**
* addModerators - Add moderators to channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @param {string[]} members Member IDs to promote to moderator
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
addModerators(filter: UpdateChannelsBatchFilters, members: string[]): Promise<APIResponse & UpdateChannelsBatchResponse>;
/**
* demoteModerators - Remove moderator role from members in channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @param {string[]} members Member IDs to demote
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
demoteModerators(filter: UpdateChannelsBatchFilters, members: string[]): Promise<APIResponse & UpdateChannelsBatchResponse>;
/**
* assignRoles - Assign roles to members in channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @param {NewMemberPayload[]} members Members with role assignments
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
assignRoles(filter: UpdateChannelsBatchFilters, members: NewMemberPayload[]): Promise<APIResponse & UpdateChannelsBatchResponse>;
/**
* hide - Hide channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
hide(filter: UpdateChannelsBatchFilters): Promise<APIResponse & UpdateChannelsBatchResponse>;
/**
* show - Show channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
show(filter: UpdateChannelsBatchFilters): Promise<APIResponse & UpdateChannelsBatchResponse>;
/**
* archive - Archive channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
archive(filter: UpdateChannelsBatchFilters): Promise<APIResponse & UpdateChannelsBatchResponse>;
/**
* unarchive - Unarchive channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
unarchive(filter: UpdateChannelsBatchFilters): Promise<APIResponse & UpdateChannelsBatchResponse>;
/**
* updateData - Update data on channels matching the filter
*
* @param {UpdateChannelsBatchFilters} filter Filter to select channels
* @param {BatchChannelDataUpdate} data Data to update
* @return {Promise<APIResponse & UpdateChannelsBatchResponse>} The server response
*/
updateData(filter: UpdateChannelsBatchFilters, data: BatchChannelDataUpdate): Promise<APIResponse & UpdateChannelsBatchResponse>;
}