chat 1.0.8 → 4.0.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/dist/chunk-ACQNDPTB.js +356 -0
- package/dist/chunk-ACQNDPTB.js.map +1 -0
- package/dist/index.d.ts +1312 -0
- package/dist/index.js +1433 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-runtime-D7zHSnXe.d.ts +349 -0
- package/dist/jsx-runtime.d.ts +1 -0
- package/dist/jsx-runtime.js +17 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/package.json +61 -97
- package/lib/module/ChatContext/index.js +0 -2
- package/lib/module/ChatContext/index.js.map +0 -1
- package/lib/module/ChatContext/types.js +0 -2
- package/lib/module/ChatContext/types.js.map +0 -1
- package/lib/module/classes/Chat/index.js +0 -2
- package/lib/module/classes/Chat/index.js.map +0 -1
- package/lib/module/classes/Chat/types.js +0 -2
- package/lib/module/classes/Chat/types.js.map +0 -1
- package/lib/module/classes/Inbox/index.js +0 -2
- package/lib/module/classes/Inbox/index.js.map +0 -1
- package/lib/module/classes/Inbox/types.js +0 -2
- package/lib/module/classes/Inbox/types.js.map +0 -1
- package/lib/module/classes/Message/index.js +0 -2
- package/lib/module/classes/Message/index.js.map +0 -1
- package/lib/module/classes/Message/types.js +0 -2
- package/lib/module/classes/Message/types.js.map +0 -1
- package/lib/module/classes/Reaction/index.js +0 -2
- package/lib/module/classes/Reaction/index.js.map +0 -1
- package/lib/module/classes/Reaction/types.js +0 -2
- package/lib/module/classes/Reaction/types.js.map +0 -1
- package/lib/module/classes/Room/index.js +0 -2
- package/lib/module/classes/Room/index.js.map +0 -1
- package/lib/module/classes/Room/types.js +0 -2
- package/lib/module/classes/Room/types.js.map +0 -1
- package/lib/module/classes/index.js +0 -2
- package/lib/module/classes/index.js.map +0 -1
- package/lib/module/components/Avatar/index.js +0 -2
- package/lib/module/components/Avatar/index.js.map +0 -1
- package/lib/module/components/Chat/Bubble/index.js +0 -2
- package/lib/module/components/Chat/Bubble/index.js.map +0 -1
- package/lib/module/components/Chat/Composer/Input/index.js +0 -2
- package/lib/module/components/Chat/Composer/Input/index.js.map +0 -1
- package/lib/module/components/Chat/Composer/Send/index.js +0 -2
- package/lib/module/components/Chat/Composer/Send/index.js.map +0 -1
- package/lib/module/components/Chat/Composer/index.js +0 -2
- package/lib/module/components/Chat/Composer/index.js.map +0 -1
- package/lib/module/components/Chat/Media/Image/index.js +0 -2
- package/lib/module/components/Chat/Media/Image/index.js.map +0 -1
- package/lib/module/components/Chat/Media/index.js +0 -2
- package/lib/module/components/Chat/Media/index.js.map +0 -1
- package/lib/module/components/Chat/Message/Swiper/Action/index.js +0 -2
- package/lib/module/components/Chat/Message/Swiper/Action/index.js.map +0 -1
- package/lib/module/components/Chat/Message/Swiper/index.js +0 -2
- package/lib/module/components/Chat/Message/Swiper/index.js.map +0 -1
- package/lib/module/components/Chat/Message/Touchable/index.js +0 -2
- package/lib/module/components/Chat/Message/Touchable/index.js.map +0 -1
- package/lib/module/components/Chat/Message/index.js +0 -2
- package/lib/module/components/Chat/Message/index.js.map +0 -1
- package/lib/module/components/Chat/SystemMessage/index.js +0 -2
- package/lib/module/components/Chat/SystemMessage/index.js.map +0 -1
- package/lib/module/components/Chat/TypingFooter/index.js +0 -2
- package/lib/module/components/Chat/TypingFooter/index.js.map +0 -1
- package/lib/module/components/Chat/index.js +0 -2
- package/lib/module/components/Chat/index.js.map +0 -1
- package/lib/module/components/Chat/types.js +0 -2
- package/lib/module/components/Chat/types.js.map +0 -1
- package/lib/module/components/Chat-Old/Bubble/index.js +0 -2
- package/lib/module/components/Chat-Old/Bubble/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Composer/Input/index.js +0 -2
- package/lib/module/components/Chat-Old/Composer/Input/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Composer/Send/index.js +0 -2
- package/lib/module/components/Chat-Old/Composer/Send/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Composer/index.js +0 -2
- package/lib/module/components/Chat-Old/Composer/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Message/index.js +0 -2
- package/lib/module/components/Chat-Old/Message/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Swiper/Action/index.js +0 -2
- package/lib/module/components/Chat-Old/Swiper/Action/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Swiper/index.js +0 -2
- package/lib/module/components/Chat-Old/Swiper/index.js.map +0 -1
- package/lib/module/components/Chat-Old/SystemMessage/index.js +0 -2
- package/lib/module/components/Chat-Old/SystemMessage/index.js.map +0 -1
- package/lib/module/components/Chat-Old/index.js +0 -2
- package/lib/module/components/Chat-Old/index.js.map +0 -1
- package/lib/module/components/Chat-Old/types.js +0 -2
- package/lib/module/components/Chat-Old/types.js.map +0 -1
- package/lib/module/components/ChatProvider/index.js +0 -2
- package/lib/module/components/ChatProvider/index.js.map +0 -1
- package/lib/module/components/ChatProvider/types.js +0 -2
- package/lib/module/components/ChatProvider/types.js.map +0 -1
- package/lib/module/components/Inbox/Item/Circle/index.js +0 -2
- package/lib/module/components/Inbox/Item/Circle/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/Circle/types.js +0 -2
- package/lib/module/components/Inbox/Item/Circle/types.js.map +0 -1
- package/lib/module/components/Inbox/Item/Initials/index.js +0 -2
- package/lib/module/components/Inbox/Item/Initials/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/ItemDate/index.js +0 -2
- package/lib/module/components/Inbox/Item/ItemDate/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/Separator/index.js +0 -2
- package/lib/module/components/Inbox/Item/Separator/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/Subtitle/index.js +0 -2
- package/lib/module/components/Inbox/Item/Subtitle/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/Swipeable/index.js +0 -2
- package/lib/module/components/Inbox/Item/Swipeable/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/Title/index.js +0 -2
- package/lib/module/components/Inbox/Item/Title/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/UnreadIndicator/index.js +0 -2
- package/lib/module/components/Inbox/Item/UnreadIndicator/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/index.js +0 -2
- package/lib/module/components/Inbox/Item/index.js.map +0 -1
- package/lib/module/components/Inbox/index.js +0 -2
- package/lib/module/components/Inbox/index.js.map +0 -1
- package/lib/module/components/Inbox/question.md +0 -21
- package/lib/module/components/Inbox/readme.md +0 -21
- package/lib/module/components/Inbox/types.js +0 -2
- package/lib/module/components/Inbox/types.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/Footer/Button/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/Footer/Button/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/Footer/Input/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/Footer/Input/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/Footer/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/Footer/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/Item/Icon/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/Item/Icon/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/Item/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/Item/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Header/index.js +0 -2
- package/lib/module/components/RoomCreator/Header/index.js.map +0 -1
- package/lib/module/components/RoomCreator/index.js +0 -2
- package/lib/module/components/RoomCreator/index.js.map +0 -1
- package/lib/module/components/RoomCreator/types.js +0 -2
- package/lib/module/components/RoomCreator/types.js.map +0 -1
- package/lib/module/components/TypingIndicator/index.js +0 -2
- package/lib/module/components/TypingIndicator/index.js.map +0 -1
- package/lib/module/components/index.js +0 -2
- package/lib/module/components/index.js.map +0 -1
- package/lib/module/helpers/getInitials.js +0 -2
- package/lib/module/helpers/getInitials.js.map +0 -1
- package/lib/module/helpers/sortByAvatar.js +0 -2
- package/lib/module/helpers/sortByAvatar.js.map +0 -1
- package/lib/module/hooks/index.js +0 -2
- package/lib/module/hooks/index.js.map +0 -1
- package/lib/module/hooks/useCreateRoom/index.js +0 -2
- package/lib/module/hooks/useCreateRoom/index.js.map +0 -1
- package/lib/module/hooks/useCreator/index.js +0 -2
- package/lib/module/hooks/useCreator/index.js.map +0 -1
- package/lib/module/hooks/useInbox/index.js +0 -2
- package/lib/module/hooks/useInbox/index.js.map +0 -1
- package/lib/module/hooks/useInbox/types.js +0 -2
- package/lib/module/hooks/useInbox/types.js.map +0 -1
- package/lib/module/hooks/useMessages/index.js +0 -2
- package/lib/module/hooks/useMessages/index.js.map +0 -1
- package/lib/module/hooks/useMessages/types.js +0 -2
- package/lib/module/hooks/useMessages/types.js.map +0 -1
- package/lib/module/hooks/useRoom/index.js +0 -2
- package/lib/module/hooks/useRoom/index.js.map +0 -1
- package/lib/module/hooks/useRoom/types.js +0 -2
- package/lib/module/hooks/useRoom/types.js.map +0 -1
- package/lib/module/hooks/useSend/useSendToGroup/index.js +0 -2
- package/lib/module/hooks/useSend/useSendToGroup/index.js.map +0 -1
- package/lib/module/hooks/useSend/useSendToPeople/index.js +0 -2
- package/lib/module/hooks/useSend/useSendToPeople/index.js.map +0 -1
- package/lib/module/hooks/useTyping/index.js +0 -2
- package/lib/module/hooks/useTyping/index.js.map +0 -1
- package/lib/module/hooks/useTypingOLD/index.js +0 -2
- package/lib/module/hooks/useTypingOLD/index.js.map +0 -1
- package/lib/module/hooks/useTypingOLD/types.js +0 -2
- package/lib/module/hooks/useTypingOLD/types.js.map +0 -1
- package/lib/module/hooks/useViewMessages/index.js +0 -2
- package/lib/module/hooks/useViewMessages/index.js.map +0 -1
- package/lib/module/hooks/useViewMessages/types.js +0 -2
- package/lib/module/hooks/useViewMessages/types.js.map +0 -1
- package/lib/module/hooks/useViewMessagesOld/index.js +0 -2
- package/lib/module/hooks/useViewMessagesOld/index.js.map +0 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +0 -1
- package/lib/typescript/ChatContext/index.d.ts +0 -2
- package/lib/typescript/ChatContext/types.d.ts +0 -4
- package/lib/typescript/classes/Chat/index.d.ts +0 -14
- package/lib/typescript/classes/Chat/types.d.ts +0 -21
- package/lib/typescript/classes/Inbox/types.d.ts +0 -2
- package/lib/typescript/classes/Message/index.d.ts +0 -47
- package/lib/typescript/classes/Message/types.d.ts +0 -66
- package/lib/typescript/classes/Reaction/index.d.ts +0 -17
- package/lib/typescript/classes/Reaction/types.d.ts +0 -33
- package/lib/typescript/classes/Room/index.d.ts +0 -42
- package/lib/typescript/classes/Room/types.d.ts +0 -112
- package/lib/typescript/classes/index.d.ts +0 -4
- package/lib/typescript/components/Avatar/index.d.ts +0 -4
- package/lib/typescript/components/Chat/Bubble/index.d.ts +0 -4
- package/lib/typescript/components/Chat/Composer/Input/index.d.ts +0 -7
- package/lib/typescript/components/Chat/Composer/Send/index.d.ts +0 -4
- package/lib/typescript/components/Chat/Composer/index.d.ts +0 -8
- package/lib/typescript/components/Chat/Media/Image/index.d.ts +0 -7
- package/lib/typescript/components/Chat/Media/index.d.ts +0 -4
- package/lib/typescript/components/Chat/Message/Touchable/index.d.ts +0 -4
- package/lib/typescript/components/Chat/Message/index.d.ts +0 -8
- package/lib/typescript/components/Chat/SystemMessage/index.d.ts +0 -4
- package/lib/typescript/components/Chat/TypingFooter/index.d.ts +0 -4
- package/lib/typescript/components/Chat/index.d.ts +0 -8
- package/lib/typescript/components/Chat/types.d.ts +0 -843
- package/lib/typescript/components/ChatProvider/index.d.ts +0 -10
- package/lib/typescript/components/ChatProvider/types.d.ts +0 -7
- package/lib/typescript/components/Inbox/Item/Initials/index.d.ts +0 -4
- package/lib/typescript/components/Inbox/Item/ItemDate/index.d.ts +0 -4
- package/lib/typescript/components/Inbox/Item/Separator/index.d.ts +0 -6
- package/lib/typescript/components/Inbox/Item/Subtitle/index.d.ts +0 -3
- package/lib/typescript/components/Inbox/Item/Swipeable/index.d.ts +0 -4
- package/lib/typescript/components/Inbox/Item/Title/index.d.ts +0 -3
- package/lib/typescript/components/Inbox/Item/UnreadIndicator/index.d.ts +0 -4
- package/lib/typescript/components/Inbox/Item/index.d.ts +0 -6
- package/lib/typescript/components/Inbox/index.d.ts +0 -4
- package/lib/typescript/components/Inbox/types.d.ts +0 -304
- package/lib/typescript/components/RoomCreator/Content/Footer/Button/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/Content/Footer/Input/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/Content/Footer/index.d.ts +0 -3
- package/lib/typescript/components/RoomCreator/Content/Item/Icon/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/Content/Item/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/Content/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/Header/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/types.d.ts +0 -208
- package/lib/typescript/components/TypingIndicator/index.d.ts +0 -9
- package/lib/typescript/components/index.d.ts +0 -12
- package/lib/typescript/helpers/getInitials.d.ts +0 -1
- package/lib/typescript/hooks/index.d.ts +0 -8
- package/lib/typescript/hooks/useCreator/index.d.ts +0 -27
- package/lib/typescript/hooks/useInbox/index.d.ts +0 -29
- package/lib/typescript/hooks/useInbox/types.d.ts +0 -5
- package/lib/typescript/hooks/useMessages/index.d.ts +0 -24
- package/lib/typescript/hooks/useMessages/types.d.ts +0 -5
- package/lib/typescript/hooks/useRoom/index.d.ts +0 -26
- package/lib/typescript/hooks/useRoom/types.d.ts +0 -5
- package/lib/typescript/hooks/useSend/useSendToGroup/index.d.ts +0 -6
- package/lib/typescript/hooks/useSend/useSendToPeople/index.d.ts +0 -6
- package/lib/typescript/hooks/useTyping/index.d.ts +0 -36
- package/lib/typescript/hooks/useViewMessages/index.d.ts +0 -18
- package/lib/typescript/hooks/useViewMessages/types.d.ts +0 -20
- package/lib/typescript/index.d.ts +0 -11
- package/readme.md +0 -201
- package/src/ChatContext/index.tsx +0 -9
- package/src/ChatContext/types.ts +0 -4
- package/src/classes/Chat/index.ts +0 -46
- package/src/classes/Chat/types.ts +0 -23
- package/src/classes/Inbox/index.ts +0 -12
- package/src/classes/Inbox/types.ts +0 -3
- package/src/classes/Message/index.ts +0 -310
- package/src/classes/Message/types.ts +0 -118
- package/src/classes/Reaction/index.ts +0 -108
- package/src/classes/Reaction/types.ts +0 -37
- package/src/classes/Room/index.ts +0 -323
- package/src/classes/Room/types.ts +0 -161
- package/src/classes/index.ts +0 -4
- package/src/components/Avatar/index.tsx +0 -25
- package/src/components/Chat/Bubble/index.tsx +0 -139
- package/src/components/Chat/Composer/Input/index.tsx +0 -45
- package/src/components/Chat/Composer/Send/index.tsx +0 -51
- package/src/components/Chat/Composer/index.tsx +0 -187
- package/src/components/Chat/Media/Image/index.tsx +0 -26
- package/src/components/Chat/Media/index.tsx +0 -11
- package/src/components/Chat/Message/Swiper/Action/index.tsx +0 -7
- package/src/components/Chat/Message/Swiper/index.tsx +0 -32
- package/src/components/Chat/Message/Touchable/index.tsx +0 -60
- package/src/components/Chat/Message/index.tsx +0 -328
- package/src/components/Chat/SystemMessage/index.tsx +0 -44
- package/src/components/Chat/TypingFooter/index.tsx +0 -48
- package/src/components/Chat/index.tsx +0 -596
- package/src/components/Chat/types.ts +0 -913
- package/src/components/Chat-Old/Bubble/index.tsx +0 -58
- package/src/components/Chat-Old/Composer/Input/index.tsx +0 -34
- package/src/components/Chat-Old/Composer/Send/index.tsx +0 -37
- package/src/components/Chat-Old/Composer/index.tsx +0 -131
- package/src/components/Chat-Old/Message/index.tsx +0 -160
- package/src/components/Chat-Old/Swiper/Action/index.tsx +0 -7
- package/src/components/Chat-Old/Swiper/index.tsx +0 -30
- package/src/components/Chat-Old/SystemMessage/index.tsx +0 -44
- package/src/components/Chat-Old/index.tsx +0 -356
- package/src/components/Chat-Old/types.ts +0 -752
- package/src/components/ChatProvider/index.tsx +0 -31
- package/src/components/ChatProvider/types.ts +0 -8
- package/src/components/Inbox/Item/Circle/index.tsx +0 -47
- package/src/components/Inbox/Item/Circle/types.ts +0 -8
- package/src/components/Inbox/Item/Initials/index.tsx +0 -41
- package/src/components/Inbox/Item/ItemDate/index.tsx +0 -26
- package/src/components/Inbox/Item/Separator/index.tsx +0 -13
- package/src/components/Inbox/Item/Subtitle/index.tsx +0 -23
- package/src/components/Inbox/Item/Swipeable/index.tsx +0 -143
- package/src/components/Inbox/Item/Title/index.tsx +0 -23
- package/src/components/Inbox/Item/UnreadIndicator/index.tsx +0 -84
- package/src/components/Inbox/Item/index.tsx +0 -307
- package/src/components/Inbox/index.tsx +0 -315
- package/src/components/Inbox/question.md +0 -21
- package/src/components/Inbox/readme.md +0 -21
- package/src/components/Inbox/types.ts +0 -371
- package/src/components/RoomCreator/Content/Footer/Button/index.tsx +0 -55
- package/src/components/RoomCreator/Content/Footer/Input/index.tsx +0 -27
- package/src/components/RoomCreator/Content/Footer/index.tsx +0 -72
- package/src/components/RoomCreator/Content/Item/Icon/index.tsx +0 -16
- package/src/components/RoomCreator/Content/Item/index.tsx +0 -87
- package/src/components/RoomCreator/Content/index.tsx +0 -75
- package/src/components/RoomCreator/Header/index.tsx +0 -74
- package/src/components/RoomCreator/index.tsx +0 -177
- package/src/components/RoomCreator/types.ts +0 -233
- package/src/components/TypingIndicator/index.tsx +0 -169
- package/src/components/index.ts +0 -18
- package/src/helpers/getInitials.ts +0 -11
- package/src/helpers/sortByAvatar.ts +0 -1
- package/src/hooks/index.ts +0 -8
- package/src/hooks/useCreateRoom/index.ts +0 -34
- package/src/hooks/useCreator/index.ts +0 -33
- package/src/hooks/useInbox/index.ts +0 -76
- package/src/hooks/useInbox/types.ts +0 -6
- package/src/hooks/useMessages/index.ts +0 -109
- package/src/hooks/useMessages/types.ts +0 -6
- package/src/hooks/useRoom/index.ts +0 -82
- package/src/hooks/useRoom/types.ts +0 -6
- package/src/hooks/useSend/useSendToGroup/index.ts +0 -38
- package/src/hooks/useSend/useSendToPeople/index.ts +0 -38
- package/src/hooks/useTyping/index.ts +0 -154
- package/src/hooks/useTypingOLD/index.ts +0 -67
- package/src/hooks/useTypingOLD/types.ts +0 -7
- package/src/hooks/useViewMessages/index.ts +0 -61
- package/src/hooks/useViewMessages/types.ts +0 -22
- package/src/hooks/useViewMessagesOld/index.ts +0 -39
- package/src/index.ts +0 -13
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { default as useMessages } from './useMessages';
|
|
2
|
-
export { default as useRoom } from './useRoom';
|
|
3
|
-
export { default as useTyping } from './useTyping';
|
|
4
|
-
export { default as useInbox } from './useInbox';
|
|
5
|
-
export { default as useCreator } from './useCreator';
|
|
6
|
-
export { default as useViewMessages } from './useViewMessages';
|
|
7
|
-
export { default as useSendToPeople } from './useSend/useSendToPeople';
|
|
8
|
-
export { default as useSendToGroup } from './useSend/useSendToGroup';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
import { RoomCreatorRef } from '../../components/RoomCreator/types';
|
|
3
|
-
declare const _default: () => [MutableRefObject<RoomCreatorRef | undefined>, {
|
|
4
|
-
open: () => void;
|
|
5
|
-
close: () => void;
|
|
6
|
-
}];
|
|
7
|
-
/**
|
|
8
|
-
* React hook for managing RoomCreator component in usechat
|
|
9
|
-
*
|
|
10
|
-
* @returns An array with a ref and then convenience functions for the creator
|
|
11
|
-
* [ref, { open, close }]
|
|
12
|
-
*
|
|
13
|
-
* **Required** In order for the methods to work, you must pass creator to sheetRef prop.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```javascript
|
|
17
|
-
* export default () => {
|
|
18
|
-
* const [creator, { open, close }]
|
|
19
|
-
*
|
|
20
|
-
* // ...some other method
|
|
21
|
-
* const onPress = () => open()
|
|
22
|
-
*
|
|
23
|
-
* return <RoomCreator sheetRef={creator} />
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export default _default;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { QueryDataHandler } from '@nandorojo/fuego/lib/typescript/hooks/useFuego/types';
|
|
2
|
-
import { ExistingRoomDocument } from '../../classes/Room/types';
|
|
3
|
-
import { InboxModel } from '../../classes/Inbox/types';
|
|
4
|
-
import { UseInboxConfig } from './types';
|
|
5
|
-
declare const _default: (config?: UseInboxConfig, options?: QueryDataHandler<ExistingRoomDocument>) => {
|
|
6
|
-
path: string;
|
|
7
|
-
loading: boolean;
|
|
8
|
-
error: import("@nandorojo/fuego/lib/typescript/hooks/useFuego/types").QueryError;
|
|
9
|
-
db: import("firebase").firestore.Firestore;
|
|
10
|
-
ref: import("@nandorojo/fuego").FirestoreRefType;
|
|
11
|
-
unsubscribe: (name: string) => void;
|
|
12
|
-
exists: boolean | null;
|
|
13
|
-
refetch: () => void;
|
|
14
|
-
data: InboxModel;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* React hook to query the chat inbox in realtime. Used with the [Juice.Inbox] component from Juice.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```
|
|
21
|
-
* const { data } = useInbox()
|
|
22
|
-
*
|
|
23
|
-
* return <Juice.Inbox rooms={data} />
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @returns
|
|
27
|
-
* { data, loading, path, error } and other values returned by useFuego() hook. Data is properly formatted for rendering.
|
|
28
|
-
*/
|
|
29
|
-
export default _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { UseMessagesConfig } from './types';
|
|
2
|
-
import { NewMessageModel, EditMessageModel, MessageModelDocument } from '../../classes/Message/types';
|
|
3
|
-
import { QueryDataHandler } from '@nandorojo/fuego/lib/typescript/hooks/useFuego/types';
|
|
4
|
-
declare const _default: ({ id, ...config }: UseMessagesConfig, options?: QueryDataHandler<MessageModelDocument>) => {
|
|
5
|
-
data: NewMessageModel[];
|
|
6
|
-
loading: boolean;
|
|
7
|
-
error: import("@nandorojo/fuego/lib/typescript/hooks/useFuego/types").QueryError;
|
|
8
|
-
ref: import("@nandorojo/fuego").FirestoreRefType;
|
|
9
|
-
path: string;
|
|
10
|
-
empty: boolean;
|
|
11
|
-
send: (message: NewMessageModel[]) => void;
|
|
12
|
-
edit: (message: EditMessageModel) => Promise<void>;
|
|
13
|
-
fetchMore: () => void;
|
|
14
|
-
fetchingMore: number | false;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* React hook to set up a lisener for a room's messages
|
|
18
|
-
*
|
|
19
|
-
* @param { id } the roomId, along with other query options from `useFuego` hook
|
|
20
|
-
*
|
|
21
|
-
* @returns { data: formattedMessages, loading, error, ref, path, empty, send, edit, fetchMore }
|
|
22
|
-
* data is formatted for rendering.
|
|
23
|
-
*/
|
|
24
|
-
export default _default;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { EditRoomModel, CreateCallableRoomModel, ExistingRoomDocument, ExistingRoomModel } from '../../classes/Room/types';
|
|
2
|
-
import { UseRoomType } from './types';
|
|
3
|
-
import { QueryDataHandler } from '@nandorojo/fuego/lib/typescript/hooks/useFuego/types';
|
|
4
|
-
declare const _default: ({ id, ...config }: UseRoomType, options?: QueryDataHandler<ExistingRoomDocument>) => {
|
|
5
|
-
data: ExistingRoomModel | null;
|
|
6
|
-
loading: boolean;
|
|
7
|
-
error: import("@nandorojo/fuego/lib/typescript/hooks/useFuego/types").QueryError;
|
|
8
|
-
ref: import("@nandorojo/fuego").FirestoreRefType;
|
|
9
|
-
create: (room: CreateCallableRoomModel) => Promise<import("firebase").functions.HttpsCallableResult>;
|
|
10
|
-
edit: (room: EditRoomModel) => Promise<void> | null;
|
|
11
|
-
usersAreTyping: boolean;
|
|
12
|
-
namesOfUsersTyping: string[];
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Fetches or subscribes to a chatroom. It automatically handles unmounts, etc.
|
|
16
|
-
*
|
|
17
|
-
* @param config - config dictionary.
|
|
18
|
-
* @param config.id - Required: the unique ID for this chatroom, typically generated by the backend. If using the [[useInbox]] hook, each item in [[useInbox]]'s data array has this ID.
|
|
19
|
-
* @param config.listen Boolean to determine if this room should update state as a subscription. Default false.
|
|
20
|
-
* @param options - added options dictionary for useRoom
|
|
21
|
-
*
|
|
22
|
-
* @remarks Look at the fuego library's useFuego hook to see all the available arguments for config and options.
|
|
23
|
-
*
|
|
24
|
-
* @returns { data: room, loading, error, ref, create, edit, usersAreTyping, namesOfUsersTyping } data is formatted for rendering room.
|
|
25
|
-
*/
|
|
26
|
-
export default _default;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
declare const _default: ({ roomId, text, delay }: {
|
|
2
|
-
roomId: string;
|
|
3
|
-
text: string;
|
|
4
|
-
delay?: number | null | undefined;
|
|
5
|
-
}) => void;
|
|
6
|
-
/**
|
|
7
|
-
* useTyping automatically updates the backend whenever a user is typing.
|
|
8
|
-
*
|
|
9
|
-
* @param options - A dictionary to configure the typing.
|
|
10
|
-
* @param options.roomId - **Required** unique id of the room you're typing in.
|
|
11
|
-
* @param options.text - **Required** The current text state of your chat input
|
|
12
|
-
* @param options.delay (Optional) Set the timeout delay to mark typing false. Set null if you don't want a time out.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```javascript
|
|
16
|
-
* // input text state
|
|
17
|
-
* const [text, setText] = useState('')
|
|
18
|
-
* // let's say we're getting our room id from our react-navigation params
|
|
19
|
-
* const navigation = useNavigation()
|
|
20
|
-
* const roomId = navigation.params.id
|
|
21
|
-
*
|
|
22
|
-
* useTyping({ roomId, text })
|
|
23
|
-
*
|
|
24
|
-
* <ChatComponent text={text} onChangeText={setText} />
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @returns
|
|
28
|
-
* Doesn't return anything. We live in an undefined world, I suppose.
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* The actual data of who is typing is stored in the chatroom object.
|
|
32
|
-
* If you want to get this data realtime in a room, consider using useRoom({ listen: true }). This data will also be in useInbox().
|
|
33
|
-
* See docs for useRoom or useInbox for more.
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
export default _default;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { NewMessageModel } from '../../classes/Message/types';
|
|
2
|
-
import { UseViewMessagesConfig, UseViewMessagesMethods } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* React hook that returns a function useful for marking messages as viewed on the backend.
|
|
5
|
-
* It works by only clearing unread count when you've reached the most recent message, leveraging React Native FlatList's onViewableItemsChanged.
|
|
6
|
-
* This is only useful if you're using the Juice chat backend.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```js
|
|
10
|
-
* const onViewMessages = useViewMessages({ roomId: 'some_chat_room_id' })
|
|
11
|
-
*
|
|
12
|
-
* return <Juice.Chat onViewMessages={onViewMessages} />
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export default function <Model extends NewMessageModel = NewMessageModel>(config: UseViewMessagesConfig, methods?: UseViewMessagesMethods<Model>): ({ visibleMessages, latestMessageId }: {
|
|
16
|
-
visibleMessages: Model[] | null;
|
|
17
|
-
latestMessageId: string | null;
|
|
18
|
-
}) => void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { NewMessageModel } from '../../classes/Message/types';
|
|
2
|
-
export interface UseViewMessagesConfig {
|
|
3
|
-
roomId: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* An optional dictionary for using custom callbacks for viewed messages.
|
|
7
|
-
*/
|
|
8
|
-
export interface UseViewMessagesMethods<Model extends NewMessageModel = NewMessageModel> {
|
|
9
|
-
/**
|
|
10
|
-
* Callback function that is triggered whenever the messages in view changes.
|
|
11
|
-
* Since the `useViewMessages` hook is only concerned with updating a chat room's unread count and such, `onViewMessages` might be useful if you want to have your own analytics or message tracking.
|
|
12
|
-
*
|
|
13
|
-
* @param info - A dictionary containing info about the currently visible messages
|
|
14
|
-
* @param info.visibleMessages - An array of messages that are currently in view
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
onViewMessages?: (info: {
|
|
18
|
-
visibleMessages: Model[];
|
|
19
|
-
}) => void;
|
|
20
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export * from './classes';
|
|
3
|
-
export * from './hooks';
|
|
4
|
-
import * as ChatType from './components/Chat/types';
|
|
5
|
-
import * as InboxType from './components/Inbox/types';
|
|
6
|
-
import * as MessageType from './classes/Message/types';
|
|
7
|
-
import * as RoomType from './classes/Room/types';
|
|
8
|
-
export declare const ChatTypes: typeof ChatType;
|
|
9
|
-
export declare const InboxTypes: typeof InboxType;
|
|
10
|
-
export declare const MessageTypes: typeof MessageType;
|
|
11
|
-
export declare const RoomTypes: typeof RoomType;
|
package/readme.md
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
# `chat` 🍹
|
|
2
|
-
|
|
3
|
-
```sh
|
|
4
|
-
yarn add chat
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
Build production-ready, full-stack chat in minutes. Drop in our pre-made UI components, connect them to your backend our pre-made logic, and you're good to go.
|
|
8
|
-
|
|
9
|
-
**Stop worrying about:**
|
|
10
|
-
|
|
11
|
-
✅ Auth
|
|
12
|
-
|
|
13
|
-
✅ Customizable UI
|
|
14
|
-
|
|
15
|
-
✅ Transitions & animations
|
|
16
|
-
|
|
17
|
-
✅ Websockets, data & fallbacks
|
|
18
|
-
|
|
19
|
-
✅ Offline support (beta)
|
|
20
|
-
|
|
21
|
-
✅ 1-on-1 and group chats
|
|
22
|
-
|
|
23
|
-
```javascript
|
|
24
|
-
import * as React
|
|
25
|
-
import { useMessages, Messages } from 'usechat'
|
|
26
|
-
|
|
27
|
-
const ChatScreen = () => {
|
|
28
|
-
const { data, send } = useMessages({ id: 'my-first-chat-room' })
|
|
29
|
-
|
|
30
|
-
return <Messages onSend={send} messages={data} />
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Backend setup for firebase
|
|
36
|
-
|
|
37
|
-
If you only want to use this library for the UI components, there is no further setup required.
|
|
38
|
-
|
|
39
|
-
However, if you want to connect your firebase/firestore backend, there is are two added steps.
|
|
40
|
-
|
|
41
|
-
**1. Install dependencies**
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
yarn add firebase @nandorojo/fuego
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**2. Add the provider to the root of your app**
|
|
48
|
-
|
|
49
|
-
Initialize `fuego`'s db first. Then, wrap your app with the `ChatProvider`.
|
|
50
|
-
|
|
51
|
-
```jsx
|
|
52
|
-
// App.tsx
|
|
53
|
-
import * as React from 'react'
|
|
54
|
-
import { ChatProvider } from 'chat'
|
|
55
|
-
import { Fuego } from '@nandorojo/fuego'
|
|
56
|
-
|
|
57
|
-
const fuego = new Fuego({
|
|
58
|
-
//...firebase config here
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
export default () => {
|
|
62
|
-
return <ChatProvider fuego={fuego}>{/* Your app goes here*/}</ChatProvider>
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
[How to find your firebase config](https://support.google.com/firebase/answer/7015592?hl=en#web)
|
|
67
|
-
|
|
68
|
-
_Note_: Make sure you've enabled firebase firestore to use this. See [this tutorial](https://blog.expo.io/how-to-build-a-chat-app-with-react-native-3ef8604ebb3c) for more.
|
|
69
|
-
|
|
70
|
-
## Brief Example
|
|
71
|
-
|
|
72
|
-
This is all it takes to build a **full-stack** live chat with `chat` in React/React Native (with some abstraction).
|
|
73
|
-
|
|
74
|
-
```jsx
|
|
75
|
-
import * as React
|
|
76
|
-
import { useNavigation, useNavigationParam } from 'react-navigation'
|
|
77
|
-
import { useInbox, Inbox, useMessages, Messages } from 'usechat'
|
|
78
|
-
|
|
79
|
-
const InboxScreen = () => {
|
|
80
|
-
const { data } = useInbox()
|
|
81
|
-
const navigation = useNavigation()
|
|
82
|
-
|
|
83
|
-
return <Inbox rooms={data} onPressItem={id => navigation.navigate('Chat', { id })} >
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const ChatScreen = () => {
|
|
87
|
-
const id = useNavigationParam('id')
|
|
88
|
-
const { data, send } = useMessages({ id })
|
|
89
|
-
|
|
90
|
-
return <Messages onSend={send} messages={data} />
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Highlights
|
|
96
|
-
|
|
97
|
-
😎 Works with `react` and `react native` **(including Expo!)**
|
|
98
|
-
|
|
99
|
-
🚨 Integrates with Firebase auth (and can also work with your custom auth solutions)
|
|
100
|
-
|
|
101
|
-
📣 Integrates with `expo-notifications`
|
|
102
|
-
|
|
103
|
-
🥐 Fully customizable UI components
|
|
104
|
-
|
|
105
|
-
🍇 Production-level animations, transitions, and swipe gestures.
|
|
106
|
-
|
|
107
|
-
👾 Written in TypeScript
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
# Get Started
|
|
112
|
-
|
|
113
|
-
Setup is quick and easy. Jump to the setup guide. Then, check out the hello world and example.
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## Chat features included out-of-the-box
|
|
118
|
-
|
|
119
|
-
✏️ Typing indicators
|
|
120
|
-
|
|
121
|
-
💯 Unread count
|
|
122
|
-
|
|
123
|
-
😂 Meme search (powered by Memezy)
|
|
124
|
-
|
|
125
|
-
👻 Image & video, **including** uploading logic & content storage
|
|
126
|
-
|
|
127
|
-
🍪 Online status
|
|
128
|
-
|
|
129
|
-
🕺 Realtime inbox
|
|
130
|
-
|
|
131
|
-
🤯 Realtime chat rooms
|
|
132
|
-
|
|
133
|
-
😇 Room-level user permissions
|
|
134
|
-
|
|
135
|
-
🔥 Group chats
|
|
136
|
-
|
|
137
|
-
👴 Customizable system messages (ex: William Buzzelbees changed the group name to "Frankenstein's Friday Squad")
|
|
138
|
-
|
|
139
|
-
👀 Send a message to multiple people, even if a room with those people doesn't exist yet (like an instagram feed-to-DM flow.)
|
|
140
|
-
|
|
141
|
-
🥇 Room names (coming soon)
|
|
142
|
-
|
|
143
|
-
## Customizable components included
|
|
144
|
-
|
|
145
|
-
🧤 `<AuthGate />` wraps your app and gives it customizable auth, powered by firebase.
|
|
146
|
-
|
|
147
|
-
🧢 `<Inbox />` gives you a real-time list of chat rooms.
|
|
148
|
-
|
|
149
|
-
🎩 `<InboxItem />` List item for `<Inbox />`, including customizable swipe gestures.
|
|
150
|
-
|
|
151
|
-
⛑ `<TypingIndicator />` Show typing, with animations, as it happens
|
|
152
|
-
|
|
153
|
-
🍪 `<UnreadIndicator />` Show an iMessage-like unread indicator, with or without the number of unread messages.
|
|
154
|
-
|
|
155
|
-
⚡️ `<Messages />` Like GiftedChat, to the max.
|
|
156
|
-
|
|
157
|
-
## All the logic you'd need for a chat, handled.
|
|
158
|
-
|
|
159
|
-
Functions are pre-made for the following:
|
|
160
|
-
|
|
161
|
-
🐻 Create chat room
|
|
162
|
-
|
|
163
|
-
🎃 Leave chat room
|
|
164
|
-
|
|
165
|
-
🤘 Remove users from chat room
|
|
166
|
-
|
|
167
|
-
👮♂️ Customizable avatars for chat rooms
|
|
168
|
-
|
|
169
|
-
🏄🏾♂️ Add people to a chat room
|
|
170
|
-
|
|
171
|
-
## Auth integration
|
|
172
|
-
|
|
173
|
-
### If you're using Firebase auth
|
|
174
|
-
|
|
175
|
-
Chat will automatically integrate into your Firebase auth if you're using it once you've completed the setup.
|
|
176
|
-
|
|
177
|
-
## Aren't there a lot of chat SDKs already? What makes this better than all the others?
|
|
178
|
-
|
|
179
|
-
Yes, there are. The motivation for this library comes down to only one concept: **production-ready** chat.
|
|
180
|
-
|
|
181
|
-
If you google `react native chat tutorial`, you'll come up with many smart people writing good articles about building your first chat app. Suggestions range from using firebase's highly-customizable serverless database to more opinionated startups that build SDKs for chat only.
|
|
182
|
-
|
|
183
|
-
The thing is, none of these options created a production-ready chat that "thinks in React."
|
|
184
|
-
|
|
185
|
-
With a custom option like Firebase, you're having to deal with tons of different socket subscriptions, chat schema changes, etc, and building in features like unread count, online status, or typing indicators becomes non-trivial quickly.
|
|
186
|
-
|
|
187
|
-
Meanwhile, existing JavaScript chat SDKs aren't made with React's stateful nature in mind. Companies like Pusher, PubNub, and Stream clearly have something good going for them, but they aren't made for React the way a library like `Apollo` is.
|
|
188
|
-
|
|
189
|
-
**You should be able to build a customizable, full-stack chat with only a few lines of code.** If Stripe can do that for accepting payments, we can do it for sending words.
|
|
190
|
-
|
|
191
|
-
Tutorials for existing chat SDKs have you typing `setState` dozens of times, and you wonder, would this actually look as good as iMessage in production? What if I want to move my component files around? What if I forget to unmount a listener on a certain screen? And if I want to reorganize my component files, do I have to write all that bulky `setState` logic over? What happens if I want to use a state manager like redux?
|
|
192
|
-
|
|
193
|
-
With all those questions in mind, I decided I would go feature-by-feature, headache-by-headache, and make my own chat SDK that was made specifically for `react`/`react-native` (and `expo` in particluar).
|
|
194
|
-
|
|
195
|
-
Thanks to the introduction of `react hooks` in React 16.8.3 (and in `expo` after SDK v33 🔥), making a react-first chat SDK went from a massive headache to an elegant, scalable experience.
|
|
196
|
-
|
|
197
|
-
This chat library relies on two main APIs: `firebase firestore` for the database, `react hooks` for stateful component logic.
|
|
198
|
-
|
|
199
|
-
That means that you can build a serverless chat app that is _actually_ ready for production. And when you need extra customizations like unread counts and typing indicators, you just click that you want them in a GUI.
|
|
200
|
-
|
|
201
|
-
A final point: most chat SDKs own your messages and data. With us, we just link into your firebase, so you own all the data.
|
package/src/ChatContext/types.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ChatConfig } from './types'
|
|
2
|
-
|
|
3
|
-
export default class Chat {
|
|
4
|
-
private chat: ChatConfig
|
|
5
|
-
constructor(chat: ChatConfig = {}) {
|
|
6
|
-
this.chat = chat
|
|
7
|
-
// this.chat = {
|
|
8
|
-
// ...chat,
|
|
9
|
-
// httpCallables: {
|
|
10
|
-
// sendMessageFromFeed: 'sendMessageFromFeed',
|
|
11
|
-
// sendMessageToPeople: 'sendToPeople',
|
|
12
|
-
// sendMessageToGroup: 'sendToGroup',
|
|
13
|
-
// ...(chat.httpCallables || {})
|
|
14
|
-
// }
|
|
15
|
-
// }
|
|
16
|
-
}
|
|
17
|
-
get roomsCollection() {
|
|
18
|
-
return this.chat.roomsCollection || 'rooms'
|
|
19
|
-
}
|
|
20
|
-
get messagesCollection() {
|
|
21
|
-
return this.chat.messagesCollection || 'messages'
|
|
22
|
-
}
|
|
23
|
-
get httpCallables() {
|
|
24
|
-
return {
|
|
25
|
-
sendMessageFromFeed:
|
|
26
|
-
(this.chat.httpCallables &&
|
|
27
|
-
this.chat.httpCallables.sendMessageFromFeed) ||
|
|
28
|
-
'sendMessageFromFeed',
|
|
29
|
-
sendMessageToPeople:
|
|
30
|
-
(this.chat.httpCallables &&
|
|
31
|
-
this.chat.httpCallables.sendMessageToPeople) ||
|
|
32
|
-
'sendMessageToPeople',
|
|
33
|
-
sendMessageToGroup:
|
|
34
|
-
(this.chat.httpCallables &&
|
|
35
|
-
this.chat.httpCallables.sendMessageToGroup) ||
|
|
36
|
-
'sendMessageToGroup',
|
|
37
|
-
createRoom:
|
|
38
|
-
(this.chat.httpCallables && this.chat.httpCallables.createRoom) ||
|
|
39
|
-
'createRoom',
|
|
40
|
-
sendMessageToRooms:
|
|
41
|
-
(this.chat.httpCallables &&
|
|
42
|
-
this.chat.httpCallables.sendMessageToRooms) ||
|
|
43
|
-
'sendMessageToRooms'
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export type RoomPathFunc = (roomId: string) => string
|
|
2
|
-
|
|
3
|
-
export interface ChatConfig {
|
|
4
|
-
roomsCollection?: string
|
|
5
|
-
messagesCollection?: string
|
|
6
|
-
httpCallables?: {
|
|
7
|
-
sendMessageFromFeed: string
|
|
8
|
-
sendMessageToPeople: string
|
|
9
|
-
sendMessageToGroup: string
|
|
10
|
-
sendMessageToRooms: string
|
|
11
|
-
createRoom: string
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface ChatModel {
|
|
16
|
-
roomsCollection: string
|
|
17
|
-
messagesCollection: string
|
|
18
|
-
httpCallables: {
|
|
19
|
-
sendMessageFromFeed: string
|
|
20
|
-
sendMessageToPeople: string
|
|
21
|
-
sendMessageToGroup: string
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { InboxModel } from './types'
|
|
2
|
-
import { chat } from '../../components/ChatProvider'
|
|
3
|
-
|
|
4
|
-
export default class {
|
|
5
|
-
private inbox: InboxModel
|
|
6
|
-
constructor(inbox: InboxModel) {
|
|
7
|
-
this.inbox = inbox
|
|
8
|
-
}
|
|
9
|
-
get path() {
|
|
10
|
-
return chat.messagesCollection
|
|
11
|
-
}
|
|
12
|
-
}
|