import { CreateExportAsyncJobRequest, ExportAsyncJob, ExportQueryV2 as QueryV2 } from '@wix/bex-utils/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/types';
import { WixPatternsEssentials, ComputedQueryFull, FiltersMap, ShowToast, TaskStatus, PatternsErrorHandler } from '../../model';
import { WixPatternsMonitor, PartialWindow, ReportBI, Translate } from '../../services';
import { CollectionState } from '../CollectionState';
import { TypedEmitter } from '../../util';
import { ExportStateBIReporter } from './ExportStateBIReporter';
import { ModalState } from '../ModalState';
import { ExportJobStateParams } from './ExportJobState';
import { OnlineState } from '../OnlineState';
import { CollectionPageState } from '../CollectionPageState';
interface ExportPublicState<T, F extends FiltersMap> {
    platformizedQuery: QueryV2;
    wixPatternsQuery: ComputedQueryFull<F>;
    selectedItems?: string[];
    isSelectAll: boolean;
    uncheckedValues?: T[];
}
export type CustomTotalFn<T, F extends FiltersMap> = (params: ExportPublicState<T, F> & {
    collectionTotalPromise: number | null | Promise<number | null | undefined>;
}) => number | null | undefined | Promise<number | null | undefined>;
export type TransformQuery<T, F extends FiltersMap> = (params: ExportPublicState<T, F>) => QueryV2 | Promise<QueryV2>;
export type SaveAsFn<T, F extends FiltersMap> = (params: ExportPublicState<T, F>) => string;
export interface ExportStateProps<T, F extends FiltersMap> {
    transformPlatformizedQuery?: TransformQuery<T, F>;
    differentQueryEndpointThanCollection?: boolean;
    customTotal?: CustomTotalFn<T, F>;
    createExportAsyncJobRequest: Partial<CreateExportAsyncJobRequest>;
    saveAs?: SaveAsFn<T, F>;
    httpClient: WixPatternsEssentials['httpClient'];
    errorHandler: PatternsErrorHandler;
    showToast?: ShowToast;
    translate: Translate;
    collection: CollectionState<T, F>;
    reportBi: ReportBI;
    onlineState: OnlineState;
    internalMonitor: WixPatternsMonitor;
    exportModalState: ModalState;
    collectionPageState: CollectionPageState;
    window: PartialWindow;
}
export type SelectedExportOption = 'all' | 'selected' | 'filtered';
export declare class ExportState<T, F extends FiltersMap> {
    exportStatus: TaskStatus<ExportAsyncJob, unknown>;
    readonly config: {
        pollingDelay: number;
        stateJob: {
            maxPolling: number;
            maxRetries: number;
        };
        queryJobRetries: {
            delay: number;
            max: number;
        };
    };
    exportStartTime: number;
    totalForExport: number | undefined | null;
    selectedExportOption: SelectedExportOption;
    disabledRadios: SelectedExportOption[];
    maybeToast?: {
        remove: () => void;
    };
    iterationsCountPoll: {
        iterationsCount?: number;
        pollCount: number;
        retries: number;
    };
    queryJobRetries: {
        count: number;
    };
    readonly differentQueryEndpointThanCollection: boolean | undefined;
    readonly customTotal: CustomTotalFn<T, F> | undefined;
    readonly translate: Translate;
    readonly createExportAsyncJobRequest: Partial<CreateExportAsyncJobRequest>;
    readonly saveAs: SaveAsFn<T, F> | undefined;
    readonly window: PartialWindow;
    readonly httpClient: WixPatternsEssentials['httpClient'];
    readonly errorHandler: PatternsErrorHandler;
    readonly onlineState: OnlineState;
    readonly exportModalState: ModalState;
    readonly collectionPageState: CollectionPageState;
    readonly transformPlatformizedQuery?: ExportStateProps<T, F>['transformPlatformizedQuery'];
    readonly showToast: ShowToast | undefined;
    readonly internalMonitor: WixPatternsMonitor;
    readonly collection: CollectionState<T, F>;
    readonly reportBi: ReportBI;
    readonly bi: ExportStateBIReporter<T, F>;
    readonly events: TypedEmitter<{
        afterJobCreated: (params: {
            job: ExportAsyncJob;
        }) => unknown;
        undoCancel: () => unknown;
        online: () => unknown;
    }>;
    counter: number;
    absoluteCounter: number;
    retries: number;
    constructor(props: ExportStateProps<T, F>);
    get isModalOpen(): boolean;
    currentStep: 'config' | 'progress' | 'error' | 'cancel';
    get isExporting(): boolean;
    _cancelJob(): void;
    _reset(): void;
    onExportTypeChange(selectedExportOption: SelectedExportOption): void;
    init(): () => void;
    get hasFilters(): boolean;
    get hasSelectedRows(): boolean;
    get isAllSelected(): boolean;
    get totalForExportMap(): {
        selected: number;
        filtered: number | null;
    };
    readonly totalForExportGettersMap: {
        selected: () => number;
        filtered: () => number | null;
        all: () => Promise<number | null | undefined>;
    };
    setTotalForExport(params: ExportPublicState<T, F>): Promise<void>;
    onCancelClick(): void;
    onCancelExportVerifyButtonClick(): void;
    onCancelExportGoBackButtonClick(): void;
    onCancelExportCloseButtonClick(): void;
    onExportCloseAttemptClick(): void;
    onExportSecondaryActionAttempt(): void;
    onCloseClick(): void;
    onExportToClick(): Promise<void>;
    beforeunload: (e: BeforeUnloadEvent) => void;
    onRetryExportToClick(): Promise<void>;
    onFailedClose(): Promise<void>;
    onFailedCancel(): Promise<void>;
    _onJobSuccess(job: ExportAsyncJob, params: ExportJobStateParams): Promise<void>;
    _throwJobError(job: ExportAsyncJob, { onExportEnd, query }: ExportJobStateParams): void;
    _checkIfStaleJob(job: ExportAsyncJob, { onExportEnd, query }: ExportJobStateParams): "restarted" | undefined;
    _updateAbsoluteCounter(job: ExportAsyncJob, { query }: ExportJobStateParams): void;
    _updateJobProgress(job: ExportAsyncJob, params: ExportJobStateParams): void;
    private _poll;
    private _exportTo;
}
export {};
//# sourceMappingURL=ExportState.d.ts.map