@ohos-ports/stream-chat-angular 0.0.0-stage → 7.2.0-beta.1
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 +139 -2
- package/assets/i18n/en.d.ts +157 -0
- package/assets/version.d.ts +1 -0
- package/esm2022/assets/i18n/en.mjs +158 -0
- package/esm2022/assets/version.mjs +2 -0
- package/esm2022/lib/attachment-configuration.service.mjs +182 -0
- package/esm2022/lib/attachment-list/attachment-list.component.mjs +232 -0
- package/esm2022/lib/attachment-preview-list/attachment-preview-list.component.mjs +55 -0
- package/esm2022/lib/attachment.service.mjs +481 -0
- package/esm2022/lib/avatar/avatar.component.mjs +160 -0
- package/esm2022/lib/avatar-placeholder/avatar-placeholder.component.mjs +66 -0
- package/esm2022/lib/channel/channel.component.mjs +45 -0
- package/esm2022/lib/channel-header/channel-header.component.mjs +72 -0
- package/esm2022/lib/channel-list/channel-list.component.mjs +47 -0
- package/esm2022/lib/channel-preview/channel-preview.component.mjs +158 -0
- package/esm2022/lib/channel-query.mjs +77 -0
- package/esm2022/lib/channel.service.mjs +1576 -0
- package/esm2022/lib/chat-client.service.mjs +233 -0
- package/esm2022/lib/custom-templates.service.mjs +258 -0
- package/esm2022/lib/date-parser.service.mjs +51 -0
- package/esm2022/lib/file-utils.mjs +35 -0
- package/esm2022/lib/format-duration.mjs +16 -0
- package/esm2022/lib/get-channel-display-text.mjs +14 -0
- package/esm2022/lib/get-message-translation.mjs +12 -0
- package/esm2022/lib/icon/icon-placeholder/icon-placeholder.component.mjs +28 -0
- package/esm2022/lib/icon/icon.component.mjs +17 -0
- package/esm2022/lib/icon/icon.module.mjs +37 -0
- package/esm2022/lib/icon/loading-indicator/loading-indicator.component.mjs +15 -0
- package/esm2022/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.mjs +20 -0
- package/esm2022/lib/injection-tokens.mjs +3 -0
- package/esm2022/lib/is-image-attachment.mjs +6 -0
- package/esm2022/lib/is-on-separate-date.mjs +11 -0
- package/esm2022/lib/is-safari.mjs +2 -0
- package/esm2022/lib/list-users.mjs +12 -0
- package/esm2022/lib/message/message.component.mjs +501 -0
- package/esm2022/lib/message-actions-box/message-actions-box.component.mjs +123 -0
- package/esm2022/lib/message-actions.service.mjs +191 -0
- package/esm2022/lib/message-blocked/message-blocked.component.mjs +25 -0
- package/esm2022/lib/message-bounce-prompt/message-bounce-prompt.component.mjs +71 -0
- package/esm2022/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.mjs +333 -0
- package/esm2022/lib/message-input/emoji-input.service.mjs +23 -0
- package/esm2022/lib/message-input/message-input-config.service.mjs +50 -0
- package/esm2022/lib/message-input/message-input.component.mjs +626 -0
- package/esm2022/lib/message-input/textarea/textarea.component.mjs +113 -0
- package/esm2022/lib/message-input/textarea.directive.mjs +93 -0
- package/esm2022/lib/message-input/textarea.interface.mjs +2 -0
- package/esm2022/lib/message-input/voice-recorder.service.mjs +27 -0
- package/esm2022/lib/message-list/group-styles.mjs +52 -0
- package/esm2022/lib/message-list/message-list.component.mjs +717 -0
- package/esm2022/lib/message-preview.mjs +22 -0
- package/esm2022/lib/message-reactions/message-reactions.component.mjs +168 -0
- package/esm2022/lib/message-reactions-selector/message-reactions-selector.component.mjs +61 -0
- package/esm2022/lib/message-reactions.service.mjs +70 -0
- package/esm2022/lib/message-text/message-text.component.mjs +141 -0
- package/esm2022/lib/message.service.mjs +43 -0
- package/esm2022/lib/modal/modal.component.mjs +69 -0
- package/esm2022/lib/modal/stream-modal.module.mjs +19 -0
- package/esm2022/lib/notification/notification.component.mjs +20 -0
- package/esm2022/lib/notification-list/notification-list.component.mjs +36 -0
- package/esm2022/lib/notification-list/stream-notification.module.mjs +20 -0
- package/esm2022/lib/notification.service.mjs +79 -0
- package/esm2022/lib/paginated-list/paginated-list.component.mjs +94 -0
- package/esm2022/lib/paginated-list/stream-paginated-list.module.mjs +20 -0
- package/esm2022/lib/parse-date.mjs +27 -0
- package/esm2022/lib/polls/base-poll.component.mjs +87 -0
- package/esm2022/lib/polls/poll/poll.component.mjs +34 -0
- package/esm2022/lib/polls/poll-actions/add-option/add-option.component.mjs +67 -0
- package/esm2022/lib/polls/poll-actions/poll-actions.component.mjs +137 -0
- package/esm2022/lib/polls/poll-actions/poll-answers-list/poll-answers-list.component.mjs +82 -0
- package/esm2022/lib/polls/poll-actions/poll-results/poll-results-list/poll-results-list.component.mjs +63 -0
- package/esm2022/lib/polls/poll-actions/poll-results/poll-vote/poll-vote.component.mjs +33 -0
- package/esm2022/lib/polls/poll-actions/poll-results/poll-vote-results-list/poll-vote-results-list.component.mjs +82 -0
- package/esm2022/lib/polls/poll-actions/upsert-answer/upsert-answer.component.mjs +60 -0
- package/esm2022/lib/polls/poll-composer/poll-composer.component.mjs +134 -0
- package/esm2022/lib/polls/poll-composer/validators.mjs +18 -0
- package/esm2022/lib/polls/poll-header/poll-header.component.mjs +80 -0
- package/esm2022/lib/polls/poll-option-selector/poll-option-selector.component.mjs +137 -0
- package/esm2022/lib/polls/poll-options-list/poll-options-list.component.mjs +39 -0
- package/esm2022/lib/polls/poll-preview/poll-preview.component.mjs +31 -0
- package/esm2022/lib/polls/stream-polls.module.mjs +107 -0
- package/esm2022/lib/polls/unique.validator.mjs +13 -0
- package/esm2022/lib/read-by.mjs +13 -0
- package/esm2022/lib/stream-autocomplete-textarea.module.mjs +33 -0
- package/esm2022/lib/stream-avatar.module.mjs +20 -0
- package/esm2022/lib/stream-chat.module.mjs +163 -0
- package/esm2022/lib/stream-i18n.service.mjs +34 -0
- package/esm2022/lib/stream-textarea.module.mjs +31 -0
- package/esm2022/lib/theme.service.mjs +23 -0
- package/esm2022/lib/thread/thread.component.mjs +51 -0
- package/esm2022/lib/transliteration.service.mjs +24 -0
- package/esm2022/lib/types-custom.mjs +2 -0
- package/esm2022/lib/types.mjs +2 -0
- package/esm2022/lib/user-list/user-list.component.mjs +47 -0
- package/esm2022/lib/virtualized-list.service.mjs +271 -0
- package/esm2022/lib/virtualized-message-list.service.mjs +73 -0
- package/esm2022/lib/voice-recorder/amplitude-recorder.service.mjs +119 -0
- package/esm2022/lib/voice-recorder/audio-recorder.service.mjs +79 -0
- package/esm2022/lib/voice-recorder/media-recorder.mjs +190 -0
- package/esm2022/lib/voice-recorder/mp3-transcoder.mjs +61 -0
- package/esm2022/lib/voice-recorder/transcoder.service.mjs +121 -0
- package/esm2022/lib/voice-recorder/voice-recorder-wavebar/voice-recorder-wavebar.component.mjs +35 -0
- package/esm2022/lib/voice-recorder/voice-recorder.component.mjs +80 -0
- package/esm2022/lib/voice-recorder/voice-recorder.module.mjs +34 -0
- package/esm2022/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.mjs +112 -0
- package/esm2022/lib/voice-recording/voice-recording.component.mjs +91 -0
- package/esm2022/lib/voice-recording/voice-recording.module.mjs +21 -0
- package/esm2022/lib/wave-form-sampler.mjs +72 -0
- package/esm2022/public-api.mjs +104 -0
- package/esm2022/stream-chat-angular.mjs +5 -0
- package/esm2022/stream-chat.mjs +2 -0
- package/fesm2022/stream-chat-angular.mjs +10363 -0
- package/fesm2022/stream-chat-angular.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/attachment-configuration.service.d.ts +58 -0
- package/lib/attachment-list/attachment-list.component.d.ts +76 -0
- package/lib/attachment-preview-list/attachment-preview-list.component.d.ts +37 -0
- package/lib/attachment.service.d.ts +104 -0
- package/lib/avatar/avatar.component.d.ts +64 -0
- package/lib/avatar-placeholder/avatar-placeholder.component.d.ts +48 -0
- package/lib/channel/channel.component.d.ts +22 -0
- package/lib/channel-header/channel-header.component.d.ts +36 -0
- package/lib/channel-list/channel-list.component.d.ts +30 -0
- package/lib/channel-preview/channel-preview.component.d.ts +46 -0
- package/lib/channel-query.d.ts +26 -0
- package/lib/channel.service.d.ts +482 -0
- package/lib/chat-client.service.d.ts +91 -0
- package/lib/custom-templates.service.d.ts +258 -0
- package/lib/date-parser.service.d.ts +39 -0
- package/lib/file-utils.d.ts +9 -0
- package/lib/format-duration.d.ts +1 -0
- package/lib/get-channel-display-text.d.ts +2 -0
- package/lib/get-message-translation.d.ts +3 -0
- package/lib/icon/icon-placeholder/icon-placeholder.component.d.ts +20 -0
- package/lib/icon/icon.component.d.ts +14 -0
- package/lib/icon/icon.module.d.ts +11 -0
- package/lib/icon/loading-indicator/loading-indicator.component.d.ts +9 -0
- package/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.d.ts +11 -0
- package/lib/injection-tokens.d.ts +3 -0
- package/lib/is-image-attachment.d.ts +2 -0
- package/lib/is-on-separate-date.d.ts +1 -0
- package/lib/is-safari.d.ts +1 -0
- package/lib/list-users.d.ts +2 -0
- package/lib/message/message.component.d.ts +126 -0
- package/lib/message-actions-box/message-actions-box.component.d.ts +49 -0
- package/lib/message-actions.service.d.ts +49 -0
- package/lib/message-blocked/message-blocked.component.d.ts +17 -0
- package/lib/message-bounce-prompt/message-bounce-prompt.component.d.ts +28 -0
- package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +98 -0
- package/lib/message-input/emoji-input.service.d.ts +14 -0
- package/lib/message-input/message-input-config.service.d.ts +54 -0
- package/lib/message-input/message-input.component.d.ts +189 -0
- package/lib/message-input/textarea/textarea.component.d.ts +55 -0
- package/lib/message-input/textarea.directive.d.ts +24 -0
- package/lib/message-input/textarea.interface.d.ts +14 -0
- package/lib/message-input/voice-recorder.service.d.ts +19 -0
- package/lib/message-list/group-styles.d.ts +3 -0
- package/lib/message-list/message-list.component.d.ts +146 -0
- package/lib/message-preview.d.ts +2 -0
- package/lib/message-reactions/message-reactions.component.d.ts +69 -0
- package/lib/message-reactions-selector/message-reactions-selector.component.d.ts +35 -0
- package/lib/message-reactions.service.d.ts +50 -0
- package/lib/message-text/message-text.component.d.ts +45 -0
- package/lib/message.service.d.ts +38 -0
- package/lib/modal/modal.component.d.ts +29 -0
- package/lib/modal/stream-modal.module.d.ts +9 -0
- package/lib/notification/notification.component.d.ts +19 -0
- package/lib/notification-list/notification-list.component.d.ts +23 -0
- package/lib/notification-list/stream-notification.module.d.ts +10 -0
- package/lib/notification.service.d.ts +38 -0
- package/lib/paginated-list/paginated-list.component.d.ts +45 -0
- package/lib/paginated-list/stream-paginated-list.module.d.ts +10 -0
- package/lib/parse-date.d.ts +1 -0
- package/lib/polls/base-poll.component.d.ts +43 -0
- package/lib/polls/poll/poll.component.d.ts +12 -0
- package/lib/polls/poll-actions/add-option/add-option.component.d.ts +22 -0
- package/lib/polls/poll-actions/poll-actions.component.d.ts +50 -0
- package/lib/polls/poll-actions/poll-answers-list/poll-answers-list.component.d.ts +25 -0
- package/lib/polls/poll-actions/poll-results/poll-results-list/poll-results-list.component.d.ts +22 -0
- package/lib/polls/poll-actions/poll-results/poll-vote/poll-vote.component.d.ts +20 -0
- package/lib/polls/poll-actions/poll-results/poll-vote-results-list/poll-vote-results-list.component.d.ts +24 -0
- package/lib/polls/poll-actions/upsert-answer/upsert-answer.component.d.ts +27 -0
- package/lib/polls/poll-composer/poll-composer.component.d.ts +43 -0
- package/lib/polls/poll-composer/validators.d.ts +3 -0
- package/lib/polls/poll-header/poll-header.component.d.ts +19 -0
- package/lib/polls/poll-option-selector/poll-option-selector.component.d.ts +27 -0
- package/lib/polls/poll-options-list/poll-options-list.component.d.ts +17 -0
- package/lib/polls/poll-preview/poll-preview.component.d.ts +13 -0
- package/lib/polls/stream-polls.module.d.ts +26 -0
- package/lib/polls/unique.validator.d.ts +2 -0
- package/lib/read-by.d.ts +2 -0
- package/lib/stream-autocomplete-textarea.module.d.ts +11 -0
- package/lib/stream-avatar.module.d.ts +10 -0
- package/lib/stream-chat.module.d.ts +35 -0
- package/lib/stream-i18n.service.d.ts +19 -0
- package/lib/stream-textarea.module.d.ts +9 -0
- package/lib/theme.service.d.ts +14 -0
- package/lib/thread/thread.component.d.ts +26 -0
- package/lib/transliteration.service.d.ts +15 -0
- package/lib/types-custom.d.ts +16 -0
- package/lib/types.d.ts +365 -0
- package/lib/user-list/user-list.component.d.ts +29 -0
- package/lib/virtualized-list.service.d.ts +58 -0
- package/lib/virtualized-message-list.service.d.ts +15 -0
- package/lib/voice-recorder/amplitude-recorder.service.d.ts +71 -0
- package/lib/voice-recorder/audio-recorder.service.d.ts +46 -0
- package/lib/voice-recorder/media-recorder.d.ts +46 -0
- package/lib/voice-recorder/mp3-transcoder.d.ts +1 -0
- package/lib/voice-recorder/transcoder.service.d.ts +40 -0
- package/lib/voice-recorder/voice-recorder-wavebar/voice-recorder-wavebar.component.d.ts +21 -0
- package/lib/voice-recorder/voice-recorder.component.d.ts +30 -0
- package/lib/voice-recorder/voice-recorder.module.d.ts +12 -0
- package/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.d.ts +36 -0
- package/lib/voice-recording/voice-recording.component.d.ts +29 -0
- package/lib/voice-recording/voice-recording.module.d.ts +11 -0
- package/lib/wave-form-sampler.d.ts +1 -0
- package/package.json +62 -4
- package/public-api.d.ts +99 -0
- package/src/assets/assets/EmojiOneColor.woff2 +0 -0
- package/src/assets/assets/NotoColorEmoji-flags.woff2 +0 -0
- package/src/assets/assets/icons/stream-chat-icons.eot +0 -0
- package/src/assets/assets/icons/stream-chat-icons.svg +50 -0
- package/src/assets/assets/icons/stream-chat-icons.ttf +0 -0
- package/src/assets/assets/icons/stream-chat-icons.woff +0 -0
- package/src/assets/assets/icons/stream-chat-icons.woff2 +0 -0
- package/src/assets/i18n/en.ts +184 -0
- package/src/assets/styles/css/emoji-mart.css +1 -0
- package/src/assets/styles/css/emoji-replacement.css +1 -0
- package/src/assets/styles/css/index.css +1 -0
- package/src/assets/styles/css/index.layout.css +1 -0
- package/src/assets/styles/scss/AIStateIndicator/AIStateIndicator-layout.scss +3 -0
- package/src/assets/styles/scss/AIStateIndicator/AIStateIndicator-theme.scss +7 -0
- package/src/assets/styles/scss/AttachmentList/AttachmentList-layout.scss +701 -0
- package/src/assets/styles/scss/AttachmentList/AttachmentList-theme.scss +605 -0
- package/src/assets/styles/scss/AttachmentPreviewList/AttachmentPreviewList-layout.scss +141 -0
- package/src/assets/styles/scss/AttachmentPreviewList/AttachmentPreviewList-theme.scss +190 -0
- package/src/assets/styles/scss/AudioRecorder/AudioRecorder-layout.scss +139 -0
- package/src/assets/styles/scss/AudioRecorder/AudioRecorder-theme.scss +61 -0
- package/src/assets/styles/scss/Autocomplete/Autocomplete-layout.scss +94 -0
- package/src/assets/styles/scss/Autocomplete/Autocomplete-theme.scss +220 -0
- package/src/assets/styles/scss/Avatar/Avatar-layout.scss +137 -0
- package/src/assets/styles/scss/Avatar/Avatar-theme.scss +64 -0
- package/src/assets/styles/scss/BaseImage/BaseImage-layout.scss +21 -0
- package/src/assets/styles/scss/BaseImage/BaseImage-theme.scss +35 -0
- package/src/assets/styles/scss/BaseImage/index.scss +2 -0
- package/src/assets/styles/scss/Channel/Channel-layout.scss +141 -0
- package/src/assets/styles/scss/Channel/Channel-theme.scss +100 -0
- package/src/assets/styles/scss/ChannelHeader/ChannelHeader-layout.scss +27 -0
- package/src/assets/styles/scss/ChannelHeader/ChannelHeader-theme.scss +43 -0
- package/src/assets/styles/scss/ChannelList/ChannelList-layout.scss +65 -0
- package/src/assets/styles/scss/ChannelList/ChannelList-theme.scss +89 -0
- package/src/assets/styles/scss/ChannelPreview/ChannelPreview-layout.scss +126 -0
- package/src/assets/styles/scss/ChannelPreview/ChannelPreview-theme.scss +148 -0
- package/src/assets/styles/scss/ChannelSearch/ChannelSearch-layout.scss +122 -0
- package/src/assets/styles/scss/ChannelSearch/ChannelSearch-theme.scss +238 -0
- package/src/assets/styles/scss/ChatView/ChatView-layout.scss +43 -0
- package/src/assets/styles/scss/ChatView/ChatView-theme.scss +32 -0
- package/src/assets/styles/scss/Dialog/Dialog-layout.scss +70 -0
- package/src/assets/styles/scss/Dialog/Dialog-theme.scss +103 -0
- package/src/assets/styles/scss/DragAndDropContainer/DragAndDropContainer-layout.scss +5 -0
- package/src/assets/styles/scss/DragAndDropContainer/DragAndDropContainer-theme.scss +47 -0
- package/src/assets/styles/scss/DropzoneContainer/DropzoneContainer-layout.scss +14 -0
- package/src/assets/styles/scss/DropzoneContainer/DropzoneContainer-theme.scss +17 -0
- package/src/assets/styles/scss/EditMessageForm/EditMessageForm-layout.scss +51 -0
- package/src/assets/styles/scss/EditMessageForm/EditMessageForm-theme.scss +50 -0
- package/src/assets/styles/scss/Form/Form-layout.scss +49 -0
- package/src/assets/styles/scss/Form/Form-theme.scss +82 -0
- package/src/assets/styles/scss/Icon/Icon-layout.scss +98 -0
- package/src/assets/styles/scss/Icon/Icon-theme.scss +17 -0
- package/src/assets/styles/scss/ImageCarousel/ImageCarousel-layout.scss +51 -0
- package/src/assets/styles/scss/ImageCarousel/ImageCarousel-theme.scss +30 -0
- package/src/assets/styles/scss/InfiniteScrollPaginator/InfiniteScrollPaginator-layout.scss +4 -0
- package/src/assets/styles/scss/LinkPreview/LinkPreview-layout.scss +67 -0
- package/src/assets/styles/scss/LinkPreview/LinkPreview-theme.scss +32 -0
- package/src/assets/styles/scss/LinkPreview/index.scss +2 -0
- package/src/assets/styles/scss/LoadingIndicator/LoadingIndicator-layout.scss +64 -0
- package/src/assets/styles/scss/LoadingIndicator/LoadingIndicator-theme.scss +14 -0
- package/src/assets/styles/scss/Location/Location-layout.scss +52 -0
- package/src/assets/styles/scss/Location/Location-theme.scss +32 -0
- package/src/assets/styles/scss/Message/Message-layout.scss +605 -0
- package/src/assets/styles/scss/Message/Message-theme.scss +483 -0
- package/src/assets/styles/scss/MessageActionsBox/MessageActionsBox-layout.scss +20 -0
- package/src/assets/styles/scss/MessageActionsBox/MessageActionsBox-theme.scss +85 -0
- package/src/assets/styles/scss/MessageBouncePrompt/MessageBouncePrompt-layout.scss +19 -0
- package/src/assets/styles/scss/MessageBouncePrompt/MessageBouncePrompt-theme.scss +51 -0
- package/src/assets/styles/scss/MessageInput/MessageInput-layout.scss +268 -0
- package/src/assets/styles/scss/MessageInput/MessageInput-theme.scss +359 -0
- package/src/assets/styles/scss/MessageList/MessageList-layout.scss +65 -0
- package/src/assets/styles/scss/MessageList/MessageList-theme.scss +107 -0
- package/src/assets/styles/scss/MessageList/VirtualizedMessageList-layout.scss +57 -0
- package/src/assets/styles/scss/MessageList/VirtualizedMessageList-theme.scss +41 -0
- package/src/assets/styles/scss/MessageReactions/MessageReactions-layout.scss +143 -0
- package/src/assets/styles/scss/MessageReactions/MessageReactions-theme.scss +92 -0
- package/src/assets/styles/scss/MessageReactions/MessageReactionsSelector-layout.scss +86 -0
- package/src/assets/styles/scss/MessageReactions/MessageReactionsSelector-theme.scss +94 -0
- package/src/assets/styles/scss/Modal/Modal-layout.scss +74 -0
- package/src/assets/styles/scss/Modal/Modal-theme.scss +109 -0
- package/src/assets/styles/scss/Notification/MessageNotification-layout.scss +12 -0
- package/src/assets/styles/scss/Notification/MessageNotification-theme.scss +34 -0
- package/src/assets/styles/scss/Notification/Notification-layout.scss +7 -0
- package/src/assets/styles/scss/Notification/Notification-theme.scss +32 -0
- package/src/assets/styles/scss/Notification/NotificationList-layout.scss +11 -0
- package/src/assets/styles/scss/Notification/NotificationList-theme.scss +31 -0
- package/src/assets/styles/scss/Poll/Poll-layout.scss +489 -0
- package/src/assets/styles/scss/Poll/Poll-theme.scss +178 -0
- package/src/assets/styles/scss/Search/Search-layout.scss +148 -0
- package/src/assets/styles/scss/Search/Search-theme.scss +222 -0
- package/src/assets/styles/scss/Thread/Thread-layout.scss +65 -0
- package/src/assets/styles/scss/Thread/Thread-theme.scss +82 -0
- package/src/assets/styles/scss/ThreadList/ThreadList-layout.scss +152 -0
- package/src/assets/styles/scss/ThreadList/ThreadList-theme.scss +75 -0
- package/src/assets/styles/scss/Tooltip/Tooltip-layout.scss +10 -0
- package/src/assets/styles/scss/Tooltip/Tooltip-theme.scss +36 -0
- package/src/assets/styles/scss/TypingIndicator/TypingIndicator-layout.scss +31 -0
- package/src/assets/styles/scss/TypingIndicator/TypingIndicator-theme.scss +68 -0
- package/src/assets/styles/scss/UnreadCountBadge/UnreadCountBadge-layout.scss +49 -0
- package/src/assets/styles/scss/UnreadCountBadge/UnreadCountBadge-theme.scss +11 -0
- package/src/assets/styles/scss/_base.scss +65 -0
- package/src/assets/styles/scss/_emoji-replacement.scss +45 -0
- package/src/assets/styles/scss/_global-layout-variables.scss +65 -0
- package/src/assets/styles/scss/_global-theme-variables.scss +173 -0
- package/src/assets/styles/scss/_icons.scss +36 -0
- package/src/assets/styles/scss/_palette-variables.scss +55 -0
- package/src/assets/styles/scss/_utils.scss +212 -0
- package/src/assets/styles/scss/_variables.scss +2 -0
- package/src/assets/styles/scss/common/CTAButton/CTAButton-layout.scss +4 -0
- package/src/assets/styles/scss/common/CTAButton/CTAButton-theme.scss +42 -0
- package/src/assets/styles/scss/common/CircleFAButton/CircleFAButton-layout.scss +14 -0
- package/src/assets/styles/scss/common/CircleFAButton/CircleFAButton-theme.scss +35 -0
- package/src/assets/styles/scss/index.layout.scss +49 -0
- package/src/assets/styles/scss/index.scss +50 -0
- package/src/assets/styles/scss/vendor/emoji-mart.scss +514 -0
- package/src/assets/styles/scss/vendor/react-image-gallery.scss +258 -0
- package/src/assets/version.ts +1 -0
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
import { NgZone } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
|
+
import { Attachment, Channel, ChannelFilters, ChannelOptions, ChannelSort, CustomMessageData, CustomReactionData, Event, LocalMessage, MessageResponse, ReactionResponse, UserResponse } from 'stream-chat';
|
|
4
|
+
import { ChatClientService, ClientEvent } from './chat-client.service';
|
|
5
|
+
import { NotificationService } from './notification.service';
|
|
6
|
+
import { AttachmentUpload, ChannelQueryResult, ChannelQueryState, ChannelQueryType, MessageInput, MessageReactionType, NextPageConfiguration, StreamMessage } from './types';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* The `ChannelService` provides data and interaction for the channel list and message list.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ChannelService {
|
|
12
|
+
private chatClientService;
|
|
13
|
+
private ngZone;
|
|
14
|
+
private notificationService;
|
|
15
|
+
/**
|
|
16
|
+
* Emits `false` if there are no more pages of channels that can be loaded.
|
|
17
|
+
*/
|
|
18
|
+
hasMoreChannels$: Observable<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Emits the currently loaded and [watched](/chat/docs/javascript/watch_channel/) channel list.
|
|
21
|
+
*
|
|
22
|
+
* :::important
|
|
23
|
+
* If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/concepts/change-detection/) explains this in detail.
|
|
24
|
+
* :::
|
|
25
|
+
*/
|
|
26
|
+
channels$: Observable<Channel[] | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* The result of the latest channel query request.
|
|
29
|
+
*/
|
|
30
|
+
channelQueryState$: Observable<ChannelQueryState | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* Emits the currently active channel.
|
|
33
|
+
*
|
|
34
|
+
* :::important
|
|
35
|
+
* If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/concepts/change-detection/) explains this in detail.
|
|
36
|
+
* :::
|
|
37
|
+
*
|
|
38
|
+
* The active channel will always be marked as read when a new message is received
|
|
39
|
+
*/
|
|
40
|
+
activeChannel$: Observable<Channel | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* Emits the list of currently loaded messages of the active channel.
|
|
43
|
+
*/
|
|
44
|
+
activeChannelMessages$: Observable<StreamMessage[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Emits the list of pinned messages of the active channel.
|
|
47
|
+
*/
|
|
48
|
+
activeChannelPinnedMessages$: Observable<StreamMessage[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Emits the id of the currently selected parent message. If no message is selected, it emits undefined.
|
|
51
|
+
*/
|
|
52
|
+
activeParentMessageId$: Observable<string | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* Emits the list of currently loaded thread replies belonging to the selected parent message. If there is no currently active thread it emits an empty array.
|
|
55
|
+
*/
|
|
56
|
+
activeThreadMessages$: Observable<StreamMessage[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Emits the currently selected parent message. If no message is selected, it emits undefined.
|
|
59
|
+
*/
|
|
60
|
+
activeParentMessage$: Observable<StreamMessage | undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* Emits the currently selected message to quote
|
|
63
|
+
*/
|
|
64
|
+
messageToQuote$: Observable<StreamMessage | undefined>;
|
|
65
|
+
/**
|
|
66
|
+
* Emits the ID of the message the message list should jump to (can be a channel message or thread message)
|
|
67
|
+
*/
|
|
68
|
+
jumpToMessage$: Observable<{
|
|
69
|
+
id?: string;
|
|
70
|
+
parentId?: string;
|
|
71
|
+
}>;
|
|
72
|
+
/**
|
|
73
|
+
* Emits the list of users that are currently typing in the channel (current user is not included)
|
|
74
|
+
*/
|
|
75
|
+
usersTypingInChannel$: Observable<UserResponse[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Emits the list of users that are currently typing in the active thread (current user is not included)
|
|
78
|
+
*/
|
|
79
|
+
usersTypingInThread$: Observable<UserResponse[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Emits a map that contains the date of the latest message sent by the current user by channels (this is used to detect if slow mode countdown should be started)
|
|
82
|
+
*/
|
|
83
|
+
latestMessageDateByUserByChannels$: Observable<{
|
|
84
|
+
[key: string]: Date;
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* If you're using [semantic filters for moderation](/moderation/docs/) you can set up rules for bouncing messages.
|
|
88
|
+
*
|
|
89
|
+
* If a message is bounced, it will be emitted via this `Observable`. The built-in [`MessageBouncePrompt` component](/chat/docs/sdk/angular/components/MessageBouncePromptComponent/) will display the bounce option to the user if a bounced message is clicked.
|
|
90
|
+
*/
|
|
91
|
+
bouncedMessage$: BehaviorSubject<StreamMessage | undefined>;
|
|
92
|
+
/**
|
|
93
|
+
* The last read message id of the active channel, it's used by the message list component to display unread UI, and jump to latest read message
|
|
94
|
+
*
|
|
95
|
+
* This property isn't always updated, please use `channel.read` to display up-to-date read information
|
|
96
|
+
*/
|
|
97
|
+
activeChannelLastReadMessageId?: string;
|
|
98
|
+
/**
|
|
99
|
+
* The unread count of the active channel, it's used by the message list component to display unread UI
|
|
100
|
+
*
|
|
101
|
+
* This property isn't always updated, please use `channel.read` to display up-to-date read information
|
|
102
|
+
*/
|
|
103
|
+
activeChannelUnreadCount?: number;
|
|
104
|
+
/**
|
|
105
|
+
* Custom event handler to call if a new message received from a channel that is not being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/)
|
|
106
|
+
*
|
|
107
|
+
* If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
|
|
108
|
+
*/
|
|
109
|
+
customNewMessageNotificationHandler?: (clientEvent: ClientEvent, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void) => void;
|
|
110
|
+
/**
|
|
111
|
+
* Custom event handler to call when the user is added to a channel, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).
|
|
112
|
+
*
|
|
113
|
+
* If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
|
|
114
|
+
*/
|
|
115
|
+
customAddedToChannelNotificationHandler?: (clientEvent: ClientEvent, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void) => void;
|
|
116
|
+
/**
|
|
117
|
+
* Custom event handler to call when the user is removed from a channel, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).
|
|
118
|
+
*
|
|
119
|
+
* If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
|
|
120
|
+
*/
|
|
121
|
+
customRemovedFromChannelNotificationHandler?: (clientEvent: ClientEvent, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void) => void;
|
|
122
|
+
/**
|
|
123
|
+
* Custom event handler to call when a channel is deleted, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).
|
|
124
|
+
*
|
|
125
|
+
* If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
|
|
126
|
+
*/
|
|
127
|
+
customChannelDeletedHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
|
|
128
|
+
/**
|
|
129
|
+
* Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).
|
|
130
|
+
*
|
|
131
|
+
* If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
|
|
132
|
+
*/
|
|
133
|
+
customChannelUpdatedHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
|
|
134
|
+
/**
|
|
135
|
+
* Custom event handler to call when a channel is truncated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).
|
|
136
|
+
*
|
|
137
|
+
* If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
|
|
138
|
+
*/
|
|
139
|
+
customChannelTruncatedHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
|
|
140
|
+
/**
|
|
141
|
+
* Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).
|
|
142
|
+
*
|
|
143
|
+
* If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
|
|
144
|
+
*/
|
|
145
|
+
customChannelHiddenHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
|
|
146
|
+
/**
|
|
147
|
+
* Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).
|
|
148
|
+
*
|
|
149
|
+
* If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
|
|
150
|
+
*/
|
|
151
|
+
customChannelVisibleHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
|
|
152
|
+
/**
|
|
153
|
+
* Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/services/ChannelService/#channels/).
|
|
154
|
+
*
|
|
155
|
+
* If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
|
|
156
|
+
*/
|
|
157
|
+
customNewMessageHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
|
|
158
|
+
/**
|
|
159
|
+
* You can override the default file upload request - you can use this to upload files to your own CDN
|
|
160
|
+
*/
|
|
161
|
+
customFileUploadRequest?: (file: File, channel: Channel) => Promise<{
|
|
162
|
+
file: string;
|
|
163
|
+
}>;
|
|
164
|
+
/**
|
|
165
|
+
* You can override the default image upload request - you can use this to upload images to your own CDN
|
|
166
|
+
*/
|
|
167
|
+
customImageUploadRequest?: (file: File, channel: Channel) => Promise<{
|
|
168
|
+
file: string;
|
|
169
|
+
}>;
|
|
170
|
+
/**
|
|
171
|
+
* You can override the default file delete request - override this if you use your own CDN
|
|
172
|
+
*/
|
|
173
|
+
customFileDeleteRequest?: (url: string, channel: Channel) => Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* You can override the default image delete request - override this if you use your own CDN
|
|
176
|
+
*/
|
|
177
|
+
customImageDeleteRequest?: (url: string, channel: Channel) => Promise<void>;
|
|
178
|
+
/**
|
|
179
|
+
* The provided method will be called before deleting a message. If the returned Promise resolves to `true` to deletion will go ahead. If `false` is returned, the message won't be deleted.
|
|
180
|
+
*/
|
|
181
|
+
messageDeleteConfirmationHandler?: (message: StreamMessage) => Promise<boolean>;
|
|
182
|
+
/**
|
|
183
|
+
* The provided method will be called before a new message is sent to Stream's API. You can use this hook to tranfrom or enrich the message being sent.
|
|
184
|
+
*/
|
|
185
|
+
beforeSendMessage?: (input: MessageInput) => MessageInput | Promise<MessageInput>;
|
|
186
|
+
/**
|
|
187
|
+
* The provided method will be called before a message is sent to Stream's API for update. You can use this hook to tranfrom or enrich the message being updated.
|
|
188
|
+
*/
|
|
189
|
+
beforeUpdateMessage?: (message: StreamMessage) => StreamMessage | Promise<StreamMessage>;
|
|
190
|
+
/**
|
|
191
|
+
* Since switching channels changes the state of multiple obserables, this observable can be used to check if all observables are updated.
|
|
192
|
+
* - `end` means all observables are in stable state
|
|
193
|
+
* - `start` means all observables are in unstable state
|
|
194
|
+
*/
|
|
195
|
+
channelSwitchState$: Observable<'start' | 'end'>;
|
|
196
|
+
/**
|
|
197
|
+
* @internal
|
|
198
|
+
*/
|
|
199
|
+
static readonly MAX_MESSAGE_REACTIONS_TO_FETCH = 1200;
|
|
200
|
+
/**
|
|
201
|
+
* @internal
|
|
202
|
+
*/
|
|
203
|
+
isMessageLoadingInProgress: boolean;
|
|
204
|
+
messagePageSize: number;
|
|
205
|
+
private channelsSubject;
|
|
206
|
+
private activeChannelSubject;
|
|
207
|
+
private activeChannelMessagesSubject;
|
|
208
|
+
private activeChannelPinnedMessagesSubject;
|
|
209
|
+
private hasMoreChannelsSubject;
|
|
210
|
+
private activeChannelSubscriptions;
|
|
211
|
+
private channelSubscriptions;
|
|
212
|
+
private activeParentMessageIdSubject;
|
|
213
|
+
private activeThreadMessagesSubject;
|
|
214
|
+
private jumpToMessageSubject;
|
|
215
|
+
private latestMessageDateByUserByChannelsSubject;
|
|
216
|
+
private readonly attachmentMaxSizeFallbackInMB;
|
|
217
|
+
private messageToQuoteSubject;
|
|
218
|
+
private usersTypingInChannelSubject;
|
|
219
|
+
private usersTypingInThreadSubject;
|
|
220
|
+
private _shouldMarkActiveChannelAsRead;
|
|
221
|
+
private shouldSetActiveChannel;
|
|
222
|
+
private clientEventsSubscription;
|
|
223
|
+
private isStateRecoveryInProgress;
|
|
224
|
+
private channelQueryStateSubject;
|
|
225
|
+
private channelSwitchStateSubject;
|
|
226
|
+
private channelQuery?;
|
|
227
|
+
private _customPaginator;
|
|
228
|
+
private channelListSetter;
|
|
229
|
+
private messageListSetter;
|
|
230
|
+
private threadListSetter;
|
|
231
|
+
private parentMessageSetter;
|
|
232
|
+
private dismissErrorNotification?;
|
|
233
|
+
private areReadEventsPaused;
|
|
234
|
+
private markReadThrottleTime;
|
|
235
|
+
private markReadTimeout?;
|
|
236
|
+
private scheduledMarkReadRequest?;
|
|
237
|
+
constructor(chatClientService: ChatClientService, ngZone: NgZone, notificationService: NotificationService);
|
|
238
|
+
/**
|
|
239
|
+
* If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.
|
|
240
|
+
*/
|
|
241
|
+
get shouldMarkActiveChannelAsRead(): boolean;
|
|
242
|
+
/**
|
|
243
|
+
* If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.
|
|
244
|
+
*/
|
|
245
|
+
set shouldMarkActiveChannelAsRead(shouldMarkActiveChannelAsRead: boolean);
|
|
246
|
+
/**
|
|
247
|
+
* By default the SDK uses an offset based pagination, you can change/extend this by providing your own custom paginator method.
|
|
248
|
+
*
|
|
249
|
+
* The method will be called with the result of the latest channel query.
|
|
250
|
+
*
|
|
251
|
+
* You can return either an offset, or a filter using the [`$lte`/`$gte` operator](/chat/docs/javascript/query_syntax_operators/). If you return a filter, it will be merged with the filter provided for the `init` method.
|
|
252
|
+
*/
|
|
253
|
+
set customPaginator(paginator: ((channelQueryResult: Channel[]) => NextPageConfiguration) | undefined);
|
|
254
|
+
/**
|
|
255
|
+
* Sets the given `channel` as active and marks it as read.
|
|
256
|
+
* If the channel wasn't previously part of the channel, it will be added to the beginning of the list.
|
|
257
|
+
* @param channel
|
|
258
|
+
*/
|
|
259
|
+
setAsActiveChannel(channel: Channel): void;
|
|
260
|
+
/**
|
|
261
|
+
* Deselects the currently active (if any) channel
|
|
262
|
+
*/
|
|
263
|
+
deselectActiveChannel(): void;
|
|
264
|
+
/**
|
|
265
|
+
* Sets the given `message` as an active parent message. If `undefined` is provided, it will deleselect the current parent message.
|
|
266
|
+
* @param message
|
|
267
|
+
* @param loadMessagesForm
|
|
268
|
+
*/
|
|
269
|
+
setAsActiveParentMessage(message: StreamMessage | undefined, loadMessagesForm?: 'request' | 'state'): Promise<void>;
|
|
270
|
+
/**
|
|
271
|
+
* Loads the next page of messages of the active channel. The page size can be set in the [query option](/chat/docs/javascript/query_channels/#query-options) object.
|
|
272
|
+
* @param direction
|
|
273
|
+
*/
|
|
274
|
+
loadMoreMessages(direction?: 'older' | 'newer'): false | Promise<import("stream-chat").QueryChannelAPIResponse> | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* Loads the next page of messages of the active thread. The page size can be set in the [query option](/chat/docs/javascript/query_channels/#query-options) object.
|
|
277
|
+
* @param direction
|
|
278
|
+
*/
|
|
279
|
+
loadMoreThreadReplies(direction?: 'older' | 'newer'): false | Promise<void>;
|
|
280
|
+
/**
|
|
281
|
+
* Queries the channels with the given filters, sorts and options. More info about [channel querying](/chat/docs/javascript/query_channels/) can be found in the platform documentation. By default the first channel in the list will be set as active channel and will be marked as read.
|
|
282
|
+
* @param filters
|
|
283
|
+
* @param sort
|
|
284
|
+
* @param options
|
|
285
|
+
* @param shouldSetActiveChannel Decides if the first channel in the result should be made as an active channel or not.
|
|
286
|
+
* @returns the list of channels found by the query
|
|
287
|
+
*/
|
|
288
|
+
init(filters: ChannelFilters, sort?: ChannelSort, options?: ChannelOptions, shouldSetActiveChannel?: boolean): Promise<Channel[]>;
|
|
289
|
+
/**
|
|
290
|
+
* Queries the channels with the given query function. More info about [channel querying](/chat/docs/javascript/query_channels/) can be found in the platform documentation.
|
|
291
|
+
* @param query
|
|
292
|
+
* @param options
|
|
293
|
+
* @param options.shouldSetActiveChannel The `shouldSetActiveChannel` specifies if the first channel in the result should be selected as the active channel or not. Default is `true`.
|
|
294
|
+
* @param options.messagePageSize How many messages should we load? The default is 25
|
|
295
|
+
* @returns the channels that were loaded
|
|
296
|
+
*/
|
|
297
|
+
initWithCustomQuery(query: (queryType: ChannelQueryType) => Promise<ChannelQueryResult>, options?: {
|
|
298
|
+
shouldSetActiveChannel: boolean;
|
|
299
|
+
messagePageSize: number;
|
|
300
|
+
}): Promise<Channel[]>;
|
|
301
|
+
/**
|
|
302
|
+
* Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](/chat/docs/sdk/angular/services/ChatClientService/#disconnectuser/).
|
|
303
|
+
*/
|
|
304
|
+
reset(): void;
|
|
305
|
+
/**
|
|
306
|
+
* Loads the next page of channels. The page size can be set in the [query option](/chat/docs/javascript/query_channels/#query-options) object.
|
|
307
|
+
*/
|
|
308
|
+
loadMoreChannels(): Promise<void>;
|
|
309
|
+
/**
|
|
310
|
+
* Adds a reaction to a message.
|
|
311
|
+
* @param messageId The id of the message to add the reaction to
|
|
312
|
+
* @param reactionType The type of the reaction
|
|
313
|
+
* @param customData
|
|
314
|
+
*/
|
|
315
|
+
addReaction(messageId: string, reactionType: MessageReactionType, customData?: CustomReactionData): Promise<void>;
|
|
316
|
+
/**
|
|
317
|
+
* Removes a reaction from a message.
|
|
318
|
+
* @param messageId The id of the message to remove the reaction from
|
|
319
|
+
* @param reactionType Thr type of reaction to remove
|
|
320
|
+
*/
|
|
321
|
+
removeReaction(messageId: string, reactionType: MessageReactionType): Promise<void>;
|
|
322
|
+
/**
|
|
323
|
+
* Sends a message to the active channel. The message is immediately added to the message list, if an error occurs and the message can't be sent, the error is indicated in `state` of the message.
|
|
324
|
+
* @param text The text of the message
|
|
325
|
+
* @param attachments The attachments
|
|
326
|
+
* @param mentionedUsers Mentioned users
|
|
327
|
+
* @param parentId Id of the parent message (if sending a thread reply)
|
|
328
|
+
* @param quotedMessageId Id of the message to quote (if sending a quote reply)
|
|
329
|
+
* @param customData
|
|
330
|
+
* @param pollId Id of the poll (if sending a poll message)
|
|
331
|
+
*/
|
|
332
|
+
sendMessage(text: string, attachments?: Attachment[], mentionedUsers?: UserResponse[], parentId?: string | undefined, quotedMessageId?: string | undefined, customData?: undefined | CustomMessageData, pollId?: string | undefined): Promise<StreamMessage>;
|
|
333
|
+
/**
|
|
334
|
+
* Resends the given message to the active channel
|
|
335
|
+
* @param message The message to resend
|
|
336
|
+
*/
|
|
337
|
+
resendMessage(message: StreamMessage): Promise<StreamMessage>;
|
|
338
|
+
/**
|
|
339
|
+
* Updates the message in the active channel
|
|
340
|
+
* @param message Mesage to be updated
|
|
341
|
+
*/
|
|
342
|
+
updateMessage(message: StreamMessage): Promise<StreamMessage>;
|
|
343
|
+
/**
|
|
344
|
+
* Deletes the message from the active channel
|
|
345
|
+
* @param message Message to be deleted
|
|
346
|
+
* @param isLocalDelete set this `true` if you want to delete a message that's only part of the local state, not yet saved on the backend
|
|
347
|
+
*/
|
|
348
|
+
deleteMessage(message: StreamMessage, isLocalDelete?: boolean): Promise<void>;
|
|
349
|
+
/**
|
|
350
|
+
* Uploads files to the channel. If you want to know more about [file uploads](/chat/docs/javascript/file_uploads/) check out the platform documentation.
|
|
351
|
+
* @param uploads the attachments to upload (output of the [`AttachmentService`](/chat/docs/sdk/angular/services/AttachmentService/))
|
|
352
|
+
* @returns the result of file upload requests
|
|
353
|
+
*/
|
|
354
|
+
uploadAttachments(uploads: AttachmentUpload[]): Promise<AttachmentUpload[]>;
|
|
355
|
+
/**
|
|
356
|
+
* Deletes an uploaded file by URL. If you want to know more about [file uploads](/chat/docs/javascript/file_uploads/) check out the platform documentation
|
|
357
|
+
* @param attachmentUpload Attachment to be deleted (output of the [`AttachmentService`](/chat/docs/sdk/angular/services/AttachmentService/))
|
|
358
|
+
*/
|
|
359
|
+
deleteAttachment(attachmentUpload: AttachmentUpload): Promise<void>;
|
|
360
|
+
/**
|
|
361
|
+
* Returns the autocomplete options for current channel members. If member_count is equal to the number of members in the channel, it returns the channel members, otherwise sends a [search request](/chat/docs/javascript/query_members/#pagination-and-ordering) with the given search term.
|
|
362
|
+
* @param searchTerm Text to search for in the names of members
|
|
363
|
+
* @returns The list of members matching the search filter
|
|
364
|
+
*/
|
|
365
|
+
autocompleteMembers(searchTerm: string): Promise<import("stream-chat").ChannelMemberResponse[]>;
|
|
366
|
+
/**
|
|
367
|
+
* [Runs a message action](https://getstream.io/chat/docs/rest/#messages-runmessageaction) in the current channel. Updates the message list based on the action result (if no message is returned, the message will be removed from the message list).
|
|
368
|
+
* @param messageId
|
|
369
|
+
* @param formData
|
|
370
|
+
* @param parentMessageId
|
|
371
|
+
*/
|
|
372
|
+
sendAction(messageId: string, formData: Record<string, string>, parentMessageId?: string): Promise<void>;
|
|
373
|
+
/**
|
|
374
|
+
* Selects or deselects the current message to quote reply to
|
|
375
|
+
* @param message The message to select, if called with `undefined`, it deselects the message
|
|
376
|
+
*/
|
|
377
|
+
selectMessageToQuote(message: StreamMessage | undefined | MessageResponse): void;
|
|
378
|
+
/**
|
|
379
|
+
* Add a new channel to the channel list
|
|
380
|
+
* The channel will be added to the beginning of the channel list
|
|
381
|
+
* @param channel
|
|
382
|
+
*/
|
|
383
|
+
addChannel(channel: Channel): void;
|
|
384
|
+
/**
|
|
385
|
+
*
|
|
386
|
+
* @param cid
|
|
387
|
+
* @param shouldStopWatching
|
|
388
|
+
*/
|
|
389
|
+
removeChannel(cid: string, shouldStopWatching?: boolean): void;
|
|
390
|
+
private sendMessageRequest;
|
|
391
|
+
/**
|
|
392
|
+
* Jumps to the selected message inside the message list, if the message is not yet loaded, it'll load the message (and it's surroundings) from the API.
|
|
393
|
+
* @param messageId The ID of the message to be loaded, 'latest' means jump to the latest messages
|
|
394
|
+
* @param parentMessageId The ID of the parent message if we want to load a thread message
|
|
395
|
+
*/
|
|
396
|
+
jumpToMessage(messageId: string, parentMessageId?: string): Promise<void>;
|
|
397
|
+
/**
|
|
398
|
+
* Clears the currently selected message to jump
|
|
399
|
+
*/
|
|
400
|
+
clearMessageJump(): void;
|
|
401
|
+
/**
|
|
402
|
+
* Pins the given message in the channel
|
|
403
|
+
* @param message
|
|
404
|
+
*/
|
|
405
|
+
pinMessage(message: StreamMessage): Promise<void>;
|
|
406
|
+
/**
|
|
407
|
+
* Removes the given message from pinned messages
|
|
408
|
+
* @param message
|
|
409
|
+
*/
|
|
410
|
+
unpinMessage(message: StreamMessage): Promise<void>;
|
|
411
|
+
private handleNotification;
|
|
412
|
+
private handleRemovedFromChannelNotification;
|
|
413
|
+
private handleNewMessageNotification;
|
|
414
|
+
private handleAddedToChannelNotification;
|
|
415
|
+
private addChannelFromNotification;
|
|
416
|
+
private watchForActiveChannelEvents;
|
|
417
|
+
/**
|
|
418
|
+
* Call this method if user started typing in the active channel
|
|
419
|
+
* @param parentId The id of the parent message, if user is typing in a thread
|
|
420
|
+
*/
|
|
421
|
+
typingStarted(parentId?: string): Promise<void>;
|
|
422
|
+
/**
|
|
423
|
+
* Call this method if user stopped typing in the active channel
|
|
424
|
+
* @param parentId The id of the parent message, if user were typing in a thread
|
|
425
|
+
*/
|
|
426
|
+
typingStopped(parentId?: string): Promise<void>;
|
|
427
|
+
/**
|
|
428
|
+
* The current list of channels
|
|
429
|
+
*/
|
|
430
|
+
get channels(): Channel[];
|
|
431
|
+
/**
|
|
432
|
+
* The current active channel
|
|
433
|
+
*/
|
|
434
|
+
get activeChannel(): Channel | undefined;
|
|
435
|
+
/**
|
|
436
|
+
* The current active channel messages
|
|
437
|
+
*/
|
|
438
|
+
get activeChannelMessages(): (MessageResponse | LocalMessage | StreamMessage)[];
|
|
439
|
+
/**
|
|
440
|
+
* The current thread replies
|
|
441
|
+
*/
|
|
442
|
+
get activeChannelThreadReplies(): (MessageResponse | LocalMessage | StreamMessage)[];
|
|
443
|
+
/**
|
|
444
|
+
* Get the last 1200 reactions of a message in the current active channel. If you need to fetch more reactions please use the [following endpoint](/chat/docs/javascript/send_reaction/#paginating-reactions).
|
|
445
|
+
* @deprecated use [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/services/MessageReactionsService/#queryreactions) instead
|
|
446
|
+
* @param messageId
|
|
447
|
+
* @returns all reactions of a message
|
|
448
|
+
*/
|
|
449
|
+
getMessageReactions(messageId: string): Promise<ReactionResponse[]>;
|
|
450
|
+
/**
|
|
451
|
+
* Marks the channel from the given message as unread
|
|
452
|
+
* @param messageId
|
|
453
|
+
* @returns the result of the request
|
|
454
|
+
*/
|
|
455
|
+
markMessageUnread(messageId: string): Promise<import("stream-chat").APIResponse | null | undefined>;
|
|
456
|
+
private messageUpdated;
|
|
457
|
+
private messageReactionEventReceived;
|
|
458
|
+
private formatMessage;
|
|
459
|
+
private isStreamMessage;
|
|
460
|
+
private isFormatMessageResponse;
|
|
461
|
+
private stopWatchForActiveChannelEvents;
|
|
462
|
+
private queryChannels;
|
|
463
|
+
private watchForChannelEvents;
|
|
464
|
+
private handleNewMessage;
|
|
465
|
+
private handleChannelHidden;
|
|
466
|
+
private handleChannelDeleted;
|
|
467
|
+
private handleChannelVisible;
|
|
468
|
+
private handleChannelUpdate;
|
|
469
|
+
private handleChannelTruncate;
|
|
470
|
+
private get canSendReadEvents();
|
|
471
|
+
private transformToStreamMessage;
|
|
472
|
+
private handleTypingStartEvent;
|
|
473
|
+
private handleTypingStopEvent;
|
|
474
|
+
private updateLatestMessages;
|
|
475
|
+
private setChannelState;
|
|
476
|
+
private markRead;
|
|
477
|
+
private markReadThrottled;
|
|
478
|
+
private flushMarkReadQueue;
|
|
479
|
+
private _init;
|
|
480
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChannelService, never>;
|
|
481
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChannelService>;
|
|
482
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { NgZone } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { Channel, ConnectAPIResponse, OwnUserResponse, StreamChatOptions, UserResponse } from 'stream-chat';
|
|
4
|
+
import { AppSettings, Event, StreamChat, TokenOrProvider } from 'stream-chat';
|
|
5
|
+
import { NotificationService } from './notification.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export type ClientEvent = {
|
|
8
|
+
eventType: string;
|
|
9
|
+
event: Event;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The `ChatClient` service connects the user to the Stream chat.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ChatClientService {
|
|
15
|
+
private ngZone;
|
|
16
|
+
private notificationService;
|
|
17
|
+
/**
|
|
18
|
+
* The [StreamChat client](https://github.com/GetStream/stream-chat-js/blob/master/src/client.ts) instance. In general you shouldn't need to access the client, but it's there if you want to use it.
|
|
19
|
+
*/
|
|
20
|
+
chatClient: StreamChat;
|
|
21
|
+
/**
|
|
22
|
+
* Emits [`ClientEvent`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/chat-client.service.ts) events. The platform documentation covers [the list of client, user presence and notification events](/chat/docs/javascript/event_object/).
|
|
23
|
+
* :::important
|
|
24
|
+
* For performance reasons this Observable operates outside of the Angular change detection zone. If you subscribe to it, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/concepts/change-detection/) explains this in detail.
|
|
25
|
+
* :::
|
|
26
|
+
*/
|
|
27
|
+
events$: Observable<ClientEvent>;
|
|
28
|
+
/**
|
|
29
|
+
* Emits the current [application settings](/chat/docs/javascript/app_setting_overview/). Since getting the application settings is an expensive API call and we don't always need the result, this is not initialized by default, you need to call `getApplicationSettings` to load them.
|
|
30
|
+
*/
|
|
31
|
+
appSettings$: Observable<AppSettings | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Emits the current connection state of the user (`online` or `offline`)
|
|
34
|
+
*/
|
|
35
|
+
connectionState$: Observable<'offline' | 'online'>;
|
|
36
|
+
/**
|
|
37
|
+
* Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](/chat/docs/sdk/angular/code-examples/channel-invites/) guide.
|
|
38
|
+
*/
|
|
39
|
+
pendingInvites$: Observable<Channel[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Emits the current chat user
|
|
42
|
+
*/
|
|
43
|
+
user$: Observable<OwnUserResponse | UserResponse | undefined>;
|
|
44
|
+
private notificationSubject;
|
|
45
|
+
private connectionStateSubject;
|
|
46
|
+
private appSettingsSubject;
|
|
47
|
+
private pendingInvitesSubject;
|
|
48
|
+
private userSubject;
|
|
49
|
+
private subscriptions;
|
|
50
|
+
private trackPendingChannelInvites;
|
|
51
|
+
private appSettingsPromise?;
|
|
52
|
+
constructor(ngZone: NgZone, notificationService: NotificationService);
|
|
53
|
+
/**
|
|
54
|
+
* Creates a [`StreamChat`](https://github.com/GetStream/stream-chat-js/blob/668b3e5521339f4e14fc657834531b4c8bf8176b/src/client.ts#L124) instance using the provided `apiKey`, and connects a user with the given meta data and token. More info about [connecting users](/chat/docs/javascript/init_and_users/) can be found in the platform documentation.
|
|
55
|
+
* @param apiKey
|
|
56
|
+
* @param userOrId you can emit this for anonymous logins
|
|
57
|
+
* @param userTokenOrProvider You can provide:<ul>
|
|
58
|
+
* <li> a token, </li>
|
|
59
|
+
* <li> a token provider, a method that returns `Promise<string>`, which can be called when the previous token expires (recommended setup for production applications)</li>
|
|
60
|
+
* <li> the keyword 'guest' to connect as [guest user](/chat/docs/javascript/authless_users/#guest-users) </li>
|
|
61
|
+
* <li> the keyword 'anonymous' to connect as [anonymous user](/chat/docs/javascript/authless_users/#anonymous-users) </li>
|
|
62
|
+
* </ul>
|
|
63
|
+
* @param clientOptions Setting to provide to the Stream client instance
|
|
64
|
+
*/
|
|
65
|
+
init(apiKey: string, userOrId: string | OwnUserResponse | UserResponse | undefined, userTokenOrProvider: TokenOrProvider, clientOptions?: StreamChatOptions & {
|
|
66
|
+
trackPendingChannelInvites?: boolean;
|
|
67
|
+
}): ConnectAPIResponse;
|
|
68
|
+
/**
|
|
69
|
+
* Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](/chat/docs/sdk/angular/services/ChannelService/#reset/).
|
|
70
|
+
*/
|
|
71
|
+
disconnectUser(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Loads the current [application settings](/chat/docs/javascript/app_setting_overview/), if the application settings have already been loaded, it does nothing.
|
|
74
|
+
*/
|
|
75
|
+
getAppSettings(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Flag the message with the given ID. If you want to know [more about flags](/chat/docs/javascript/moderation/) check out the platform documentation.
|
|
78
|
+
* @param messageId
|
|
79
|
+
*/
|
|
80
|
+
flagMessage(messageId: string): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Searches for users in the application that have ID or name matching the provided search term
|
|
83
|
+
* @param searchTerm
|
|
84
|
+
* @returns The users matching the search
|
|
85
|
+
*/
|
|
86
|
+
autocompleteUsers(searchTerm: string): Promise<UserResponse[]>;
|
|
87
|
+
private updatePendingInvites;
|
|
88
|
+
private updateUser;
|
|
89
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatClientService, never>;
|
|
90
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatClientService>;
|
|
91
|
+
}
|