@satek-team-intern/chatbot-widget 0.10.8 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -32
- package/dist/assets/background_chatlive_setting.webp +0 -0
- package/dist/chatbot-widget.es.js +5636 -3926
- package/dist/chatbot-widget.umd.js +1 -25
- package/dist/index.d.ts +1 -0
- package/package.json +6 -7
- package/dist/locales/en.json.d.ts +0 -263
- package/dist/locales/vi.json.d.ts +0 -264
- package/dist/src/assets/Icons.d.ts +0 -48
- package/dist/src/assets/createIcon.d.ts +0 -20
- package/dist/src/assets/index.d.ts +0 -2
- package/dist/src/components/ChatWidget.d.ts +0 -3
- package/dist/src/components/ChatWindow.d.ts +0 -32
- package/dist/src/components/FloatingButton.d.ts +0 -17
- package/dist/src/components/index.d.ts +0 -7
- package/dist/src/components/modals/AddChat.d.ts +0 -16
- package/dist/src/components/modals/AddGroup.d.ts +0 -7
- package/dist/src/components/modals/AddMember.d.ts +0 -7
- package/dist/src/components/modals/FileViewer.d.ts +0 -10
- package/dist/src/components/modals/ThemeModal.d.ts +0 -8
- package/dist/src/components/modals/UpdateGroup.d.ts +0 -10
- package/dist/src/components/modals/UserProfileModal.d.ts +0 -10
- package/dist/src/components/modals/index.d.ts +0 -5
- package/dist/src/components/shared/AvatarFallBack.d.ts +0 -5
- package/dist/src/components/shared/ChatAvatar.d.ts +0 -5
- package/dist/src/components/shared/MemberAvatarFallBack.d.ts +0 -5
- package/dist/src/components/shared/ToastContainer.d.ts +0 -2
- package/dist/src/components/shared/index.d.ts +0 -3
- package/dist/src/components/sidebar/AppSideBar.d.ts +0 -4
- package/dist/src/components/sidebar/ChatInfoPanel.d.ts +0 -11
- package/dist/src/components/sidebar/ChatList.d.ts +0 -8
- package/dist/src/components/sidebar/ChatSearchBar.d.ts +0 -10
- package/dist/src/components/sidebar/SideBarInfoChat.d.ts +0 -11
- package/dist/src/components/sidebar/index.d.ts +0 -4
- package/dist/src/components/view/ChatHeader.d.ts +0 -14
- package/dist/src/components/view/ChatInput.d.ts +0 -4
- package/dist/src/components/view/ChatListItem.d.ts +0 -9
- package/dist/src/components/view/ContactList.d.ts +0 -6
- package/dist/src/components/view/GroupList.d.ts +0 -8
- package/dist/src/components/view/ImageFileItem.d.ts +0 -10
- package/dist/src/components/view/MessageFiles.d.ts +0 -20
- package/dist/src/components/view/MessageItem.d.ts +0 -8
- package/dist/src/components/view/MessageList.d.ts +0 -2
- package/dist/src/components/view/ThemeSetting.d.ts +0 -3
- package/dist/src/components/view/index.d.ts +0 -10
- package/dist/src/config/configEnv.d.ts +0 -11
- package/dist/src/constants/common.d.ts +0 -13
- package/dist/src/constants/file.d.ts +0 -3
- package/dist/src/constants/index.d.ts +0 -2
- package/dist/src/contexts/FileViewerContext.d.ts +0 -14
- package/dist/src/contexts/ToastContext.d.ts +0 -4
- package/dist/src/contexts/index.d.ts +0 -3
- package/dist/src/contexts/toast-context.d.ts +0 -16
- package/dist/src/hooks/index.d.ts +0 -7
- package/dist/src/hooks/useChat.d.ts +0 -2
- package/dist/src/hooks/useDragDropFiles.d.ts +0 -12
- package/dist/src/hooks/useFileViewer.d.ts +0 -2
- package/dist/src/hooks/useSetting.d.ts +0 -5
- package/dist/src/hooks/useToast.d.ts +0 -1
- package/dist/src/hooks/useTranslation.d.ts +0 -5
- package/dist/src/hooks/useVoiceRecorder.d.ts +0 -14
- package/dist/src/index.d.ts +0 -5
- package/dist/src/locales/index.d.ts +0 -3
- package/dist/src/services/chat.service.d.ts +0 -43
- package/dist/src/services/index.d.ts +0 -2
- package/dist/src/services/language.service.d.ts +0 -18
- package/dist/src/store/index.d.ts +0 -3
- package/dist/src/store/selectors/index.d.ts +0 -1
- package/dist/src/store/selectors/setting.d.ts +0 -35
- package/dist/src/store/slices/chatSlice.d.ts +0 -25
- package/dist/src/store/slices/index.d.ts +0 -2
- package/dist/src/store/slices/settingSlice.d.ts +0 -13
- package/dist/src/store/store.d.ts +0 -16
- package/dist/src/styles/index.d.ts +0 -1
- package/dist/src/types/chat.type.d.ts +0 -297
- package/dist/src/types/index.d.ts +0 -2
- package/dist/src/types/types.d.ts +0 -61
- package/dist/src/utils/chat.utils.d.ts +0 -35
- package/dist/src/utils/file.utils.d.ts +0 -20
- package/dist/src/utils/format.utils.d.ts +0 -7
- package/dist/src/utils/formatDateLabel.d.ts +0 -1
- package/dist/src/utils/index.d.ts +0 -5
- package/dist/src/utils/validate.utils.d.ts +0 -1
- package/dist/src/utils/voice.utils.d.ts +0 -1
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChatWidgetProps, WidgetMode } from '../../types';
|
|
3
|
-
interface ChatWindowProps extends ChatWidgetProps {
|
|
4
|
-
mode: WidgetMode;
|
|
5
|
-
setMode: (mode: WidgetMode) => void;
|
|
6
|
-
dragPosition?: {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
} | null;
|
|
10
|
-
setDragPosition?: (pos: {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
} | null) => void;
|
|
14
|
-
fullpagePosition?: {
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
} | null;
|
|
18
|
-
setFullpagePosition?: (pos: {
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
} | null) => void;
|
|
22
|
-
fullpageSize?: {
|
|
23
|
-
width: number;
|
|
24
|
-
height: number;
|
|
25
|
-
};
|
|
26
|
-
setFullpageSize?: (size: {
|
|
27
|
-
width: number;
|
|
28
|
-
height: number;
|
|
29
|
-
}) => void;
|
|
30
|
-
}
|
|
31
|
-
export declare const ChatWindow: FC<ChatWindowProps>;
|
|
32
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { WidgetMode } from '../../types';
|
|
3
|
-
interface FloatingButtonProps {
|
|
4
|
-
mode: WidgetMode;
|
|
5
|
-
setMode: (mode: WidgetMode) => void;
|
|
6
|
-
dragPosition?: {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
} | null;
|
|
10
|
-
setDragPosition?: (pos: {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
} | null) => void;
|
|
14
|
-
primaryColor?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare const FloatingButton: FC<FloatingButtonProps>;
|
|
17
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChatUser } from '../../../types';
|
|
3
|
-
interface AddChatProps {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
members: ChatUser[];
|
|
7
|
-
selectedMembers: string[];
|
|
8
|
-
onToggleMember: (userId: string) => void;
|
|
9
|
-
newGroupName: string;
|
|
10
|
-
onNewGroupNameChange: (name: string) => void;
|
|
11
|
-
modalSearchQuery: string;
|
|
12
|
-
onModalSearchQueryChange: (query: string) => void;
|
|
13
|
-
onCreateChat: () => void;
|
|
14
|
-
}
|
|
15
|
-
export declare const AddChat: FC<AddChatProps>;
|
|
16
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChatFile } from '../../../types';
|
|
3
|
-
interface FileViewerProps {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
files: ChatFile[];
|
|
6
|
-
initialIndex?: number;
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const FileViewer: FC<FileViewerProps>;
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChatConversation } from '../../../types';
|
|
3
|
-
interface UpdateGroupProps {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
group: ChatConversation | null;
|
|
7
|
-
isPopup?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const UpdateGroup: FC<UpdateGroupProps>;
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChatUser } from '../../../types';
|
|
3
|
-
interface UserProfileModalProps {
|
|
4
|
-
user: ChatUser;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
isOnline?: boolean;
|
|
7
|
-
onMessage: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const UserProfileModal: FC<UserProfileModalProps>;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChatConversation } from '../../../types';
|
|
3
|
-
interface SideBarInfoChatProps {
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
onAddMember: () => void;
|
|
6
|
-
onUpdateGroup?: (chat: ChatConversation) => void;
|
|
7
|
-
onRemoveMember?: (chatId: number, memberId: number) => void;
|
|
8
|
-
isPopup?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare const ChatInfoPanel: FC<SideBarInfoChatProps>;
|
|
11
|
-
export { ChatInfoPanel };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
interface ChatSearchBarProps {
|
|
3
|
-
value: string;
|
|
4
|
-
onChange: (value: string) => void;
|
|
5
|
-
onAddClick?: () => void;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
activeTab?: 'chats' | 'contacts';
|
|
8
|
-
}
|
|
9
|
-
export declare const ChatSearchBar: FC<ChatSearchBarProps>;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChatConversation, ChatUser } from '../../../types';
|
|
3
|
-
interface SideBarInfoChatProps {
|
|
4
|
-
currentUser: ChatUser | null;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
onAddMember: () => void;
|
|
7
|
-
onUpdateGroup?: (chat: ChatConversation) => void;
|
|
8
|
-
onRemoveMember?: (chatId: number, memberId: number) => void;
|
|
9
|
-
}
|
|
10
|
-
declare const SideBarInfoChat: FC<SideBarInfoChatProps>;
|
|
11
|
-
export { SideBarInfoChat };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { WidgetMode } from '../../../types';
|
|
3
|
-
interface ChatHeaderProps {
|
|
4
|
-
mode: WidgetMode;
|
|
5
|
-
title?: string;
|
|
6
|
-
logoUrl?: string;
|
|
7
|
-
onBack: () => void;
|
|
8
|
-
onToggleMode: () => void;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
onAddMemberClick?: () => void;
|
|
11
|
-
onOpenSettings?: () => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const ChatHeader: FC<ChatHeaderProps>;
|
|
14
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChatConversation, ChatUser } from '../../../types';
|
|
3
|
-
interface ChatListItemProps {
|
|
4
|
-
chat: ChatConversation;
|
|
5
|
-
onSelectChat: (chat: ChatConversation) => void;
|
|
6
|
-
onAvatarClick: (user: ChatUser, isOnline: boolean) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const ChatListItem: FC<ChatListItemProps>;
|
|
9
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ChatFile } from '../../../types/chat.type';
|
|
2
|
-
interface ImageFileItemProps {
|
|
3
|
-
file: ChatFile;
|
|
4
|
-
displayedImages: ChatFile[];
|
|
5
|
-
hasMoreImages: boolean;
|
|
6
|
-
remainingImagesCount: number;
|
|
7
|
-
handleImageClick: (file: ChatFile) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const ImageFileItem: ({ file, displayedImages, hasMoreImages, remainingImagesCount, handleImageClick, }: ImageFileItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode, MouseEvent, CSSProperties } from 'react';
|
|
2
|
-
import { ChatFile } from '../../../types';
|
|
3
|
-
interface MessageFilesProps {
|
|
4
|
-
files?: ChatFile[];
|
|
5
|
-
}
|
|
6
|
-
interface FileWrapperProps {
|
|
7
|
-
file: ChatFile;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
className?: string;
|
|
10
|
-
isLink?: boolean;
|
|
11
|
-
handleImageClick?: (file: ChatFile) => void;
|
|
12
|
-
style?: CSSProperties;
|
|
13
|
-
}
|
|
14
|
-
export declare const FileWrapper: ({ file, children, className, isLink, handleImageClick, style, }: FileWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare const DefaultFileUI: ({ file, handleDownload, }: {
|
|
16
|
-
file: ChatFile;
|
|
17
|
-
handleDownload: (e: MouseEvent, file: ChatFile) => void;
|
|
18
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const MessageFiles: FC<MessageFilesProps>;
|
|
20
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './ChatHeader';
|
|
2
|
-
export * from './ChatInput';
|
|
3
|
-
export * from './ContactList';
|
|
4
|
-
export * from './GroupList';
|
|
5
|
-
export * from './MessageFiles';
|
|
6
|
-
export * from './MessageItem';
|
|
7
|
-
export * from './MessageList';
|
|
8
|
-
export * from './ChatListItem';
|
|
9
|
-
export * from './ImageFileItem';
|
|
10
|
-
export * from './ThemeSetting';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LanguageOption } from '../../types';
|
|
2
|
-
export declare const COMMON_EMOJIS: string[];
|
|
3
|
-
export declare const COLOR_PRESETS: {
|
|
4
|
-
name: string;
|
|
5
|
-
className: string;
|
|
6
|
-
value: string;
|
|
7
|
-
dotClass: string;
|
|
8
|
-
}[];
|
|
9
|
-
export declare const EXTRACT_URL_REGEX: RegExp;
|
|
10
|
-
export declare const LOCAL_OR_IP_REGEX: RegExp;
|
|
11
|
-
export declare const GENERAL_URL_REGEX: RegExp;
|
|
12
|
-
export declare const MESSAGE_LIMIT = 500;
|
|
13
|
-
export declare const DEFAULT_LANGUAGE: LanguageOption;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { ChatFile } from '../../types';
|
|
3
|
-
export interface FileViewerContextType {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
files: ChatFile[];
|
|
6
|
-
initialIndex: number;
|
|
7
|
-
openViewer: (files: ChatFile[], initialIndex?: number) => void;
|
|
8
|
-
closeViewer: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const FileViewerContext: import('react').Context<FileViewerContextType | undefined>;
|
|
11
|
-
export { FileViewerContext };
|
|
12
|
-
export declare const FileViewerProvider: FC<{
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
}>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type ToastType = 'success' | 'error' | 'info' | 'warning';
|
|
2
|
-
export interface Toast {
|
|
3
|
-
id: string;
|
|
4
|
-
message: string;
|
|
5
|
-
type: ToastType;
|
|
6
|
-
isConfirm?: boolean;
|
|
7
|
-
onConfirm?: () => void;
|
|
8
|
-
onCancel?: () => void;
|
|
9
|
-
}
|
|
10
|
-
export interface ToastContextType {
|
|
11
|
-
showToast: (message: string, type?: ToastType) => void;
|
|
12
|
-
confirm: (message: string) => Promise<boolean>;
|
|
13
|
-
removeToast: (id: string) => void;
|
|
14
|
-
toasts: Toast[];
|
|
15
|
-
}
|
|
16
|
-
export declare const ToastContext: import('react').Context<ToastContextType | undefined>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { useChat } from './useChat';
|
|
2
|
-
export { useFileViewer } from './useFileViewer';
|
|
3
|
-
export { useDragDropFiles } from './useDragDropFiles';
|
|
4
|
-
export { useVoiceRecorder } from './useVoiceRecorder';
|
|
5
|
-
export { useTranslation } from './useTranslation';
|
|
6
|
-
export { useToast } from './useToast';
|
|
7
|
-
export { useSetting } from './useSetting';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DragEvent } from 'react';
|
|
2
|
-
interface DragDropFilesProps {
|
|
3
|
-
onFilesAdded: (files: FileList) => void;
|
|
4
|
-
}
|
|
5
|
-
export declare const useDragDropFiles: ({ onFilesAdded }: DragDropFilesProps) => {
|
|
6
|
-
isDragOver: boolean;
|
|
7
|
-
handleDragEnter: (e: DragEvent<HTMLDivElement>) => void;
|
|
8
|
-
handleDragOver: (e: DragEvent<HTMLDivElement>) => void;
|
|
9
|
-
handleDragLeave: (e: DragEvent<HTMLDivElement>) => void;
|
|
10
|
-
handleDrop: (e: DragEvent<HTMLDivElement>) => void;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useToast: () => import('../../contexts').ToastContextType;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const useTranslation: () => {
|
|
2
|
-
t: (path: import('../../services').NestedKeys<import('../../services').TranslationSchema>, params?: Record<string, string>) => string;
|
|
3
|
-
currentLanguage: import('../types').LanguageOption;
|
|
4
|
-
toggleChangeLanguage: () => void;
|
|
5
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface VoiceRecorderState {
|
|
2
|
-
isRecording: boolean;
|
|
3
|
-
duration: number;
|
|
4
|
-
recordedFile: File | null;
|
|
5
|
-
error: string | null;
|
|
6
|
-
}
|
|
7
|
-
export interface VoiceRecorderHandle {
|
|
8
|
-
startRecording: () => Promise<void>;
|
|
9
|
-
stopRecording: () => Promise<void>;
|
|
10
|
-
cancelRecording: () => void;
|
|
11
|
-
playback: () => void;
|
|
12
|
-
clearRecording: () => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const useVoiceRecorder: () => [VoiceRecorderState, VoiceRecorderHandle];
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { AuthInfo, ChatEventPayloads, ChatResponse, ChatConversation, ChatMessage, ChatConfig, PaginationInfo, MessageAction, ChatUser, ChatSetting } from '../../types';
|
|
2
|
-
declare class ChatService {
|
|
3
|
-
private static instance;
|
|
4
|
-
private chatSDK;
|
|
5
|
-
constructor();
|
|
6
|
-
static getInstance(): ChatService;
|
|
7
|
-
init(chatKey: string, workspace: string): Promise<void>;
|
|
8
|
-
private setupSDK;
|
|
9
|
-
get setting(): ChatSetting;
|
|
10
|
-
setAuth(data: AuthInfo): Promise<ChatUser>;
|
|
11
|
-
getAuth(): ChatUser | null;
|
|
12
|
-
clearAuth(): void;
|
|
13
|
-
setReceiver(data: ChatUser): Promise<ChatResponse<ChatUser>>;
|
|
14
|
-
getReceiver(): ChatUser | null;
|
|
15
|
-
clearReceiver(): void;
|
|
16
|
-
getMembers(chatId?: number | null, limit?: number, page?: number, include?: string): Promise<ChatResponse<ChatUser[]>>;
|
|
17
|
-
addMember(chatId: number, memberId: number): Promise<ChatResponse>;
|
|
18
|
-
removeMember(chatId: number, memberId: number): Promise<ChatResponse>;
|
|
19
|
-
getChats(limit?: number, page?: number): Promise<ChatResponse<ChatConversation[]> & {
|
|
20
|
-
pagination?: PaginationInfo;
|
|
21
|
-
}>;
|
|
22
|
-
findChatByReceiver(receiverId: number): Promise<ChatResponse<ChatConversation>>;
|
|
23
|
-
addChat(receiverId: number, content?: string): Promise<ChatResponse<ChatConversation>>;
|
|
24
|
-
addGroup(memberIds: number[], name: string, avatar?: string | File, userId?: number): Promise<ChatResponse<ChatConversation>>;
|
|
25
|
-
updateGroup(chatId: number, name: string, avatar?: string | File): Promise<ChatResponse<ChatConversation>>;
|
|
26
|
-
removeChat(chatId: number): Promise<ChatResponse>;
|
|
27
|
-
readChat(chatId: number): Promise<ChatResponse>;
|
|
28
|
-
unreadChat(chatId: number): Promise<ChatResponse>;
|
|
29
|
-
getMessages(chatId: number, limit?: number, page?: number): Promise<ChatResponse<ChatMessage[]> & {
|
|
30
|
-
pagination?: PaginationInfo;
|
|
31
|
-
}>;
|
|
32
|
-
addMessage(chatId: number, content?: string | null, files?: FileList | File[] | null, replyId?: number | null): Promise<ChatResponse<ChatMessage>>;
|
|
33
|
-
actionMessage(chatId: number, messageId: number, action: MessageAction): Promise<{
|
|
34
|
-
message_id: number;
|
|
35
|
-
member_id: number;
|
|
36
|
-
}>;
|
|
37
|
-
addEventListener<K extends keyof ChatEventPayloads>(event: K, listener: (data: K extends keyof ChatEventPayloads ? ChatEventPayloads[K] : unknown) => void): void;
|
|
38
|
-
removeEventListener<K extends keyof ChatEventPayloads>(event: K, listener?: (data: ChatEventPayloads[K]) => void): void;
|
|
39
|
-
runEvent<K extends keyof ChatEventPayloads>(name: K | string, data?: ChatEventPayloads[K]): void;
|
|
40
|
-
setConfig(config: ChatConfig): void;
|
|
41
|
-
}
|
|
42
|
-
export declare const chatService: ChatService;
|
|
43
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { en } from '../../locales';
|
|
2
|
-
import { LanguageOption } from '../../types';
|
|
3
|
-
export type TranslationSchema = typeof en;
|
|
4
|
-
export type NestedKeys<T> = T extends object ? {
|
|
5
|
-
[K in keyof T]: `${Exclude<K, symbol>}${'' | `.${NestedKeys<T[K]>}`}`;
|
|
6
|
-
}[keyof T] : '';
|
|
7
|
-
declare class TranslationManager {
|
|
8
|
-
private static instance;
|
|
9
|
-
private translations;
|
|
10
|
-
private currentLocale;
|
|
11
|
-
private constructor();
|
|
12
|
-
static getInstance(): TranslationManager;
|
|
13
|
-
get locale(): LanguageOption;
|
|
14
|
-
set locale(lang: LanguageOption);
|
|
15
|
-
t(path: NestedKeys<TranslationSchema>, params?: Record<string, string>): string;
|
|
16
|
-
}
|
|
17
|
-
export declare const lang: TranslationManager;
|
|
18
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './setting';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { RootState } from '../../../store';
|
|
2
|
-
import { FeatureAnalysis } from '../../../utils';
|
|
3
|
-
import { WidgetFeature } from '../../../types';
|
|
4
|
-
interface WidgetSettings extends FeatureAnalysis {
|
|
5
|
-
acceptFilter: string;
|
|
6
|
-
isFileTypeAllowed: (file: File) => boolean;
|
|
7
|
-
allowDeleteChat: boolean;
|
|
8
|
-
allowDeleteMessage: (messageCreatedTime: string) => boolean;
|
|
9
|
-
allowRevokeMessage: (messageCreatedTime: string) => boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const selectWidgetFeatures: ((state: {
|
|
12
|
-
chat: import('../../../store').ChatState;
|
|
13
|
-
setting: import('../../../store').SettingState;
|
|
14
|
-
}) => WidgetSettings) & {
|
|
15
|
-
clearCache: () => void;
|
|
16
|
-
resultsCount: () => number;
|
|
17
|
-
resetResultsCount: () => void;
|
|
18
|
-
} & {
|
|
19
|
-
resultFunc: (resultFuncArgs_0: WidgetFeature, resultFuncArgs_1: boolean) => WidgetSettings;
|
|
20
|
-
memoizedResultFunc: ((resultFuncArgs_0: WidgetFeature, resultFuncArgs_1: boolean) => WidgetSettings) & {
|
|
21
|
-
clearCache: () => void;
|
|
22
|
-
resultsCount: () => number;
|
|
23
|
-
resetResultsCount: () => void;
|
|
24
|
-
};
|
|
25
|
-
lastResult: () => WidgetSettings;
|
|
26
|
-
dependencies: [(state: RootState) => WidgetFeature, (state: RootState) => boolean];
|
|
27
|
-
recomputations: () => number;
|
|
28
|
-
resetRecomputations: () => void;
|
|
29
|
-
dependencyRecomputations: () => number;
|
|
30
|
-
resetDependencyRecomputations: () => void;
|
|
31
|
-
} & {
|
|
32
|
-
memoize: typeof import('reselect').weakMapMemoize;
|
|
33
|
-
argsMemoize: typeof import('reselect').weakMapMemoize;
|
|
34
|
-
};
|
|
35
|
-
export {};
|