/*!
 * Copyright 2021 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { EventEmitter, OnInit } from '@angular/core';
import { LazyString } from '@vcd/i18n';
import { NonEmptyArray } from '../constants';
import { ComboOption } from './select-all-checkbox/select-all-toggle.component';
import { SharingTab, SharingTabResult } from './tabs/sharing-modal-tab.component';
import * as i0 from "@angular/core";
export declare type SharingModalResult = {
    [key: string]: SharingTabResult<any>;
};
/**
 * Allows the creation of toggles to select all for some set of entities.
 * Allows selection for any rights that are included in each tab.
 */
export interface SharingSelectAllToggle {
    /**
     * The tabs that this will select all for.
     */
    tabIds: NonEmptyArray<string>;
    /**
     * The text that will be displayed next to the toggle.
     */
    description: LazyString;
}
/**
 * A modal for sharing some entities with other types of entities.
 */
export declare class SharingModalComponent implements OnInit {
    /**
     * The title of this modal.
     */
    title: LazyString;
    /**
     * All of the options of entities that the use can share to.
     */
    set tabs(tabs: SharingTab<unknown>[]);
    get tabs(): SharingTab<unknown>[];
    private _tabs;
    /**
     * The select all toggles that should appear at the top of the modal.
     * These allow the user to share with all options in a certain tab(s).
     */
    selectAllToggles: SharingSelectAllToggle[];
    /**
     * If the modal should be opened or closed.
     */
    isOpened: boolean;
    isOpenedChange: EventEmitter<boolean>;
    formValue: SharingModalResult;
    /**
     * The event that is emitted when the user clicks the submit button.
     */
    formValueChange: EventEmitter<SharingModalResult>;
    /**
     * Closes this sharing modal. Resets the values within.
     */
    closeForm(): void;
    /**
     * Submits the sharing form.
     */
    submitForm(): void;
    /**
     * Updates the map of select all rights for the given tabs.
     */
    selectAllChange(tabIds: string[], right?: string): void;
    /**
     * Calculates the subset of rights contained within all the given tabs.
     *
     * @throws Error if there are no common rights.
     */
    calculateRightsOptions(tabIds: string[]): ComboOption[];
    /**
     * Gives the tab with the given ID.
     */
    getTabById(id: string): SharingTab<unknown>;
    /**
     * Returns true if all tabs are selected all for.
     */
    getTabsSelectedRights(tabs: string[]): string | undefined;
    ngOnInit(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<SharingModalComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SharingModalComponent, "vcd-sharing-modal", never, { "title": "title"; "tabs": "tabs"; "selectAllToggles": "selectAllToggles"; "isOpened": "isOpened"; "formValue": "formValue"; }, { "isOpenedChange": "isOpenedChange"; "formValueChange": "formValueChange"; }, never, never, false, never>;
}
