@satek-team-intern/chatbot-widget 0.10.7 → 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.
Files changed (84) hide show
  1. package/README.md +82 -32
  2. package/dist/assets/background_chatlive_setting.webp +0 -0
  3. package/dist/chatbot-widget.es.js +5630 -3892
  4. package/dist/chatbot-widget.umd.js +1 -25
  5. package/dist/index.d.ts +1 -0
  6. package/package.json +6 -7
  7. package/dist/locales/en.json.d.ts +0 -263
  8. package/dist/locales/vi.json.d.ts +0 -264
  9. package/dist/src/assets/Icons.d.ts +0 -48
  10. package/dist/src/assets/createIcon.d.ts +0 -20
  11. package/dist/src/assets/index.d.ts +0 -2
  12. package/dist/src/components/ChatWidget.d.ts +0 -3
  13. package/dist/src/components/ChatWindow.d.ts +0 -32
  14. package/dist/src/components/FloatingButton.d.ts +0 -17
  15. package/dist/src/components/index.d.ts +0 -7
  16. package/dist/src/components/modals/AddChat.d.ts +0 -16
  17. package/dist/src/components/modals/AddGroup.d.ts +0 -7
  18. package/dist/src/components/modals/AddMember.d.ts +0 -7
  19. package/dist/src/components/modals/FileViewer.d.ts +0 -10
  20. package/dist/src/components/modals/ThemeModal.d.ts +0 -8
  21. package/dist/src/components/modals/UpdateGroup.d.ts +0 -10
  22. package/dist/src/components/modals/UserProfileModal.d.ts +0 -10
  23. package/dist/src/components/modals/index.d.ts +0 -5
  24. package/dist/src/components/shared/AvatarFallBack.d.ts +0 -5
  25. package/dist/src/components/shared/ChatAvatar.d.ts +0 -5
  26. package/dist/src/components/shared/MemberAvatarFallBack.d.ts +0 -5
  27. package/dist/src/components/shared/ToastContainer.d.ts +0 -2
  28. package/dist/src/components/shared/index.d.ts +0 -3
  29. package/dist/src/components/sidebar/AppSideBar.d.ts +0 -4
  30. package/dist/src/components/sidebar/ChatInfoPanel.d.ts +0 -11
  31. package/dist/src/components/sidebar/ChatList.d.ts +0 -8
  32. package/dist/src/components/sidebar/ChatSearchBar.d.ts +0 -10
  33. package/dist/src/components/sidebar/SideBarInfoChat.d.ts +0 -11
  34. package/dist/src/components/sidebar/index.d.ts +0 -4
  35. package/dist/src/components/view/ChatHeader.d.ts +0 -14
  36. package/dist/src/components/view/ChatInput.d.ts +0 -4
  37. package/dist/src/components/view/ChatListItem.d.ts +0 -9
  38. package/dist/src/components/view/ContactList.d.ts +0 -6
  39. package/dist/src/components/view/GroupList.d.ts +0 -8
  40. package/dist/src/components/view/ImageFileItem.d.ts +0 -10
  41. package/dist/src/components/view/MessageFiles.d.ts +0 -20
  42. package/dist/src/components/view/MessageItem.d.ts +0 -8
  43. package/dist/src/components/view/MessageList.d.ts +0 -2
  44. package/dist/src/components/view/ThemeSetting.d.ts +0 -3
  45. package/dist/src/components/view/index.d.ts +0 -10
  46. package/dist/src/config/configEnv.d.ts +0 -11
  47. package/dist/src/constants/common.d.ts +0 -13
  48. package/dist/src/constants/file.d.ts +0 -3
  49. package/dist/src/constants/index.d.ts +0 -2
  50. package/dist/src/contexts/FileViewerContext.d.ts +0 -14
  51. package/dist/src/contexts/ToastContext.d.ts +0 -4
  52. package/dist/src/contexts/index.d.ts +0 -3
  53. package/dist/src/contexts/toast-context.d.ts +0 -16
  54. package/dist/src/hooks/index.d.ts +0 -7
  55. package/dist/src/hooks/useChat.d.ts +0 -2
  56. package/dist/src/hooks/useDragDropFiles.d.ts +0 -12
  57. package/dist/src/hooks/useFileViewer.d.ts +0 -2
  58. package/dist/src/hooks/useSetting.d.ts +0 -5
  59. package/dist/src/hooks/useToast.d.ts +0 -1
  60. package/dist/src/hooks/useTranslation.d.ts +0 -5
  61. package/dist/src/hooks/useVoiceRecorder.d.ts +0 -14
  62. package/dist/src/index.d.ts +0 -5
  63. package/dist/src/locales/index.d.ts +0 -3
  64. package/dist/src/services/chat.service.d.ts +0 -43
  65. package/dist/src/services/index.d.ts +0 -2
  66. package/dist/src/services/language.service.d.ts +0 -18
  67. package/dist/src/store/index.d.ts +0 -3
  68. package/dist/src/store/selectors/index.d.ts +0 -1
  69. package/dist/src/store/selectors/setting.d.ts +0 -35
  70. package/dist/src/store/slices/chatSlice.d.ts +0 -25
  71. package/dist/src/store/slices/index.d.ts +0 -2
  72. package/dist/src/store/slices/settingSlice.d.ts +0 -13
  73. package/dist/src/store/store.d.ts +0 -16
  74. package/dist/src/styles/index.d.ts +0 -1
  75. package/dist/src/types/chat.type.d.ts +0 -297
  76. package/dist/src/types/index.d.ts +0 -2
  77. package/dist/src/types/types.d.ts +0 -61
  78. package/dist/src/utils/chat.utils.d.ts +0 -35
  79. package/dist/src/utils/file.utils.d.ts +0 -20
  80. package/dist/src/utils/format.utils.d.ts +0 -7
  81. package/dist/src/utils/formatDateLabel.d.ts +0 -1
  82. package/dist/src/utils/index.d.ts +0 -5
  83. package/dist/src/utils/validate.utils.d.ts +0 -1
  84. 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,7 +0,0 @@
