ChatClient class
チャット操作を実行するクライアント
コンストラクター
Chat |
特定のリソースとユーザーの ChatClient のインスタンスを作成します。 |
メソッド
コンストラクターの詳細
ChatClient(string, CommunicationTokenCredential, ChatClientOptions)
特定のリソースとユーザーの ChatClient のインスタンスを作成します。
new ChatClient(endpoint: string, credential: CommunicationTokenCredential, options?: ChatClientOptions)
パラメーター
- endpoint
-
string
Communication Services リソースの URL。
- credential
- CommunicationTokenCredential
トークン資格情報。 資格情報を作成するには、 から @azure/communication-common AzureCommunicationTokenCredential を使用します。
- options
- ChatClientOptions
その他のクライアント オプション。
メソッドの詳細
createChatThread(CreateChatThreadRequest, CreateChatThreadOptions)
チャット スレッドを作成します。 作成されたスレッドの ID を持つスレッド クライアントを返します。
function createChatThread(request: CreateChatThreadRequest, options?: CreateChatThreadOptions): Promise<CreateChatThreadResult>
パラメーター
- request
- CreateChatThreadRequest
チャット スレッドを作成するための要求。
- options
- CreateChatThreadOptions
操作オプション。
戻り値
Promise<CreateChatThreadResult>
deleteChatThread(string, OperationOptions)
チャット スレッドを削除します。
function deleteChatThread(threadId: string, options?: OperationOptions): Promise<void>
パラメーター
- threadId
-
string
削除するスレッドの ID。
- options
- OperationOptions
操作オプション。
戻り値
Promise<void>
getChatThreadClient(string)
特定のスレッド ID を持つ ChatThreadClient を返します。
function getChatThreadClient(threadId: string): ChatThreadClient
パラメーター
- threadId
-
string
ChatThreadClient のスレッド ID
戻り値
listChatThreads(RestListChatThreadsOptions)
ユーザーのチャット スレッドの一覧を取得します。
function listChatThreads(options?: RestListChatThreadsOptions): PagedAsyncIterableIterator<ChatThreadItem, ChatThreadItem[], PageSettings>
パラメーター
- options
- RestListChatThreadsOptions
チャット スレッドのオプションを一覧表示します。
戻り値
off("chatMessageDeleted", (e: ChatMessageDeletedEvent) => void)
chatMessageDeleted の登録を解除します。
function off(event: "chatMessageDeleted", listener: (e: ChatMessageDeletedEvent) => void)
パラメーター
- event
-
"chatMessageDeleted"
ChatMessageDeletedEvent。
- listener
-
(e: ChatMessageDeletedEvent) => void
イベントを処理するリスナー。
off("chatMessageEdited", (e: ChatMessageEditedEvent) => void)
chatMessageEdited の登録を解除します。
function off(event: "chatMessageEdited", listener: (e: ChatMessageEditedEvent) => void)
パラメーター
- event
-
"chatMessageEdited"
ChatMessageEditedEvent。
- listener
-
(e: ChatMessageEditedEvent) => void
イベントを処理するリスナー。
off("chatMessageReceived", (e: ChatMessageReceivedEvent) => void)
chatMessageReceived の登録を解除します。
function off(event: "chatMessageReceived", listener: (e: ChatMessageReceivedEvent) => void)
パラメーター
- event
-
"chatMessageReceived"
ChatMessageReceivedEvent。
- listener
-
(e: ChatMessageReceivedEvent) => void
イベントを処理するリスナー。
off("chatThreadCreated", (e: ChatThreadCreatedEvent) => void)
chatThreadCreated の登録を解除します。
function off(event: "chatThreadCreated", listener: (e: ChatThreadCreatedEvent) => void)
パラメーター
- event
-
"chatThreadCreated"
ChatThreadCreatedEvent。
- listener
-
(e: ChatThreadCreatedEvent) => void
イベントを処理するリスナー。
off("chatThreadDeleted", (e: ChatThreadDeletedEvent) => void)
chatThreadDeleted の登録を解除します。
function off(event: "chatThreadDeleted", listener: (e: ChatThreadDeletedEvent) => void)
パラメーター
- event
-
"chatThreadDeleted"
ChatThreadDeletedEvent。
- listener
-
(e: ChatThreadDeletedEvent) => void
イベントを処理するリスナー。
off("chatThreadPropertiesUpdated", (e: ChatThreadPropertiesUpdatedEvent) => void)
chatThreadPropertiesUpdated の登録を解除します。
function off(event: "chatThreadPropertiesUpdated", listener: (e: ChatThreadPropertiesUpdatedEvent) => void)
パラメーター
- event
-
"chatThreadPropertiesUpdated"
ChatThreadPropertiesUpdatedEvent。
- listener
-
(e: ChatThreadPropertiesUpdatedEvent) => void
イベントを処理するリスナー。
off("participantsAdded", (e: ParticipantsAddedEvent) => void)
参加者の登録を解除する追加。
function off(event: "participantsAdded", listener: (e: ParticipantsAddedEvent) => void)
パラメーター
- event
-
"participantsAdded"
ParticipantsAddedEvent。
- listener
-
(e: ParticipantsAddedEvent) => void
イベントを処理するリスナー。
off("participantsRemoved", (e: ParticipantsRemovedEvent) => void)
参加者の登録を解除するRemoved。
function off(event: "participantsRemoved", listener: (e: ParticipantsRemovedEvent) => void)
パラメーター
- event
-
"participantsRemoved"
ParticipantsRemovedEvent。
- listener
-
(e: ParticipantsRemovedEvent) => void
イベントを処理するリスナー。
off("readReceiptReceived", (e: ReadReceiptReceivedEvent) => void)
readReceiptReceived の登録を解除します。
function off(event: "readReceiptReceived", listener: (e: ReadReceiptReceivedEvent) => void)
パラメーター
- event
-
"readReceiptReceived"
ReadReceiptReceivedEvent。
- listener
-
(e: ReadReceiptReceivedEvent) => void
イベントを処理するリスナー。
off("typingIndicatorReceived", (e: TypingIndicatorReceivedEvent) => void)
TypingIndicatorReceived の登録を解除します。
function off(event: "typingIndicatorReceived", listener: (e: TypingIndicatorReceivedEvent) => void)
パラメーター
- event
-
"typingIndicatorReceived"
TypingIndicatorReceivedEvent。
- listener
-
(e: TypingIndicatorReceivedEvent) => void
イベントを処理するリスナー。
on("chatMessageDeleted", (e: ChatMessageDeletedEvent) => void)
chatMessageDeleted のサブスクライブ関数。 最初の送信者もこのイベントを受け取ります。
function on(event: "chatMessageDeleted", listener: (e: ChatMessageDeletedEvent) => void)
パラメーター
- event
-
"chatMessageDeleted"
ChatMessageDeletedEvent。
- listener
-
(e: ChatMessageDeletedEvent) => void
イベントを処理するリスナー。
on("chatMessageEdited", (e: ChatMessageEditedEvent) => void)
chatMessageEdited のサブスクライブ関数。 最初の送信者もこのイベントを受け取ります。
function on(event: "chatMessageEdited", listener: (e: ChatMessageEditedEvent) => void)
パラメーター
- event
-
"chatMessageEdited"
ChatMessageEditedEvent。
- listener
-
(e: ChatMessageEditedEvent) => void
イベントを処理するリスナー。
on("chatMessageReceived", (e: ChatMessageReceivedEvent) => void)
chatMessageReceived のサブスクライブ関数。 最初の送信者もこのイベントを受け取ります。 イベントをサブスクライブする前に、startRealtimeNotifications を呼び出す必要があります。
function on(event: "chatMessageReceived", listener: (e: ChatMessageReceivedEvent) => void)
パラメーター
- event
-
"chatMessageReceived"
ChatMessageReceivedEvent。
- listener
-
(e: ChatMessageReceivedEvent) => void
イベントを処理するリスナー。
on("chatThreadCreated", (e: ChatThreadCreatedEvent) => void)
chatThreadCreated のサブスクライブ関数。
function on(event: "chatThreadCreated", listener: (e: ChatThreadCreatedEvent) => void)
パラメーター
- event
-
"chatThreadCreated"
ChatThreadCreatedEvent。
- listener
-
(e: ChatThreadCreatedEvent) => void
イベントを処理するリスナー。
on("chatThreadDeleted", (e: ChatThreadDeletedEvent) => void)
chatThreadDeleted のサブスクライブ関数。
function on(event: "chatThreadDeleted", listener: (e: ChatThreadDeletedEvent) => void)
パラメーター
- event
-
"chatThreadDeleted"
ChatThreadDeletedEvent。
- listener
-
(e: ChatThreadDeletedEvent) => void
イベントを処理するリスナー。
on("chatThreadPropertiesUpdated", (e: ChatThreadPropertiesUpdatedEvent) => void)
chatThreadPropertiesUpdated の Subscribe 関数。
function on(event: "chatThreadPropertiesUpdated", listener: (e: ChatThreadPropertiesUpdatedEvent) => void)
パラメーター
- event
-
"chatThreadPropertiesUpdated"
ChatThreadPropertiesUpdatedEvent。
- listener
-
(e: ChatThreadPropertiesUpdatedEvent) => void
イベントを処理するリスナー。
on("participantsAdded", (e: ParticipantsAddedEvent) => void)
participantsAdded のサブスクライブ関数。
function on(event: "participantsAdded", listener: (e: ParticipantsAddedEvent) => void)
パラメーター
- event
-
"participantsAdded"
ParticipantsAddedEvent。
- listener
-
(e: ParticipantsAddedEvent) => void
イベントを処理するリスナー。
on("participantsRemoved", (e: ParticipantsRemovedEvent) => void)
participantsRemoved のサブスクライブ関数。
function on(event: "participantsRemoved", listener: (e: ParticipantsRemovedEvent) => void)
パラメーター
- event
-
"participantsRemoved"
ParticipantsRemovedEvent。
- listener
-
(e: ParticipantsRemovedEvent) => void
イベントを処理するリスナー。
on("readReceiptReceived", (e: ReadReceiptReceivedEvent) => void)
readReceiptReceived の Subscribe 関数。
function on(event: "readReceiptReceived", listener: (e: ReadReceiptReceivedEvent) => void)
パラメーター
- event
-
"readReceiptReceived"
ReadReceiptReceivedEvent。
- listener
-
(e: ReadReceiptReceivedEvent) => void
イベントを処理するリスナー。
on("realTimeNotificationConnected", () => void)
realTimeNotificationConnected のサブスクライブ関数。
function on(event: "realTimeNotificationConnected", listener: () => void)
パラメーター
- event
-
"realTimeNotificationConnected"
realTimeNotificationConnected イベント
- listener
-
() => void
イベントを処理するリスナー。
on("realTimeNotificationDisconnected", () => void)
realTimeNotificationDisconnected のサブスクライブ関数。
function on(event: "realTimeNotificationDisconnected", listener: () => void)
パラメーター
- event
-
"realTimeNotificationDisconnected"
realTimeNotificationDisconnected イベント
- listener
-
() => void
イベントを処理するリスナー。
on("typingIndicatorReceived", (e: TypingIndicatorReceivedEvent) => void)
TypingIndicatorReceived の Subscribe 関数。 最初の送信者もこのイベントを受け取ります。
function on(event: "typingIndicatorReceived", listener: (e: TypingIndicatorReceivedEvent) => void)
パラメーター
- event
-
"typingIndicatorReceived"
TypingIndicatorReceivedEvent。
- listener
-
(e: TypingIndicatorReceivedEvent) => void
イベントを処理するリスナー。
startRealtimeNotifications()
リアルタイム通知の受信を開始します。 イベントをサブスクライブする前に、この関数を呼び出します。
function startRealtimeNotifications(): Promise<void>
戻り値
Promise<void>
stopRealtimeNotifications()
リアルタイム通知の受信を停止します。 この関数は、すべてのイベントの登録を解除します。
function stopRealtimeNotifications(): Promise<void>
戻り値
Promise<void>