///
export interface StringObject {
[key: string]: string;
}
export interface IInit {
isInit: boolean;
setIsInit: React.Dispatch>;
}
export interface IWebsocket {
instance: WebSocket | null;
setInstance: React.Dispatch>;
}
export interface IMessage {
id: string;
received: string;
author: any;
content: any;
source?: any;
type?: string;
channel: string;
metadata?: any;
deleted?: boolean;
index: number;
}
export interface IParticipant {
userExternalId: string;
type: string;
firstName: string;
lastName: string;
lastReadIndex: number;
}
export interface IConversation {
id: string;
displayName: string;
description: string;
isDefault?: boolean;
businessLastRead?: string;
lastUpdatedAt: string;
metadata?: any;
messages: IMessage[];
unreadCount: number | null;
participants?: IParticipant[];
}
export interface IConversationList {
conversationList: IConversation[];
setConversationList: React.Dispatch>;
}
export interface IInputMessage {
message: string;
setMessage: React.Dispatch>;
}
export interface IConfigObj {
wsURL: string;
userExternalId: string;
token?: string;
hearbeatInterval: number;
source: 'dashboard' | 'salesforce';
userType?: 'owner' | 'renter' | 'vendor';
debounceTimeout?: number;
}
export interface IConfig {
objConfig: IConfigObj | null;
setObjConfig: React.Dispatch>;
}
export interface IError {
type: string;
errors: [];
}
export interface IErrors {
errors: IError[];
setErrors: React.Dispatch>;
}
export interface ISelectConversation {
selectedConversation: string;
setSelectedConversation: React.Dispatch>;
}
export interface IWebsocketMessage {
type: string;
data?: any;
errors?: any;
}
export interface ILoadingObj {
conversations: boolean;
messages: boolean;
faq: boolean;
}
export interface ILoadings {
loading: ILoadingObj;
setLoading: React.Dispatch>;
}
export interface IIntro {
introMessage: string;
setIntroMessage: React.Dispatch>;
}
export interface IAction {
type: string;
text: string;
payload: string;
metadata?: StringObject;
}
export interface IMessageItem {
title: string;
description: string;
actions: IAction[];
mediaUrl?: string;
metadata?: StringObject;
}
export interface IUserObj {
firstName: string;
lastName: string;
}
export interface IUser {
userObj: IUserObj;
setUserObj: React.Dispatch>;
}
export interface IUnread {
hasUnread: boolean;
setHasUnread: React.Dispatch>;
}
export interface ITyping {
isTyping: boolean;
setIsTyping: React.Dispatch>;
}
export interface IForceUpdate {
forceUpdate: boolean;
setForceUpdate: React.Dispatch>;
}
export interface ISendToObj {
[key: string]: boolean;
}
export interface ISendTo {
sendToReceipients: ISendToObj;
setSendToReceipients: React.Dispatch>;
}
export interface IFaq {
faqBody: string;
setFaqBody: React.Dispatch>;
}
export interface IDraft {
conversationId: string;
message: string;
}
export interface IMessageHandlers {
[key: string]: Function;
}
export type StoreContextType = {
config: IConfig;
init: IInit;
websocket: IWebsocket;
selectConversation: ISelectConversation;
conversations: IConversationList;
inputMessage: IInputMessage;
errors: IErrors;
loadings: ILoadings;
intro: IIntro;
name: IUser;
unread: IUnread;
typing: ITyping;
force: IForceUpdate;
sendTo: ISendTo;
faq: IFaq;
};
//# sourceMappingURL=types.d.ts.map