Ana içeriğe geç

Class: SimpleChatStore

Simple chat store.

Implements

Constructors

constructor

new SimpleChatStore(): SimpleChatStore

Returns

SimpleChatStore

Properties

store

store: Object = {}

Index signature

▪ [key: string]: ChatMessage[]

Defined in

packages/core/src/storage/chatStore/SimpleChatStore.ts:8

Methods

addMessage

addMessage(key, message): void

Add message.

Parameters

NameType
keystring
messageChatMessage

Returns

void

Implementation of

BaseChatStore.addMessage

Defined in

packages/core/src/storage/chatStore/SimpleChatStore.ts:35


deleteLastMessage

deleteLastMessage(key): null | ChatMessage

Delete last message.

Parameters

NameType
keystring

Returns

null | ChatMessage

Implementation of

BaseChatStore.deleteLastMessage

Defined in

packages/core/src/storage/chatStore/SimpleChatStore.ts:75


deleteMessage

deleteMessage(key, idx): null | ChatMessage

Delete message.

Parameters

NameType
keystring
idxnumber

Returns

null | ChatMessage

Implementation of

BaseChatStore.deleteMessage

Defined in

packages/core/src/storage/chatStore/SimpleChatStore.ts:60


deleteMessages

deleteMessages(key): null | ChatMessage[]

Delete messages.

Parameters

NameType
keystring

Returns

null | ChatMessage[]

Implementation of

BaseChatStore.deleteMessages

Defined in

packages/core/src/storage/chatStore/SimpleChatStore.ts:45


getKeys

getKeys(): string[]

Get keys. @returns: keys

Returns

string[]

Implementation of

BaseChatStore.getKeys

Defined in

packages/core/src/storage/chatStore/SimpleChatStore.ts:89


getMessages

getMessages(key): ChatMessage[]

Get messages.

Parameters

NameType
keystring

Returns

ChatMessage[]

Implementation of

BaseChatStore.getMessages

Defined in

packages/core/src/storage/chatStore/SimpleChatStore.ts:25


setMessages

setMessages(key, messages): void

Set messages.

Parameters

NameType
keystring
messagesChatMessage[]

Returns

void

Implementation of

BaseChatStore.setMessages

Defined in

packages/core/src/storage/chatStore/SimpleChatStore.ts:16