import * as _angular_core from '@angular/core';
import { OnDestroy, TemplateRef } from '@angular/core';
import { DropdownOverlay } from '@agorapulse/ui-components/dropdown-base';
import { InputSearchComponent } from '@agorapulse/ui-components/input-search';

interface SelectionDropdownItem {
    /** Unique HTML ID for the item */
    htmlId: string;
    /** Display text for the item */
    text: string;
    /** Whether the item is selected */
    selected: boolean;
    /** Whether the item is displayed in a mixed/indeterminate state. Takes visual precedence over `selected`. */
    indeterminate?: boolean;
    /** Whether the item is disabled and non-interactive */
    disabled?: boolean;
    /** Avatar URL to display */
    avatarUrl?: string;
    /** Symbol ID to display */
    symbolId?: string;
    /** Tooltip text displayed when item is disabled */
    disabledTooltip?: string;
    /** Text displayed in a badge next to the item */
    badgeText?: string;
    /** Whether the feature is locked */
    isFeatureLocked?: boolean;
    /** Whether avatar should be rounded */
    roundedAvatar?: boolean;
    /** Avatar network type */
    network?: any;
    /** Symbol color */
    symbolColor?: string;
    /** Symbol tooltip text */
    symbolTooltipText?: string;
    /** Group label - items with the same groupLabel will be grouped together */
    groupLabel?: string;
}
/**
 * One rendered row in the unselected zone: either a standalone item or a group
 * holding the items that belong to it (in first-encounter order).
 */
type RenderEntry = {
    kind: 'item';
    item: SelectionDropdownItem;
} | {
    kind: 'group';
    label: string;
    items: SelectionDropdownItem[];
};
/**
 * A dropdown component that displays a list of selectable items with checkboxes,
 * badges, tooltips, and keyboard navigation.
 */
