import { EventEmitter, TemplateRef } from '@angular/core';
import { IManagedObject } from '@c8y/client';
import { ISelectModalObject, ISelectModalOption, IUpdateItemEvent, ModalLabels, ModalSelectionMode, ProductExperienceEvent, ProductExperienceEventSource } from '@c8y/ngx-components';
import { TranslateService } from '@ngx-translate/core';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { FilterCriteria, RepositoryBinary, RepositoryCategory, RepositoryType, SelectedRepositoryBinary } from '../repository.model';
import { RepositoryService } from '../repository.service';
import * as i0 from "@angular/core";
/**
 * RepositorySelectModalComponent displays repository entries options and allows to select them.
 *
 * ```typescript
 * import { take } from 'rxjs/operators';
 * import { RepositorySelectModalComponent, ModalSelectionMode, RepositoryType } from '@c8y/ngx-components/repository/shared';
 *
 * const initialState = {
 *   repositoryType: RepositoryType.FIRMWARE,
 *   title: gettext('Install firmware'),
 *   subTitle: gettext('Available firmwares matching the device type'),
 *   icon: 'c8y-firmware',
 *   mode: ModalSelectionMode.SINGLE,
 *   labels: { ok: gettext('Install') },
 *   disableSelected: false
 * };
 *
 * const modal = this.bsModal.show(RepositorySelectModalComponent, {
 *   ignoreBackdropClick: true,
 *   initialState
 * });
 *
 * modal.content.load.next();
 * modal.content.resultEmitter.pipe(take(1)).subscribe((firmware) => {
 * })
 * ```
 */
