UNPKG

@sendbird/uikit-react

Version:

Sendbird UIKit for React: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.

104 lines (103 loc) 3.73 kB
import React from 'react'; import { User } from '@sendbird/chat'; import type { GroupChannel, GroupChannelCreateParams } from '@sendbird/chat/groupChannel'; import { CHANNEL_TYPE } from '../types'; import { SendbirdChatType } from '../../../lib/Sendbird/types'; declare const CreateChannelContext: React.Context<import("../../../utils/storeManager").Store<CreateChannelState>>; export interface UserListQuery { hasNext?: boolean; next(): Promise<Array<User>>; get isLoading(): boolean; } type OverrideInviteUserType = { users: Array<string>; onClose: () => void; channelType: CHANNEL_TYPE; }; export interface CreateChannelProviderProps { children?: React.ReactElement; userListQuery?(): UserListQuery; /** * Overrides the action of the channel creation button. * */ onCreateChannelClick?(params: OverrideInviteUserType): void; /** * Called when the channel is created. (Should not have onCreateChannelClick for this to invoke.) * */ onChannelCreated(channel: GroupChannel): void; /** * Called just before the channel is created. (Should not have onCreateChannelClick for this to invoke.) * */ onBeforeCreateChannel?(users: Array<string>): GroupChannelCreateParams; /** * @deprecated * Use the onChannelCreated instead */ onCreateChannel?(channel: GroupChannel): void; /** * @deprecated * Use the onCreateChannelClick instead */ overrideInviteUser?(params: OverrideInviteUserType): void; } export interface CreateChannelState { sdk: SendbirdChatType; userListQuery?(): UserListQuery; /** * Overrides the action of the channel creation button. * */ onCreateChannelClick?(params: OverrideInviteUserType): void; /** * Called when the channel is created. (Should not have onCreateChannelClick for this to invoke.) * */ onChannelCreated?(channel: GroupChannel): void; /** * Called just before the channel is created. (Should not have onCreateChannelClick for this to invoke.) * */ onBeforeCreateChannel?(users: Array<string>): GroupChannelCreateParams; pageStep: number; type: CHANNEL_TYPE; /** * @deprecated * Use the onChannelCreated instead */ onCreateChannel?(channel: GroupChannel): void; /** * @deprecated * Use the onCreateChannelClick instead */ overrideInviteUser?(params: OverrideInviteUserType): void; } declare const CreateChannelProvider: React.FC<CreateChannelProviderProps>; declare const useCreateChannelContext: () => { setPageStep: (pageStep: number) => void; setType: (type: CHANNEL_TYPE) => void; createChannel: (params: GroupChannelCreateParams) => Promise<GroupChannel>; sdk: SendbirdChatType; userListQuery?(): UserListQuery; /** * Overrides the action of the channel creation button. * */ onCreateChannelClick?(params: OverrideInviteUserType): void; /** * Called when the channel is created. (Should not have onCreateChannelClick for this to invoke.) * */ onChannelCreated?(channel: GroupChannel): void; /** * Called just before the channel is created. (Should not have onCreateChannelClick for this to invoke.) * */ onBeforeCreateChannel?(users: Array<string>): GroupChannelCreateParams; pageStep: number; type: CHANNEL_TYPE; /** * @deprecated * Use the onChannelCreated instead */ onCreateChannel?(channel: GroupChannel): void; /** * @deprecated * Use the onCreateChannelClick instead */ overrideInviteUser?(params: OverrideInviteUserType): void; }; export { CreateChannelProvider, CreateChannelContext, useCreateChannelContext, };