import { AfterViewInit, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, Type } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { Attachment, DraftMessagePayload, DraftResponse, UserResponse } from 'stream-chat'; import { AttachmentService } from '../attachment.service'; import { ChannelService } from '../channel.service'; import { NotificationService } from '../notification.service'; import { AttachmentPreviewListContext, AttachmentUpload, AudioRecording, CustomAttachmentUploadContext, EmojiPickerContext, MessageTextContext, StreamMessage } from '../types'; import { MessageInputConfigService } from './message-input-config.service'; import { TextareaInterface } from './textarea.interface'; import { EmojiInputService } from './emoji-input.service'; import { CustomTemplatesService } from '../custom-templates.service'; import { MessageActionsService } from '../message-actions.service'; import { VoiceRecorderService } from './voice-recorder.service'; import { AudioRecorderService } from '../voice-recorder/audio-recorder.service'; import * as i0 from "@angular/core"; /** * The `MessageInput` component displays an input where users can type their messages and upload files, and sends the message to the active channel. The component can be used to compose new messages or update existing ones. To send messages, the chat user needs to have the necessary [channel capability](/chat/docs/javascript/channel_capabilities/). */ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit { private channelService; private notificationService; readonly attachmentService: AttachmentService; private configService; private textareaType; private componentFactoryResolver; private cdRef; private emojiInputService; readonly customTemplatesService: CustomTemplatesService; private messageActionsService; readonly voiceRecorderService: VoiceRecorderService; audioRecorder?: AudioRecorderService | undefined; /** * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](/chat/docs/javascript/channel_capabilities/). If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService/). */ isFileUploadEnabled: boolean | undefined; /** * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](/chat/docs/sdk/angular/concepts/opt-in-architecture/) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService/). */ areMentionsEnabled: boolean | undefined; /** * The scope for user mentions, either members of the current channel of members of the application. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService/). */ mentionScope: 'channel' | 'application' | undefined; /** * Determines if the message is being dispalyed in a channel or in a [thread](/chat/docs/javascript/threads/). */ mode: 'thread' | 'main'; /** * If true, users can select multiple files to upload. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService/). */ isMultipleFileUploadEnabled: boolean | undefined; /** * The message to edit */ message: StreamMessage | undefined; /** * An observable that can be used to trigger message sending from the outside */ sendMessage$: Observable | undefined; /** * In `desktop` mode the `Enter` key will trigger message sending, in `mobile` mode the `Enter` key will insert a new line to the message input. If no value is provided, it is set from the [`MessageInputConfigService`](/chat/docs/sdk/angular/services/MessageInputConfigService/). */ inputMode: 'desktop' | 'mobile'; /** * Enables or disables auto focus on the textarea element */ autoFocus: boolean; /** * By default the input will react to changes in `messageToEdit$` from [`MessageActionsService`](/chat/docs/sdk/angular/services/MessageActionsService/) and display the message to be edited (taking into account the current `mode`). * * If you don't need that behavior, you can turn this of with this flag. In that case you should create your own edit message UI. */ watchForMessageToEdit: boolean; /** * Use this input to control wether a send button is rendered or not. If you don't render a send button, you can still trigger message send using the `sendMessage$` input. */ displaySendButton: boolean; /** * You can enable/disable voice recordings with this input */ displayVoiceRecordingButton: boolean; /** * You can enable/disable polls with this input */ displayPollCreateButton: boolean; /** * Emits when a message was successfuly sent or updated */ readonly messageUpdate: EventEmitter<{ message: StreamMessage; }>; /** * Emits the messsage draft whenever the composed message changes. * - If the user clears the message input, or sends the message, undefined is emitted. * - If active channel changes, nothing is emitted. * * To save and fetch message drafts, you can use the [Stream message drafts API](https://getstream.io/chat/docs/javascript/drafts/). * * Message draft only works for new messages, nothing is emitted when input is in edit mode (if `message` input is set). * * To load a message draft into the input, use the `loadDraft` method. * - If channel id doesn't match the active channel id, the draft is ignored. * - If a thread message is loaded, and the input isn't in thread mode or parent ids don't match, the draft is ignored. */ readonly messageDraftChange: EventEmitter; voiceRecorderRef: TemplateRef<{ service: VoiceRecorderService; }> | undefined; class: string; isVoiceRecording: boolean; isFileUploadAuthorized: boolean | undefined; canSendLinks: boolean | undefined; canSendMessages: boolean | undefined; canSendPolls: boolean | undefined; attachmentUploads$: Observable; customAttachments$: Observable; attachmentUploadInProgressCounter$: Observable; textareaValue: string; textareaRef: ComponentRef> | undefined; mentionedUsers: UserResponse[]; quotedMessage: undefined | StreamMessage; typingStart$: Subject; cooldown$: Observable | undefined; isCooldownInProgress: boolean; emojiPickerTemplate: TemplateRef | undefined; customAttachmentUploadTemplate: TemplateRef | undefined; attachmentPreviewListTemplate: TemplateRef | undefined; textareaPlaceholder: string; fileInputId: string; isComposerOpen: boolean; private fileInput; private textareaAnchor; private subscriptions; private hideNotification; private isViewInited; private channel; private sendMessageSubcription; private readonly defaultTextareaPlaceholder; private readonly slowModeTextareaPlaceholder; private messageToEdit?; private pollId; private isChannelChangeResetInProgress; private isSendingMessage; private isLoadingDraft; constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef, emojiInputService: EmojiInputService, customTemplatesService: CustomTemplatesService, messageActionsService: MessageActionsService, voiceRecorderService: VoiceRecorderService, audioRecorder?: AudioRecorderService | undefined); ngOnInit(): void; ngAfterViewInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; messageSent(): Promise; get containsLinks(): boolean; get quotedMessageAttachments(): Attachment[]; get disabledTextareaText(): "" | "streamChat.You can't send thread replies in this channel" | "streamChat.You can't send messages in this channel"; itemsPasted(event: ClipboardEvent): void; filesSelected(fileList: FileList | null): Promise; deselectMessageToQuote(): void; deselectMessageToEdit(): void; getEmojiPickerContext(): EmojiPickerContext; getAttachmentPreviewListContext(): AttachmentPreviewListContext; getAttachmentUploadContext(): CustomAttachmentUploadContext; getQuotedMessageTextContext(): MessageTextContext; startVoiceRecording(): Promise; openPollComposer(): void; closePollComposer: () => void; addPoll: (pollId: string) => void; userMentionsChanged(userMentions: UserResponse[]): void; updateMessageDraft(): void; voiceRecordingReady(recording: AudioRecording): Promise; get isUpdate(): boolean; /** * * @param draft DraftResponse to load into the message input. * - Draft messages are only supported for new messages, input is ignored in edit mode (if `message` input is set). * - If channel id doesn't match the active channel id, the draft is ignored. * - If a thread message is loaded, and the input isn't in thread mode or parent ids don't match, the draft is ignored. */ loadDraft(draft: DraftResponse): void; private deleteUpload; private retryUpload; private clearFileInput; private initTextarea; private setCanSendMessages; private get parentMessageId(); private startCooldown; private stopCooldown; private checkIfInEditMode; private messageToUpdateChanged; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }