import { BehaviorSubject, Observable } from 'rxjs';
import { Attachment } from 'stream-chat';
import { ChannelService } from './channel.service';
import { NotificationService } from './notification.service';
import { AttachmentUpload, AudioRecording, DefaultStreamChatGenerics } from './types';
import { ChatClientService } from './chat-client.service';
import { MessageService } from './message.service';
import * as i0 from "@angular/core";
/**
 * The `AttachmentService` manages the uploads of a message input.
 *
 * You can read more about [uploads](/chat/docs/javascript/file_uploads/) in the Stream API documentation. You can use Stream's API or the dashboard to customize the [file](/chat/docs/javascript/app_setting_overview/#file-uploads) and [image upload](/chat/docs/javascript/app_setting_overview/#image-uploads) configuration.
 */
export declare class AttachmentService<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> {
    private channelService;
    private notificationService;
    private chatClientService;
    private messageService;
    /**
     * Emits the number of uploads in progress.
     *
     * You can increment and decrement this counter if you're using custom attachments and want to disable message sending until all attachments are uploaded.
     *
     * The SDK will handle updating this counter for built-in attachments, but for custom attachments you should take care of this.
     */
    attachmentUploadInProgressCounter$: BehaviorSubject<number>;
    /**
     * Emits the state of the uploads ([`AttachmentUpload[]`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)), it adds a state (`success`, `error` or `uploading`) to each file the user selects for upload. It is used by the [`AttachmentPreviewList`](/chat/docs/sdk/angular/components/AttachmentPreviewListComponent/) to display the attachment previews.
     */
    attachmentUploads$: Observable<AttachmentUpload[]>;
    /**
     * You can get and set the list if uploaded custom attachments
     *
     * By default the SDK components won't display these, but you can provide your own `customAttachmentPreviewListTemplate$` and `customAttachmentListTemplate$` for the [`CustomTemplatesService`](/chat/docs/sdk/angular/services/CustomTemplatesService/).
     */
    customAttachments$: BehaviorSubject<Attachment<T>[]>;
    /**
     * The current number of attachments
     */
    attachmentsCounter$: Observable<number>;
    /**
     * The maximum number of attachments allowed for a message.
     *
     * The maximum is 30, you can set it to lower, but not higher.
     */
    maxNumberOfAttachments: number;
    private attachmentUploadsSubject;
    private appSettings;
    private attachmentLimitNotificationHide?;
    constructor(channelService: ChannelService, notificationService: NotificationService, chatClientService: ChatClientService, messageService: MessageService);
    /**
     * Resets the attachments uploads (for example after the message with the attachments sent successfully)
     */
    resetAttachmentUploads(): void;
    /**
     * Upload a voice recording
     * @param audioRecording
     * @returns A promise with true or false. If false is returned the upload was canceled because of a client side error. The error is emitted via the `NotificationService`.
     */
    uploadVoiceRecording(audioRecording: AudioRecording): Promise<boolean>;
    /**
     * Uploads the selected files, and creates preview for image files. The result is propagated throught the `attachmentUploads$` stream.
     * @param fileList The files selected by the user, if you have Blobs instead of Files, you can convert them with this method: https://developer.mozilla.org/en-US/docs/Web/API/File/File
     * @returns A promise with true or false. If false is returned the upload was canceled because of a client side error. The error is emitted via the `NotificationService`.
     */
    filesSelected(fileList: FileList | File[] | null): Promise<boolean | undefined>;
    /**
     * You can add custom `image`, `video` and `file` attachments using this method.
     *
     * Note: If you just want to use your own CDN for file uploads, you don't necessary need this method, you can just specify you own upload function in the [`ChannelService`](/chat/docs/sdk/angular/services/ChannelService/)
     * @param attachment
     */
    addAttachment(attachment: Attachment<T>): void;
    /**
     * Retries to upload an attachment.
     * @param file
     * @returns A promise with the result
     */
    retryAttachmentUpload(file: File): Promise<void>;
    /**
     * Deletes an attachment, the attachment can have any state (`error`, `uploading` or `success`).
     * @param upload
     */
    deleteAttachment(upload: AttachmentUpload): Promise<void>;
    /**
     * Maps the current uploads to a format that can be sent along with the message to the Stream API.
     * @returns the attachments
     */
    mapToAttachments(): Attachment[];
    /**
     * Maps attachments received from the Stream API to uploads. This is useful when editing a message.
     * @param attachments Attachemnts received with the message
     */
    createFromAttachments(attachments: Attachment<T>[]): void;
    private createPreview;
    private uploadAttachments;
    private areAttachmentsHaveValidExtension;
    private areAttachmentsHaveValidSize;
    private isWithinLimit;
    static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentService<any>, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AttachmentService<any>>;
}
