import { EventEmitter, InjectionToken, OnDestroy, OnInit } from '@angular/core';
import { FormBuilder, ValidatorFn } from '@angular/forms';
import { AggregationOption, AggregationOptionStatus, AggregationService, GainsightService } from '@c8y/ngx-components';
import { DatapointsExceedingLimit, DateFetchConfig, ExportConfig, ExportData, FileExportConfig, FileGenerator, FileTypeMetadata } from '../../datapoints-export-selector.model';
import { DataFetchingService } from './data-fetching.service';
import { DataProcessingService } from './data-processing.service';
import { DatapointsExportSelectorFileExporterService } from './datapoints-export-selector-file-exporter.service';
import * as i0 from "@angular/core";
export declare const FILE_GENERATORS: InjectionToken<FileGenerator[]>;
export declare const dateRangeValidator: ValidatorFn;
export declare class DatapointsExportSelectorFileExporterComponent implements OnInit, OnDestroy {
    private aggregationService;
    private datapointsExportModalService;
    private datapointsExportSelectorFileExporterService;
    private dataFetchingService;
    private formBuilder;
    private generators;
    private gainsightService;
    exportConfig: ExportConfig;
    onDownloadButtonStateChange: EventEmitter<boolean>;
    /**
     * Represents aggregation selector options that are disabled.
     * This state is determined based on the current date range.
     */
    disabledAggregationOptions: AggregationOptionStatus;
    formGroup: ReturnType<DatapointsExportSelectorFileExporterComponent['createForm']>;
    /**
     * Contains all datapoints that number of records exceeds a threshold, where data for these datapoints will be processed by the backend.
     * Applies only to measurement API which can return processed CSV, Excel or XML data.
     */
    datapointsExceedingBrowserDownloadLimit: DatapointsExceedingLimit[];
    /**
     * Indicates whether any of DataToExport objects timeValueMap property is not undefined (series data)
     * or dataPointToExport is not undefined at all (measurement data).
     */
    hasFetchedDataAnyValuesToExport: boolean;
    /**
     * Indicates if there is no exportable data because the date range of all selected datapoints exceeds 1,000,000 records.
     */
    hasNoExportableData: boolean;
    hasPermissionToReadAnyMeasurements: boolean;
    isPreviewLoading: boolean;
    /**
     * Indicates whether the full or compact type of export is selected.
     * Full type of export is based on measurement API data.
     * Compact type of export is based on series API data.
     */
    isFullTypeOfExport: boolean;
    previewTableData: ExportData[];
    limitExceededMessage: string;
    /**
     * Contains processed data that is prepared to be exported if series data was fetched
     * or shown in the preview table in case of measurements data.
     */
    private dataToExport;
    /**
     * Contains a list of datapoints that selected date range exceeds API limit of 1_000_000 records.
     */
    private dataPointsExceedingOneMillionLimit;
    /**
     * Represents the state of file type selection checkboxes.
     */
    private fileTypeSelectionState;
    /**
     * Hold the initial state of the aggregation from the export config.
     * Value will be loaded on component destroy.
     */
    private initialAggregation;
    /**
     * Hold the initial state of the dateFrom from the export config.
     * Value will be loaded on component destroy.
     */
    private initialDateFrom;
    /**
     * Hold the initial state of the dateTo from the export config.
     * Value will be loaded on component destroy.
     */
    private initialDateTo;
    /**
     * Hold the initial state of the datapointDetails from the export config.
     * Some logic may filter out datapoints in datapointDetails array, that exceeds 1_000_000 limit for measurements API,
     * but full list is still needed when component is reopened.
     * Value will be loaded on component destroy.
     */
    private initialDatapointDetails;
    /**
     * Indicates whether the aggregation value was changed programmatically.
     * It prevents a case where fetching may be triggered twice when export type is changed.
     * Both options alone can trigger fetching data.
     */
    private isAggregationChangedProgrammatically;
    /**
     * Indicates whether any of the export file types (CSV, Excel) are checked.
     */
    private isAnyOfExportFileTypeChecked;
    private dateFromSubject;
    private dateToSubject;
    private destroy$;
    dynamicFilesTypeMetadata: {
        [key: string]: FileTypeMetadata;
    };
    constructor(aggregationService: AggregationService, datapointsExportModalService: DataProcessingService, datapointsExportSelectorFileExporterService: DatapointsExportSelectorFileExporterService, dataFetchingService: DataFetchingService, formBuilder: FormBuilder, generators: FileGenerator[], gainsightService: GainsightService);
    setFilesType(generators: FileGenerator[]): void;
    ngOnInit(): Promise<void>;
    ngOnDestroy(): void;
    exportAndDownload(): Promise<void>;
    getOnlySelectedFileExports(fileExports: FileExportConfig[]): FileExportConfig[];
    exportFile(fileType: string): Promise<Blob | null>;
    downloadFile(blob: Blob | null, fileType: string, measurementsZipFileName: string): Promise<void>;
    /**
     * Exports a measurement file of the specified type.
     *
     * Measurements API does provide a way to fetch a preprocessed CSV/Excel file.
     *
     * At this point a backed file needs to be fetched.
     * Measurement data used for a preview contains just 5 first records
     * and it's not fetched with CSV/Excel headers.
     *
     * @param fileType - The type of file to export.
     * @returns A Promise that resolves to a Blob representing the exported file or null when no data to export or it's sent via email.
     */
    exportMeasurementFile(fileType: string): Promise<Blob> | null;
    excludeDatapointsThatExceedsApiLimit(exportConfig: ExportConfig): ExportConfig;
    /**
     * Exports the series data to a file of the specified type.
     *
     * Series API does not provide a way to fetch a preprocessed CSV/Excel file.
     *
     * Series data used for exporting a file is already fetched for a preview
     * and can be reused for exporting.
     *
     * @param fileType - The type of file to export (e.g., CSV, Excel).
     * @returns A Promise that resolves to a Blob representing the exported file.
     */
    exportSeriesFile(fileType: string): Promise<Blob>;
    onAggregationChange(newAggregation: AggregationOption): Promise<void>;
    onDateFromChange(updatedDate: string): void;
    onDateToChange(updatedDate: string): void;
    updateDateAndFetchData(dateType: 'dateFrom' | 'dateTo', dateInfo: DateFetchConfig): Promise<void>;
    onExportTypeChange(exportType: string): Promise<void>;
    private updateDisabledAggregationOptions;
    private createForm;
    private preparePreview;
    private handleDateSelectorChanges;
    private handleExportModeChanges;
    private handleFileTypeSelectionChanges;
    private updateFileTypeSelectionState;
    private handleFormValidationChanges;
    private updateFileTypeControl;
    private determineShowingPreviewOrEmptyState;
    private determineIfMeasurementResponseWillBeProcessedByBackend;
    private calculateDatapointCounts;
    private storeInitialChangeableConfig;
    private loadInitialChangeableConfig;
    private loadExportData;
    private updateDownloadButtonState;
    private resetFullExportRelatedProperties;
    private getInitialSelection;
    /**
     * Adjusts both "from" and "to" dates when either is updated:
     * - Resets seconds to 00 even when only one date changes
     * - Prevents persisting hidden seconds ≠ 00 from initial load
     * - Triggers data fetch
     *
     * Example:
     * When user changes "from" date:
     * Input: startDate = "2024-03-26 13:30:45", endDate = "2024-03-27 15:20:45"
     * Result: startDate -> "2024-03-26 14:30:00", endDate -> "2024-03-27 15:20:00"
     *
     * When user changes "to" date:
     * Input: startDate = "2024-03-26 14:30:45", endDate = "2024-03-27 15:20:45"
     * Result: startDate -> "2024-03-26 14:30:00", endDate -> "2024-03-27 16:20:00"
     *
     * @param startDate - The "start" date to be adjusted.
     * @param endDate - The "end" date to be adjusted.
     */
    private update;
    private triggerGainsightDownloadEvent;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatapointsExportSelectorFileExporterComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DatapointsExportSelectorFileExporterComponent, "c8y-datapoints-export-selector-file-exporter", never, { "exportConfig": { "alias": "exportConfig"; "required": false; }; }, { "onDownloadButtonStateChange": "onDownloadButtonStateChange"; }, never, never, true, never>;
}
//# sourceMappingURL=datapoints-export-selector-file-exporter.component.d.ts.map