@ethora/chat-component
Version:
1. npm create vite@latest 2. select name of project, select type (react/js) 3. cd project-name 4. npm i 5. npm i @ethora/chat-component 6. go to file src/App.tsx and replace it with this code
31 lines (30 loc) • 1.78 kB
TypeScript
import { Element } from 'ltx';
import { IMessage } from '../types/types';
import { default as XmppClient } from './xmppClient';
declare const onRealtimeMessage: (stanza: Element) => Promise<IMessage>;
declare const onReactionMessage: (stanza: Element) => Promise<void>;
declare const onDeleteMessage: (stanza: Element) => Promise<void>;
declare const onEditMessage: (stanza: Element) => Promise<void>;
declare const onReactionHistory: (stanza: any) => Promise<void>;
declare const onMessageHistory: (stanza: any) => Promise<void>;
declare const handleComposing: (stanza: Element, currentUser: string) => Promise<void>;
declare const onPresenceInRoom: (stanza: Element | any) => void;
declare const onChatInvite: (stanza: Element, client: XmppClient) => Promise<void>;
declare const onGetMembers: (stanza: Element) => void;
declare const onGetRoomInfo: (stanza: Element) => void;
declare const onGetLastMessageArchive: (stanza: Element) => void;
declare const onNewRoomCreated: (stanza: Element, xmpp: any) => void;
declare const onGetChatRooms: (stanza: Element, xmpp: any) => void;
declare const onRoomKicked: (stanza: Element) => Promise<void>;
declare const onMessageError: (stanza: Element, client: XmppClient) => Promise<void>;
export type XMPPErrorInfo = {
type: string;
id: string;
from: string;
to: string;
body: string | null;
condition: string;
message: string;
};
export declare const handleErrorMessageStanza: (stanza: Element) => XMPPErrorInfo | null;
export { onRealtimeMessage, onMessageHistory, onPresenceInRoom, onReactionHistory, onGetLastMessageArchive, handleComposing, onGetChatRooms, onNewRoomCreated, onGetMembers, onGetRoomInfo, onDeleteMessage, onEditMessage, onReactionMessage, onChatInvite, onRoomKicked, onMessageError, };