import { ElementRef, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewContainerRef } from '@angular/core';
import { QdDialogService } from '../dialog/services/dialog.service';
import { QdSectionToolbarActionService } from '../section/services/section-toolbar-action.service';
import { QdFileCollectorConfig } from './models/file-collector-config';
import { QdFileUpload } from './models/file-upload';
import { QdFileCollectorValidationService } from './services/file-collector-validation.service';
import { QdFileCollectorService } from './services/file-collector.service';
import { QdEventBrokerService } from '../core/services/event-broker.service';
import { QdFileTypeService } from './services/file-type.service';
import * as i0 from "@angular/core";
/**
 * **QdFileCollectorComponent** is a flexible component for managing files within an application.
 * It supports uploading, downloading, and displaying files, offering various options for customization and configuration.
 *
 * #### **Features**
 *
 * - **Upload**: Allows users to add new files with restrictions on file type and size.
 * - **Download**: Enables downloads directly via URL or, if needed, through Angular’s `HttpClient`, for example, to support authorization.
 * - **Customizable Error Handling**: Validates file size, type, and name pattern, with customizable error messages for user guidance.
 * - **Read-only Mode**: Disables interactions in read-only mode, allowing only viewing or downloading of files.
 * - **Standalone Enabled**: Detects if used within or outside a QLS section structure and, if outside, enables file uploads in standalone mode.
 *
 * #### **Interactions**
 *
 * File interactions are managed through several key functions:
 *
 * - **upload**: Adds a file to the files list if validation is successful.
 * - **delete**: Opens a confirmation dialog that, if confirmed, removes the file from the list.
 * - **readonly/viewonly**: In read-only or view-only mode, upload and delete functions are disabled, limiting user actions.
 *
 * #### **Standalone Mode**
 *
 * Following Quadrel’s design principles, QdFileCollector includes a standalone mode, allowing it to work independently.
 * It automatically detects when used outside a QLS section structure and, in standalone mode, displays an "Add New" button to support file uploads.
 *
 * #### **File Restrictions**
 *
 * - **allowedFileTypes** and **allowedMimeTypes** should not be used together; using both will trigger an error log.
 * - **maxFileSizeInBytes** sets a maximum file size allowed for uploads.
 * - **allowedFileNamePattern** defines a regex pattern for file names; files that don’t match the pattern are rejected.
 *
 * #### **Error Handling**
 *
 * Upload errors can occur in the following cases:
 * - **Invalid MIME Type**: When the file type is not in `allowedMimeTypes`.
 * - **Invalid File Size**: When the file size exceeds `maxFileSizeInBytes`.
 * - **Invalid File Name Pattern**: When the file name does not match `allowedFileNamePattern`.
 *
 * Error messages can be customized:
 * - **invalidMimeTypeErrorMessageI18n**: Custom message for unsupported MIME types.
 * - **invalidFileNameErrorMessageI18n**: Custom message for unsupported file names.
 *
 * #### **File Manager**
 *
 * QdFileManager is an interface that provides methods for uploading and deleting files.
 * To use it with QdFileCollectorComponent, implement this interface in a custom service and provide it via the `QD_FILE_MANAGER_TOKEN` token.
 * This service enables you to create custom file-handling logic.
 *
 * #### **Usage**
 *
 * ```typescript
 * @Injectable()
 * export class MyFileManager implements QdFileManager {
 *   upload(file: File): Observable<QdUploadProgress> {
 *     // custom implementation here
 *   }
 *
 *   delete(collectedFile: QdCollectedFile): Observable<boolean> {
 *     // custom implementation here
 *   }
 * }
 *
 * @Component({
 *   selector: 'my-file-collector',
 *   providers: [
 *     {
 *       provide: QD_FILE_MANAGER_TOKEN,
 *       useClass: MyFileManager
 *     }
 *   ]
 * })
 * class MyFileCollectorComponent {
 *   fileCollectorConfig: QdFileCollectorConfig = {
 *     // configuration options here
 *   };
 * }
 * ```
 *
 * ```html
 * <qd-file-collector [config]="fileCollectorConfig"></qd-file-collector>
 * ```
 */
export declare class QdFileCollectorComponent implements OnInit, OnChanges, OnDestroy {
    private readonly sectionActionService;
    private readonly eventBroker;
    private readonly fileCollectorService;
    private readonly fileCollectorValidationService;
    private readonly fileTypeService;
    private readonly dialogService;
    private readonly viewContainerRef;
    /**
     * Configuration settings for the file collector.
     */
    config: QdFileCollectorConfig;
    /**
     * Static test ID for integration testing.
     */
    testId: string;
    fileInput: ElementRef;
    private _subscriptions;
    private readonly _viewonly$;
    get fileUploads(): QdFileUpload[];
    get canShowAddButton(): boolean;
    constructor(sectionActionService: QdSectionToolbarActionService, eventBroker: QdEventBrokerService, fileCollectorService: QdFileCollectorService, fileCollectorValidationService: QdFileCollectorValidationService, fileTypeService: QdFileTypeService, dialogService: QdDialogService, viewContainerRef: ViewContainerRef);
    ngOnInit(): void;
    ngOnChanges(changes: SimpleChanges): void;
    ngOnDestroy(): void;
    handleFiles(event: any): void;
    clickFileInput(): void;
    private initializeConfig;
    private validateConfig;
    private hasIncompatibleFileTypeSettings;
    private initViewMode;
    private isConfigConsistentWithAllowedFileTypes;
    private logError;
    static ɵfac: i0.ɵɵFactoryDeclaration<QdFileCollectorComponent, [{ optional: true; }, { optional: true; }, null, null, null, null, null]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<QdFileCollectorComponent, "qd-file-collector", never, { "config": { "alias": "config"; "required": false; }; "testId": { "alias": "data-test-id"; "required": false; }; }, {}, never, never, false, never>;
}
//# sourceMappingURL=file-collector.component.d.ts.map