1
- export { ChatWidget } from './ChatWidget';
2
- export { FloatingButton } from './FloatingButton';
3
- export { ChatWindow } from './ChatWindow';
4
- export * from './modals';
5
- export * from './shared';
6
- export * from './sidebar';
7
- export * from './view';
@@ -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,7 +0,0 @@
1
- import { FC } from 'react';
2
- interface AddGroupProps {
3
- onClose: () => void;
4
- isPopup?: boolean;
5
- }
6
- export declare const AddGroup: FC<AddGroupProps>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { FC } from 'react';
2
- interface AddMemberProps {
3
- onClose: () => void;
4
- isPopup?: boolean;
5
- }
6
- export declare const AddMember: FC<AddMemberProps>;
7
- 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,8 +0,0 @@
1
- import { FC } from 'react';
2
- interface ThemeModalProps {
3
- isOpen: boolean;
4
- onClose: () => void;
5
- defaultColor?: string;
6
- }
7
- export declare const ThemeModal: FC<ThemeModalProps>;
8
- 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,5 +0,0 @@
1
- export * from './UpdateGroup';
2
- export * from './AddMember';
3
- export * from './FileViewer';
4
- export * from './AddGroup';
5
- export * from './UserProfileModal';
@@ -1,5 +0,0 @@
1
- import { ChatUser } from '../../../types';
2
- import { FC } from 'react';
3
- export declare const AvatarFallback: FC<{
4
- member: ChatUser;
5
- }>;
@@ -1,5 +0,0 @@
1
- import { ChatConversation } from '../../../types';
2
- export declare const ChatAvatar: import('react').MemoExoticComponent<({ chat, currentUserId, }: {
3
- chat?: ChatConversation | null;
4
- currentUserId?: number;
5
- }) => import("react/jsx-runtime").JSX.Element>;
@@ -1,5 +0,0 @@
1
- import { ChatUser } from '../../../types';
2
- import { FC } from 'react';
3
- export declare const MemberAvatarFallback: FC<{
4
- member: ChatUser;
5
- }>;
@@ -1,2 +0,0 @@
1
- import { FC } from 'react';
2
- export declare const ToastContainer: FC;
@@ -1,3 +0,0 @@
1
- export * from './ChatAvatar';
2
- export * from './ToastContainer';
3
- export * from './AvatarFallBack';
@@ -1,4 +0,0 @@
1
- export declare const AppSideBar: ({ activeTab, setActiveTab, }: {
2
- activeTab: "chats" | "contacts" | "settings";
3
- setActiveTab: (tab: "chats" | "contacts" | "settings") => void;
4
- }) => import("react/jsx-runtime").JSX.Element;
@@ -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,8 +0,0 @@
1
- import { FC } from 'react';
2
- import { ChatConversation } from '../../../types';
3
- interface ChatListProps {
4
- chats: ChatConversation[];
5
- onSelectChat: (chat: ChatConversation) => void;
6
- }
7
- export declare const ChatList: FC<ChatListProps>;
8
- export {};
@@ -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,4 +0,0 @@
1
- export * from './ChatList';
2
- export * from './ChatSearchBar';
3
- export * from './AppSideBar';
4
- export * from './ChatInfoPanel';
@@ -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,4 +0,0 @@
1
- export interface ChatInputHandle {
2
- processPastedFiles: (files: FileList) => void;
3
- }
4
- export declare const ChatInput: import('react').ForwardRefExoticComponent<import('react').RefAttributes<ChatInputHandle>>;
@@ -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,6 +0,0 @@
1
- import { FC } from 'react';
2
- interface ContactListProps {
3
- onMessageClick: (memberId: string) => void;
4
- }
5
- export declare const ContactList: FC<ContactListProps>;
6
- export {};
@@ -1,8 +0,0 @@
1
- import { FC } from 'react';
2
- import { ChatConversation } from '../../../types';
3
- interface GroupListProps {
4
- groups: ChatConversation[];
5
- onGroupClick: (group: ChatConversation) => void;
6
- }
7
- export declare const GroupList: FC<GroupListProps>;
8
- 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,8 +0,0 @@
1
- import { FC } from 'react';
2
- import { ChatMessage, ChatUser } from '../../../types';
3
- interface MessageItemProps {
4
- message: ChatMessage;
5
- onHandleClick: (user: ChatUser) => void;
6
- }
7
- export declare const MessageItem: FC<MessageItemProps>;
8
- export {};
@@ -1,2 +0,0 @@
1
- import { FC } from 'react';
2
- export declare const MessageList: FC<object>;
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
- declare const ThemeSetting: FC;
3
- export default ThemeSetting;
@@ -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,11 +0,0 @@
1
- declare class Environment {
2
- private static instance;
3
- private config;
4
- private constructor();
5
- static getInstance(): Environment;
6
- get chatKey(): string;
7
- private get;
8
- private validate;
9
- }
10
- export declare const env: Environment;
11
- export {};
@@ -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,3 +0,0 @@
1
- export declare const MAX_FILE_SIZE: number;
2
- export declare const MAX_FILES_COUNT = 20;
3
- export declare const VIEWER_SUPPORTED_TYPES: string[];
@@ -1,2 +0,0 @@
1
- export * from './file';
2
- export * from './common';
@@ -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,4 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- export declare const ToastProvider: FC<{
3
- children: ReactNode;
4
- }>;
@@ -1,3 +0,0 @@
1
- export * from './FileViewerContext';
2
- export * from './ToastContext';
3
- export * from './toast-context';
@@ -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,2 +0,0 @@
1
- import { AuthInfo } from '../../types';
2
- export declare const useChat: (chatKey: string, authInfo: AuthInfo, workspace: string) => void;
@@ -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,2 +0,0 @@
1
- import { FileViewerContextType } from '../../contexts';
2
- export declare const useFileViewer: () => FileViewerContextType;
@@ -1,5 +0,0 @@
1
- import { LanguageOption, WidgetFeature } from '../../types';
2
- export declare const useSetting: (config?: {
3
- features?: WidgetFeature;
4
- language?: LanguageOption;
5
- }) => void;
@@ -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];
@@ -1,5 +0,0 @@
1
- import { ChatWidget } from './components';
2
- import { ChatWidgetProps } from './types';
3
- export { ChatWidget };
4
- export type { ChatWidgetProps };
5
- export declare function init(config: ChatWidgetProps): void;
@@ -1,3 +0,0 @@
1
- import { default as en } from './en.json';
2
- import { default as vi } from './vi.json';
3
- export { en, vi };
@@ -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,2 +0,0 @@
1
- export * from './chat.service';
2
- export * from './language.service';
@@ -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,3 +0,0 @@
1
- export * from './store';
2
- export * from './slices';
3
- export * from './selectors';
@@ -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 {};