Condividi tramite


StatefulChatClient interface

Definisce i metodi che consentono l'uso di {@Link @azure/communication-chat#ChatClient} con uno stato generato centralizzato.

L'interfaccia fornisce l'accesso allo stato proxy e consente anche di registrare un gestore per gli eventi di modifica dello stato.

Extends

Metodi

getState()

Contiene tutti gli stati che è possibile eseguire il proxy da ChatClient {@Link come ChatClientState {@Link @azure/communication-chat#ChatClient} ChatClientState}.

offStateChange((state: ChatClientState) => void)

Consente di annullare la registrazione per gli eventi 'stateChanged'.

onStateChange((state: ChatClientState) => void)

Consente a un gestore di essere registrati per gli eventi 'stateChanged'.

Metodi ereditati

createChatThread(CreateChatThreadRequest, CreateChatThreadOptions)

Crea un thread di chat. Restituisce il client thread con l'ID del thread creato.

deleteChatThread(string, OperationOptions)

Elimina un thread di chat.

getChatThreadClient(string)

Restituisce ChatThreadClient con l'ID thread specifico.

listChatThreads(RestListChatThreadsOptions)

Ottiene l'elenco dei thread di chat di un utente.

off("chatMessageDeleted", (e: ChatMessageDeletedEvent) => void)

Annullare la sottoscrizione a chatMessageDeleted.

off("chatMessageEdited", (e: ChatMessageEditedEvent) => void)

Annullare la sottoscrizione da chatMessageEdited.

off("chatMessageReceived", (e: ChatMessageReceivedEvent) => void)

Annullare la sottoscrizione da chatMessageReceived.

off("chatThreadCreated", (e: ChatThreadCreatedEvent) => void)

Annullare la sottoscrizione da chatThreadCreated.

off("chatThreadDeleted", (e: ChatThreadDeletedEvent) => void)

Annullare la sottoscrizione da chatThreadDeleted.

off("chatThreadPropertiesUpdated", (e: ChatThreadPropertiesUpdatedEvent) => void)

Annullare la sottoscrizione da chatThreadPropertiesUpdated.

off("participantsAdded", (e: ParticipantsAddedEvent) => void)

Annullare la sottoscrizione ai partecipantiAggiungi.

off("participantsRemoved", (e: ParticipantsRemovedEvent) => void)

Annullare la sottoscrizione ai partecipantiRe spostata.

off("readReceiptReceived", (e: ReadReceiptReceivedEvent) => void)

Annullare la sottoscrizione da readReceiptReceived.

off("typingIndicatorReceived", (e: TypingIndicatorReceivedEvent) => void)

Annullare la sottoscrizione alla digitazioneIndicatorReceived.

on("chatMessageDeleted", (e: ChatMessageDeletedEvent) => void)

Sottoscrivere la funzione per chatMessageDeleted. Il mittente iniziale riceverà anche questo evento.

on("chatMessageEdited", (e: ChatMessageEditedEvent) => void)

Sottoscrivere la funzione per chatMessageEdited. Il mittente iniziale riceverà anche questo evento.

on("chatMessageReceived", (e: ChatMessageReceivedEvent) => void)

Sottoscrivere la funzione per chatMessageReceived. Il mittente iniziale riceverà anche questo evento. È necessario chiamare startRealtimeNotifications prima di sottoscrivere qualsiasi evento.

on("chatThreadCreated", (e: ChatThreadCreatedEvent) => void)

Funzione di sottoscrizione per chatThreadCreated.

on("chatThreadDeleted", (e: ChatThreadDeletedEvent) => void)

Sottoscrivere la funzione per chatThreadDeleted.

on("chatThreadPropertiesUpdated", (e: ChatThreadPropertiesUpdatedEvent) => void)

Sottoscrivere la funzione per chatThreadPropertiesUpdated.

on("participantsAdded", (e: ParticipantsAddedEvent) => void)

Sottoscrivere la funzione per i partecipantiAggiungi.

on("participantsRemoved", (e: ParticipantsRemovedEvent) => void)

Sottoscrivere la funzione per i partecipantiRe spostata.

on("readReceiptReceived", (e: ReadReceiptReceivedEvent) => void)

Eseguire la sottoscrizione della funzione readReceiptReceived.

on("realTimeNotificationConnected", () => void)

Sottoscrivere la funzione per realTimeNotificationConnected.

on("realTimeNotificationDisconnected", () => void)

Eseguire la sottoscrizione della funzione per realTimeNotificationDisconnected.

on("typingIndicatorReceived", (e: TypingIndicatorReceivedEvent) => void)

Eseguire la sottoscrizione della funzione per digitareIndicatorReceived. Il mittente iniziale riceverà anche questo evento.

startRealtimeNotifications()

Iniziare a ricevere notifiche in tempo reale. Chiamare questa funzione prima di sottoscrivere qualsiasi evento.

stopRealtimeNotifications()

Arrestare la ricezione di notifiche in tempo reale. Questa funzione annulla la sottoscrizione a tutti gli eventi.

Dettagli metodo

getState()

Contiene tutti gli stati che è possibile eseguire il proxy da ChatClient {@Link come ChatClientState {@Link @azure/communication-chat#ChatClient} ChatClientState}.

function getState(): ChatClientState

Restituisce

offStateChange((state: ChatClientState) => void)

Consente di annullare la registrazione per gli eventi 'stateChanged'.

function offStateChange(handler: (state: ChatClientState) => void)

Parametri

handler

(state: ChatClientState) => void

Callback originale da annullare.

onStateChange((state: ChatClientState) => void)

Consente a un gestore di essere registrati per gli eventi 'stateChanged'.

function onStateChange(handler: (state: ChatClientState) => void)

Parametri

handler

(state: ChatClientState) => void

Callback per ricevere lo stato.

Dettagli dei metodi ereditati

createChatThread(CreateChatThreadRequest, CreateChatThreadOptions)

Crea un thread di chat. Restituisce il client thread con l'ID del thread creato.

function createChatThread(request: CreateChatThreadRequest, options?: CreateChatThreadOptions): Promise<CreateChatThreadResult>

Parametri

request
CreateChatThreadRequest

Richiesta di creazione di un thread di chat.

options
CreateChatThreadOptions

Opzioni dell'operazione.

Restituisce

Ereditato da ChatClient.createChatThread

deleteChatThread(string, OperationOptions)

Elimina un thread di chat.

function deleteChatThread(threadId: string, options?: OperationOptions): Promise<void>

Parametri

threadId

string

ID del thread da eliminare.

options
OperationOptions

Opzioni dell'operazione.

Restituisce

Promise<void>

Ereditato da ChatClient.deleteChatThread

getChatThreadClient(string)

Restituisce ChatThreadClient con l'ID thread specifico.

function getChatThreadClient(threadId: string): ChatThreadClient

Parametri

threadId

string

ID thread per ChatThreadClient

Restituisce

Ereditato da ChatClient.getChatThreadClient

listChatThreads(RestListChatThreadsOptions)

Ottiene l'elenco dei thread di chat di un utente.

function listChatThreads(options?: RestListChatThreadsOptions): PagedAsyncIterableIterator<ChatThreadItem, ChatThreadItem[], PageSettings>

Parametri

options
RestListChatThreadsOptions

Elencare le opzioni dei thread di chat.

Restituisce

Ereditato da ChatClient.listChatThreads

off("chatMessageDeleted", (e: ChatMessageDeletedEvent) => void)

Annullare la sottoscrizione a chatMessageDeleted.

function off(event: "chatMessageDeleted", listener: (e: ChatMessageDeletedEvent) => void)

Parametri

event

"chatMessageDeleted"

The ChatMessageDeletedEvent.

listener

(e: ChatMessageDeletedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.off

off("chatMessageEdited", (e: ChatMessageEditedEvent) => void)

Annullare la sottoscrizione da chatMessageEdited.

function off(event: "chatMessageEdited", listener: (e: ChatMessageEditedEvent) => void)

Parametri

event

"chatMessageEdited"

The ChatMessageEditedEvent.

listener

(e: ChatMessageEditedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.off

off("chatMessageReceived", (e: ChatMessageReceivedEvent) => void)

Annullare la sottoscrizione da chatMessageReceived.

function off(event: "chatMessageReceived", listener: (e: ChatMessageReceivedEvent) => void)

Parametri

event

"chatMessageReceived"

The ChatMessageReceivedEvent.

listener

(e: ChatMessageReceivedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.off

off("chatThreadCreated", (e: ChatThreadCreatedEvent) => void)

Annullare la sottoscrizione da chatThreadCreated.

function off(event: "chatThreadCreated", listener: (e: ChatThreadCreatedEvent) => void)

Parametri

event

"chatThreadCreated"

The ChatThreadCreatedEvent.

listener

(e: ChatThreadCreatedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.off

off("chatThreadDeleted", (e: ChatThreadDeletedEvent) => void)

Annullare la sottoscrizione da chatThreadDeleted.

function off(event: "chatThreadDeleted", listener: (e: ChatThreadDeletedEvent) => void)

Parametri

event

"chatThreadDeleted"

The ChatThreadDeletedEvent.

listener

(e: ChatThreadDeletedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.off

off("chatThreadPropertiesUpdated", (e: ChatThreadPropertiesUpdatedEvent) => void)

Annullare la sottoscrizione da chatThreadPropertiesUpdated.

function off(event: "chatThreadPropertiesUpdated", listener: (e: ChatThreadPropertiesUpdatedEvent) => void)

Parametri

event

"chatThreadPropertiesUpdated"

The ChatThreadPropertiesUpdatedEvent.

listener

(e: ChatThreadPropertiesUpdatedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.off

off("participantsAdded", (e: ParticipantsAddedEvent) => void)

Annullare la sottoscrizione ai partecipantiAggiungi.

function off(event: "participantsAdded", listener: (e: ParticipantsAddedEvent) => void)

Parametri

event

"participantsAdded"

PartecipantiAddedEvent.

listener

(e: ParticipantsAddedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.off

off("participantsRemoved", (e: ParticipantsRemovedEvent) => void)

Annullare la sottoscrizione ai partecipantiRe spostata.

function off(event: "participantsRemoved", listener: (e: ParticipantsRemovedEvent) => void)

Parametri

event

"participantsRemoved"

PartecipantiRemovedEvent.

listener

(e: ParticipantsRemovedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.off

off("readReceiptReceived", (e: ReadReceiptReceivedEvent) => void)

Annullare la sottoscrizione da readReceiptReceived.

function off(event: "readReceiptReceived", listener: (e: ReadReceiptReceivedEvent) => void)

Parametri

event

"readReceiptReceived"

The ReadReceiptReceivedEvent.

listener

(e: ReadReceiptReceivedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.off

off("typingIndicatorReceived", (e: TypingIndicatorReceivedEvent) => void)

Annullare la sottoscrizione alla digitazioneIndicatorReceived.

function off(event: "typingIndicatorReceived", listener: (e: TypingIndicatorReceivedEvent) => void)

Parametri

event

"typingIndicatorReceived"

The TypingIndicatorReceivedEvent.

listener

(e: TypingIndicatorReceivedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.off

on("chatMessageDeleted", (e: ChatMessageDeletedEvent) => void)

Sottoscrivere la funzione per chatMessageDeleted. Il mittente iniziale riceverà anche questo evento.

function on(event: "chatMessageDeleted", listener: (e: ChatMessageDeletedEvent) => void)

Parametri

event

"chatMessageDeleted"

The ChatMessageDeletedEvent.

listener

(e: ChatMessageDeletedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("chatMessageEdited", (e: ChatMessageEditedEvent) => void)

Sottoscrivere la funzione per chatMessageEdited. Il mittente iniziale riceverà anche questo evento.

function on(event: "chatMessageEdited", listener: (e: ChatMessageEditedEvent) => void)

Parametri

event

"chatMessageEdited"

The ChatMessageEditedEvent.

listener

(e: ChatMessageEditedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("chatMessageReceived", (e: ChatMessageReceivedEvent) => void)

Sottoscrivere la funzione per chatMessageReceived. Il mittente iniziale riceverà anche questo evento. È necessario chiamare startRealtimeNotifications prima di sottoscrivere qualsiasi evento.

function on(event: "chatMessageReceived", listener: (e: ChatMessageReceivedEvent) => void)

Parametri

event

"chatMessageReceived"

The ChatMessageReceivedEvent.

listener

(e: ChatMessageReceivedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("chatThreadCreated", (e: ChatThreadCreatedEvent) => void)

Funzione di sottoscrizione per chatThreadCreated.

function on(event: "chatThreadCreated", listener: (e: ChatThreadCreatedEvent) => void)

Parametri

event

"chatThreadCreated"

The ChatThreadCreatedEvent.

listener

(e: ChatThreadCreatedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("chatThreadDeleted", (e: ChatThreadDeletedEvent) => void)

Sottoscrivere la funzione per chatThreadDeleted.

function on(event: "chatThreadDeleted", listener: (e: ChatThreadDeletedEvent) => void)

Parametri

event

"chatThreadDeleted"

The ChatThreadDeletedEvent.

listener

(e: ChatThreadDeletedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("chatThreadPropertiesUpdated", (e: ChatThreadPropertiesUpdatedEvent) => void)

Sottoscrivere la funzione per chatThreadPropertiesUpdated.

function on(event: "chatThreadPropertiesUpdated", listener: (e: ChatThreadPropertiesUpdatedEvent) => void)

Parametri

event

"chatThreadPropertiesUpdated"

The ChatThreadPropertiesUpdatedEvent.

listener

(e: ChatThreadPropertiesUpdatedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("participantsAdded", (e: ParticipantsAddedEvent) => void)

Sottoscrivere la funzione per i partecipantiAggiungi.

function on(event: "participantsAdded", listener: (e: ParticipantsAddedEvent) => void)

Parametri

event

"participantsAdded"

PartecipantiAddedEvent.

listener

(e: ParticipantsAddedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("participantsRemoved", (e: ParticipantsRemovedEvent) => void)

Sottoscrivere la funzione per i partecipantiRe spostata.

function on(event: "participantsRemoved", listener: (e: ParticipantsRemovedEvent) => void)

Parametri

event

"participantsRemoved"

PartecipantiRemovedEvent.

listener

(e: ParticipantsRemovedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("readReceiptReceived", (e: ReadReceiptReceivedEvent) => void)

Eseguire la sottoscrizione della funzione readReceiptReceived.

function on(event: "readReceiptReceived", listener: (e: ReadReceiptReceivedEvent) => void)

Parametri

event

"readReceiptReceived"

The ReadReceiptReceivedEvent.

listener

(e: ReadReceiptReceivedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("realTimeNotificationConnected", () => void)

Sottoscrivere la funzione per realTimeNotificationConnected.

function on(event: "realTimeNotificationConnected", listener: () => void)

Parametri

event

"realTimeNotificationConnected"

Evento realTimeNotificationConnected

listener

() => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("realTimeNotificationDisconnected", () => void)

Eseguire la sottoscrizione della funzione per realTimeNotificationDisconnected.

function on(event: "realTimeNotificationDisconnected", listener: () => void)

Parametri

event

"realTimeNotificationDisconnected"

Evento realTimeNotificationDisconnected

listener

() => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

on("typingIndicatorReceived", (e: TypingIndicatorReceivedEvent) => void)

Eseguire la sottoscrizione della funzione per digitareIndicatorReceived. Il mittente iniziale riceverà anche questo evento.

function on(event: "typingIndicatorReceived", listener: (e: TypingIndicatorReceivedEvent) => void)

Parametri

event

"typingIndicatorReceived"

The TypingIndicatorReceivedEvent.

listener

(e: TypingIndicatorReceivedEvent) => void

Listener per gestire l'evento.

Ereditato da ChatClient.on

startRealtimeNotifications()

Iniziare a ricevere notifiche in tempo reale. Chiamare questa funzione prima di sottoscrivere qualsiasi evento.

function startRealtimeNotifications(): Promise<void>

Restituisce

Promise<void>

Ereditato da ChatClient.startRealtimeNotifications

stopRealtimeNotifications()

Arrestare la ricezione di notifiche in tempo reale. Questa funzione annulla la sottoscrizione a tutti gli eventi.

function stopRealtimeNotifications(): Promise<void>

Restituisce

Promise<void>

Ereditato da ChatClient.stopRealtimeNotifications