UNPKG

apphouse

Version:

Component library for React that uses observable state management and theme-able components.

53 lines (52 loc) 982 B
import { List } from './List'; export interface ChatMessage { /** * Unique id for the message */ id: string; /** * The user id who sent the message */ userId: string; /** * The contents of the message * @type {string} */ content: string; } /** * A basic user model for the chat */ interface ChatUser { /** * Unique id for the user */ id: string; /** * The name of the user */ name: string; /** * The role of the user */ role: string; } /** * A list of chat messages */ export type ChatHistory = List<ChatMessage>; /** * A basic chat model * @class Chat */ export declare class Chat { users: ChatUser[]; history: ChatHistory; constructor(users: ChatUser[], history?: ChatMessage[]); /** * Add message to the chat history * @param message Partial<ChatMessage> */ addMessage: (message: Partial<ChatMessage>) => void; } export {};