export declare class RepositorySelectModalComponent implements ProductExperienceEventSource {
    private repositoryService;
    private translateService;
    PRODUCT_EXPERIENCE: {
        readonly SOFTWARE: {
            readonly EVENTS: {
                readonly REPOSITORY: "softwareRepository";
                readonly DEVICE_TAB: "deviceSoftware";
            };
            readonly COMPONENTS: {
                readonly ADD_SOFTWARE_MODAL: "add-software-modal";
                readonly DEVICE_SOFTWARE_CHANGES: "device-software-changes";
                readonly DEVICE_SOFTWARE_LIST: "device-software-list";
            };
            readonly ACTIONS: {
                readonly APPLY_SOFTWARE_CHANGES: "applySoftwareChanges";
                readonly CLEAR_SOFTWARE_CHANGES: "clearSoftwareChanges";
                readonly OPEN_INSTALL_SOFTWARE: "openInstallSoftwareModal";
                readonly OPEN_UPDATE_SOFTWARE: "openUpdateSoftwareModal";
                readonly DELETE_SOFTWARE: "deleteSoftware";
            };
            readonly RESULTS: {
                readonly ADD_SOFTWARE: "addSoftware";
                readonly ADD_SOFTWARE_VERSION: "addSoftwareVersion";
                readonly EDIT_SOFTWARE: "editSoftware";
            };
        };
        readonly FIRMWARE: {
            readonly EVENTS: {
                readonly REPOSITORY: "firmwareRepository";
                readonly DEVICE_TAB: "deviceFirmware";
            };
            readonly COMPONENTS: {
                readonly ADD_FIRMWARE_MODAL: "add-firmware-modal";
                readonly ADD_FIRMWAR_PATCH_MODAL: "add-firmware-patch-modal";
                readonly FIRMWARE_DEVICE_TAB: "firmware-device-tab";
                readonly DEVICE_FIRMWARE_LIST: "device-firmware-list";
            };
            readonly ACTIONS: {
                readonly OPEN_INSTALL_FIRMWARE_DIALOG: "openInstallFirmwareDialog";
                readonly OPEN_REPLACE_FIRMWARE_DIALOG: "openReplaceFirmwareDialog";
                readonly OPEN_INSTALL_FIRMWARE_PATCH_DIALOG: "openInstallFirmwarePatchDialog";
            };
            readonly RESULTS: {
                readonly ADD_FIRMWARE: "addFirmware";
                readonly ADD_FIRMWARE_VERSION: "addFirmwareVersion";
                readonly ADD_FIRMWARE_PATCH: "addFirmwarePatch";
                readonly EDIT_FIRMWARE: "editFirmware";
                readonly CREATE_FIRMWARE_UPDATE_OPERATION: "createFirmwareUpdateOperation";
            };
        };
        readonly SHARED: {
            readonly COMPONENTS: {
                readonly REPOSITORY_SELECT_MODAL: "repository-select-modal";
                readonly SELECT_CONFIGURATION_MODAL: "select-configuration-modal";
            };
        };
    };
    /**
     * Optional
     * Allows to provide custom data.
     * ```typescript
     * import { from } from 'rxjs';
     *
     * const repositoryEntry = { name: 'ExampleEntry', type: 'c8y_Firmware' };
     * const versions = [{ c8y_Firmware: { version: '1.0.0', url: 'http://example.com' } }];
     *
     * const initialState = {repositoryEntriesWithVersions$: from({ ...repositoryEntry, versions })};
     * ```
     */
    repositoryEntriesWithVersions$: Observable<IManagedObject[]>;
    /**
     * Repository entry type.
     */
    repositoryType: RepositoryType.FIRMWARE | RepositoryType.SOFTWARE;
    /**
     * Optional
     * Allows to use custom badges templates.
     * ```typescript
     * import { gettext } from '@c8y/ngx-components';
     *
     * const badgeTemplates = { '=1': gettext('{{count}} version'), other: gettext('{{count}} versions') };
     * const initialState = { badgeTemplates };
     * ```
     */
    badgeTemplates: {
        '=1': "{{count}} version";
        other: "{{count}} versions";
    };
    /**
     * Optional
     * Allows to provide custom modal title.
     */
    title: string;
    /**
     * Optional
     * Allows to provide custom modal subtitle.
     */
    subTitle: string;
    /**
     * Loads the content of the modal.
     * Must be invoked by the modal's caller.
     */
    load: Subject<void>;
    /**
     * Triggers an update of the item list emitted.
     */
    updateInstallableList$: Subject<IUpdateItemEvent<any>>;
    /**
     * Optional
     * Emits a filter criteria object currently entered in the filter input.
     * Use it to filter the items if you use custom repositoryEntriesWithVersions$.
     */
    searchTerm: BehaviorSubject<FilterCriteria>;
    /**
     * Optional
     * Allows to provide device type query to restrict search criteria.
     * Only takes effect when repositoryEntriesWithVersions$ is not provided,
     * otherwise modal's caller have to provide already filtered data in the repositoryEntriesWithVersions$.
     */
    deviceTypeQuery: any;
    /**
     * Optional
     * Allows to provide query to restrict search criteria.
     * Only takes effect when repositoryEntriesWithVersions$ is not provided,
     * otherwise modal's caller have to provide already filtered data in the repositoryEntriesWithVersions$.
     */
    searchQuery: any;
    /**
     * Optional
     * Allows to provide custom labels for the buttons responsible for confirm/dismiss modal actions.
     */
    labels: ModalLabels;
    /**
     * Optional
     * Allows to hide the name filter input field.
     * By default, the filter input field is displayed.
     */
    showFilter: boolean;
    /**
     * Optional
     * Allows to show a warning that the search criteria should be narrowed down.
     * By default, this warning is hidden.
     */
    areMoreEntries: boolean;
    /**
     * Optional
     * Allows to display a more specific than the default message in case there are no items to display.
     */
    noItemsMessage: string;
    /**
     * Optional
     * Allows to pass the array of items. Each item from this array will be marked as selected in the modal.
     */
    selected: SelectedRepositoryBinary[];
    /**
     * Emits whenever a new repository binary have been selected in the modal.
     */
    onChoiceUpdated: EventEmitter<ISelectModalObject>;
    /**
     * Emits the list of selected options.
     */
    resultEmitter: EventEmitter<SelectedRepositoryBinary[]>;
    /**
     * Optional
     * Allows to change selection mode.
     * Supported options:
     *   * single: only single option can be selected.
     *   * multiple: multiple options can be selected.
     */
    mode: ModalSelectionMode;
    /**
     * Optional
     * Allows to use custom icon in the modal header.
     */
    icon: string;
    /**
     * Allows to block selection of the other versions from the same repository entry.
     */
    disableSelected: boolean;
    /**
     * Allows to hide items that have no options available.
     */
    hideEmptyItems: boolean;
    filterCriteria: FilterCriteria;
    repositoryEntries$: Observable<ISelectModalObject[]>;
    modalEntries: Observable<ISelectModalObject[]>;
    /**
     * Optional
     * Allows to provide additional template that will be rendered in the
     * filters block on top of the results list in the select modal.
     */
    additionalFilterTemplate: TemplateRef<any>;
    productExperienceEvent: ProductExperienceEvent;
    private PAGE_SIZE;
    private queriesUtil;
    private repositoryEntries;
    constructor(repositoryService: RepositoryService, translateService: TranslateService);
    ngOnInit(): void;
    getAndAssignRepositoryBinaries(mos: IManagedObject[]): IManagedObject[];
    search(filterCriteria: FilterCriteria): void;
    result(selectedItems: SelectedRepositoryBinary[]): void;
    aggregate(mos: IManagedObject[]): Promise<ISelectModalObject[]>;
    getSelectModalOptions(versions: RepositoryBinary[], selectedItems: SelectedRepositoryBinary[], repositoryEntry: RepositoryCategory, repositoryType: RepositoryType): ISelectModalOption[];
    isBinaryRepositorySelected(selectedItems: SelectedRepositoryBinary[], repositoryEntry: RepositoryCategory, repositoryBinary: RepositoryBinary, repositoryType: RepositoryType): boolean;
    getSelectModalObject(repositoryEntry: RepositoryCategory, options: ISelectModalOption[]): ISelectModalObject;
    static ɵfac: i0.ɵɵFactoryDeclaration<RepositorySelectModalComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<RepositorySelectModalComponent, "c8y-repository-select-modal", never, {}, {}, never, never, false, never>;
}
//# sourceMappingURL=repository-select-modal.component.d.ts.map