declare class SelectionDropdownComponent implements DropdownOverlay, OnDestroy {
    private readonly symbolRegistry;
    private readonly overlay;
    selectionDropdownTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
    trigger: _angular_core.Signal<TemplateRef<unknown> | undefined>;
    /** ID for the header button */
    headerButtonId: _angular_core.InputSignal<string | undefined>;
    /** ID for the footer button */
    footerButtonId: _angular_core.InputSignal<string | undefined>;
    /** Array of items to display in the dropdown menu */
    items: _angular_core.InputSignal<SelectionDropdownItem[]>;
    /** Title to display in the header */
    title: _angular_core.InputSignal<string | undefined>;
    /** Text for the footer button */
    footerButtonText: _angular_core.InputSignal<string | undefined>;
    /** Symbol ID for the footer button */
    footerButtonSymbolId: _angular_core.InputSignal<string | undefined>;
    /** Text for the header button */
    headerButtonText: _angular_core.InputSignal<string | undefined>;
    /** Symbol ID for the header button */
    headerButtonSymbolId: _angular_core.InputSignal<string | undefined>;
    /** Placeholder text for the search input */
    searchPlaceholderText: _angular_core.InputSignal<string>;
    /** Text to display when no search results are found */
    noSearchResultsText: _angular_core.InputSignal<string>;
    /** Whether to show a backdrop that closes the dropdown when clicked */
    showBackdrop: _angular_core.InputSignal<boolean>;
    /** Whether the dropdown is disabled and cannot be opened */
    disabled: _angular_core.InputSignal<boolean>;
    /** Default position for the dropdown relative to the trigger element */
    defaultPosition: _angular_core.InputSignal<"left" | "right">;
    /** Emits when the dropdown menu is opened */
    opened: _angular_core.OutputEmitterRef<void>;
    /** Emits when the dropdown menu is closed */
    closed: _angular_core.OutputEmitterRef<void>;
    /** Emits when a dropdown item selection changes */
    selectionChange: _angular_core.OutputEmitterRef<SelectionDropdownItem[]>;
    /** Emits when the footer button is clicked */
    footerButtonClick: _angular_core.OutputEmitterRef<void>;
    /** Emits when the header button is clicked */
    headerButtonClick: _angular_core.OutputEmitterRef<void>;
    /** Emits when the search input is changed */
    searchInputChange: _angular_core.OutputEmitterRef<string>;
    /**
     * Two-way bindable, clearable search term. Consumers can read it and reset it (set to '')
     * to clear the search and restore the full item list — letting them drive the search
     * declaratively instead of reaching into the rendered `ap-input-search`.
     */
    readonly searchTerm: _angular_core.ModelSignal<string>;
    private readonly destroy$;
    private readonly searchTermSubject;
    protected readonly inputSearchComponent: _angular_core.Signal<InputSearchComponent | undefined>;
    readonly isOpen: _angular_core.Signal<boolean>;
    focusInput: _angular_core.EffectRef;
    private readonly internalItems;
    protected readonly filteredItems: _angular_core.WritableSignal<SelectionDropdownItem[]>;
    protected readonly initiallySelectedItems: _angular_core.WritableSignal<SelectionDropdownItem[]>;
    protected readonly selectedItems: _angular_core.Signal<SelectionDropdownItem[]>;
    protected readonly unselectedItems: _angular_core.Signal<SelectionDropdownItem[]>;
    /**
     * Unselected items rebuilt into a single ordered list: standalone items and
     * groups appear in the order their first item is encountered; later items of
     * an already-seen group join that existing group entry.
     */
    protected readonly displayEntries: _angular_core.Signal<RenderEntry[]>;
    protected readonly groupSelectionStates: _angular_core.Signal<Record<string, "selected" | "partial" | "unselected">>;
    constructor();
    ngOnDestroy(): void;
    /** Opens the dropdown menu at the specified trigger element */
    open(triggerElement?: HTMLElement): void;
    /** Closes the dropdown menu and cleans up overlay resources */
    close(): void;
    /** Toggles the dropdown menu open or closed state */
    toggle(triggerElement?: HTMLElement): void;
    /** Handles item toggle events, updating selection and emitting changes.
     *  An indeterminate item resolves to selected; a definite item flips. Toggling always
     *  clears the indeterminate flag, so the item becomes a definite selected/unselected. */
    onItemToggle(item: SelectionDropdownItem): void;
    /** Handles footer button clicks */
    onFooterButtonClick(): void;
    /** Handles footer button keyboard events */
    onFooterButtonKeydown(event: KeyboardEvent): void;
    /** Handles header button clicks */
    onHeaderButtonClick(): void;
    /** Handles header button keyboard events */
    onHeaderButtonKeydown(event: KeyboardEvent): void;
    /** Handles search input changes from the rendered field. Filtering is driven by the
     *  `searchTerm` effect, so this only updates the term and notifies listeners. */
    onSearchTermChange(term: string): void;
    /** Handles group toggle events, selecting/deselecting all items within the group */
    onGroupToggle(groupLabel: string, checked: boolean): void;
    /** Stable track key for a render entry (item or group). */
    protected entryKey(entry: RenderEntry): string;
    /** Updates the filtered items based on search term */
    private updateFilteredItems;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectionDropdownComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectionDropdownComponent, "ap-selection-dropdown", never, { "headerButtonId": { "alias": "headerButtonId"; "required": false; "isSignal": true; }; "footerButtonId": { "alias": "footerButtonId"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "footerButtonText": { "alias": "footerButtonText"; "required": false; "isSignal": true; }; "footerButtonSymbolId": { "alias": "footerButtonSymbolId"; "required": false; "isSignal": true; }; "headerButtonText": { "alias": "headerButtonText"; "required": false; "isSignal": true; }; "headerButtonSymbolId": { "alias": "headerButtonSymbolId"; "required": false; "isSignal": true; }; "searchPlaceholderText": { "alias": "searchPlaceholderText"; "required": false; "isSignal": true; }; "noSearchResultsText": { "alias": "noSearchResultsText"; "required": false; "isSignal": true; }; "showBackdrop": { "alias": "showBackdrop"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "defaultPosition": { "alias": "defaultPosition"; "required": false; "isSignal": true; }; "searchTerm": { "alias": "searchTerm"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; "selectionChange": "selectionChange"; "footerButtonClick": "footerButtonClick"; "headerButtonClick": "headerButtonClick"; "searchInputChange": "searchInputChange"; "searchTerm": "searchTermChange"; }, ["trigger"], never, true, never>;
}

/**
 * Directive that turns any element into a trigger for a SelectionDropdown component.
 * Handles click and keyboard interactions to open/close the dropdown.
 */
declare class SelectionDropdownTriggerDirective {
    private readonly elementRef;
    /** Reference to the SelectionDropdown component that this trigger controls */
    apSelectionDropdownTrigger: _angular_core.InputSignal<SelectionDropdownComponent>;
    /** Prevents the trigger from opening/toggling the dropdown when true */
    apSelectionDropdownTriggerDisable: _angular_core.InputSignal<boolean>;
    /** Handles click events to toggle the dropdown */
    onClick(event: MouseEvent): void;
    /** Handles keyboard events for accessibility (Enter, Space, Arrow Down, Escape) */
    onKeyDown(event: KeyboardEvent): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectionDropdownTriggerDirective, never>;
    static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SelectionDropdownTriggerDirective, "[apSelectionDropdownTrigger]", never, { "apSelectionDropdownTrigger": { "alias": "apSelectionDropdownTrigger"; "required": true; "isSignal": true; }; "apSelectionDropdownTriggerDisable": { "alias": "apSelectionDropdownTriggerDisable"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

export { SelectionDropdownComponent, SelectionDropdownTriggerDirective };
export type { SelectionDropdownItem };
