import { type PropertyValues, type TemplateResult } from 'lit';
import { LitElement } from 'lit';
import { DataDomain } from '@api-client/core/modeling/DataDomain.js';
import type { DomainNamespace } from '@api-client/core/modeling/DomainNamespace.js';
import type { DomainModel } from '@api-client/core/modeling/DomainModel.js';
import type { DomainEntity } from '@api-client/core/modeling/DomainEntity.js';
import type { DomainSearchResult } from '@api-client/core/modeling/types.js';
import type { DomainSelectionInfo } from '../types.js';
import type { DomainElement } from '@api-client/core/modeling/DomainElement.js';
import type { IconType } from '../../md/icons/Icons.js';
/**
 * Event detail for multi-selection
 */
export interface DomainMultiSelectionEventDetail {
    items: DomainSelectionInfo[];
    selectionType: string;
}
/**
 * Event detail for drag and drop operations
 */
export interface DomainDragDropEventDetail {
    items: DomainSelectionInfo[];
    target: DomainSelectionInfo;
}
/**
 * A new navigation element for DataDomain hierarchy that supports:
 * - Single click selection with selection events
 * - Ctrl+click multi-selection
 * - Drag and drop operations with proper validation
 * - Mixed selection type prevention
 *
 * @fires items-selected {CustomEvent<DomainMultiSelectionEventDetail>} - when multiple items are selected
 * @fires items-dropped {CustomEvent<DomainDragDropEventDetail>} - when items are dropped (or pasted)
 * @fires item-selected {CustomEvent<DomainSelectionInfo>} - when a single item is selected
 * @fires selection-cleared {CustomEvent<void>} - when selection is cleared
 * @fires items-cut {CustomEvent<{ items: DomainSelectionInfo[], cutItemsType: string }>} - when items are cut
 */
export default class DomainNavigation extends LitElement {
    #private;
    /**
     * The root DataDomain to render
     */
    accessor root: DataDomain | undefined;
    /**
     * The currently selected item key.
     * To be used by the parent component to control selection.
     * @attribute selected
     */
    set selected(value: string | undefined);
    get selected(): string | undefined;
    /**
     * Highlighted item key for visual indication.
     * Highlighted item only renders with a different style. Has no other meaning.
     */
    accessor highlighted: string | undefined;
    /**
     * Currently selected items
     */
    accessor selectedItems: Set<DomainSelectionInfo>;
    /**
     * The type of currently selected items (namespace, model, or entity)
     */
    accessor selectionType: string | undefined;
    /**
     * Items currently being dragged
     */
    accessor draggedItems: Set<DomainSelectionInfo>;
    /**
     * Current drag target
     */
    accessor dragTarget: string | undefined;
    /**
     * Set of parent items (by key) that are opened/expanded in the view
     */
    accessor openedParents: Set<string>;
    /**
     * Items that have been cut and are waiting to be pasted
     */
    accessor cutItems: Set<DomainSelectionInfo>;
    /**
     * The type of items that were cut
     */
    accessor cutItemsType: string | undefined;
    /**
     * Currently focused item key for keyboard navigation
     */
    accessor focusedItem: string | undefined;
    /**
     * Current search query
     */
    accessor searchQuery: string | undefined;
    /**
     * Search results from domain search
     */
    accessor searchResults: DomainSearchResult[];
    /**
     * List of all visible items in navigation order (for keyboard navigation)
     */
    private visibleItems;
    /**
     * Check if an item is selected by key
     */
    private isItemSelected;
    /**
     * Check if an item is dragged by key
     */
    private isItemDragged;
    /**
     * Check if an item is cut by key
     */
    private isItemCut;
    /**
     * Remove item from selection by key
     */
    private removeFromSelection;
    constructor();
    connectedCallback(): void;
    disconnectedCallback(): void;
    protected handleFocus(): void;
    protected willUpdate(cp: PropertyValues<this>): void;
    protected updated(cp: PropertyValues<this>): void;
    protected handleDomainChange(): void;
    /**
     * Toggle collapsed state of a parent item
     */
    protected toggleCollapsed(key: string, event?: MouseEvent): void;
    /**
     * Check if an item is collapsed
     */
    protected isCollapsed(key: string): boolean;
    /**
     * Initialize the opened state.
     *
     * @TODO: When selection change from the outside, we should also update the openedParents
     * to ensure that the parent of the selected item is always expanded.
     */
    protected initializeOpenedParents(): void;
    protected ensureVisibility(key: string): void;
    /**
     * Expand all collapsed items
     */
    expandAll(): void;
    /**
     * Collapse all parent items
     */
    collapseAll(): void;
    /**
     * Clear current selection
     */
    clearSelection(): void;
    /**
     * Handle keyboard shortcuts
     */
    protected handleKeyDown(event: KeyboardEvent): void;
    /**
     * Cut the currently selected items
     */
    protected cutSelectedItems(): void;
    /**
     * Paste cut items to the current selection target
     */
    protected pasteItems(): void;
    /**
     * Perform the actual paste operation
     */
    protected performPaste(targetKey: string, targetKind: string): void;
    /**
     * Cancel current cut operation
     */
    protected cancelCut(): void;
    /**
     * Check if target is valid for pasting cut items
     */
    protected isValidPasteTarget(targetKey: string, targetKind: string): boolean;
    /**
     * Dispatch cut items event
     */
    protected dispatchCutItems(): void;
    /**
     * Update the list of visible items for keyboard navigation
     */
    protected updateVisibleItemsList(): void;
    /**
     * Move focus to the previous item
     */
    protected moveFocusUp(): void;
    /**
     * Move focus to the next item
     */
    protected moveFocusDown(): void;
    /**
     * Handle left arrow key - collapse item or move to parent
     */
    protected handleArrowLeft(): void;
    /**
     * Handle right arrow key - expand item or move to first child
     */
    protected handleArrowRight(): void;
    /**
     * Handle space key - select/deselect focused item
     */
    protected handleSpaceKey(): void;
    /**
     * Handle enter key - activate focused item (same as click)
     */
    protected handleEnterKey(): void;
    /**
     * Move focus to first item
     */
    protected moveFocusToFirst(): void;
    /**
     * Move focus to last item
     */
    protected moveFocusToLast(): void;
    /**
     * Handle item click for selection
     */
    protected handleItemClick(event: MouseEvent, key: string, kind: string, domain: string, parent?: string): void;
    /**
     * Handle item receiving focus
     */
    protected handleItemFocus(key: string): void;
    protected focusOnCurrentItem(): void;
    /**
     * Handle single item selection
     */
    protected handleSingleSelection(key: string, kind: string, domain: string, parent?: string): void;
    protected handleFieldSelection(key: string, kind: string, domain: string, parent: string): void;
    /**
     * Handle multi-item selection with Ctrl+click
     */
    protected handleMultiSelection(key: string, kind: string, domain: string, parent?: string): void;
    /**
     * Dispatch single selection event
     */
    protected dispatchSingleSelection(key: string, kind: string, domain: string, parent?: string): void;
    /**
     * Dispatch multi-selection event
     */
    protected dispatchMultiSelection(): void;
    /**
     * Dispatch selection cleared event
     */
    protected dispatchSelectionCleared(): void;
    /**
     * Find item details by key
     */
    protected findItemDetails(key: string): DomainSelectionInfo | undefined;
    /**
     * Handle drag start
     */
    protected handleDragStart(event: DragEvent, key: string): void;
    /**
     * Handle drag over
     */
    protected handleDragOver(event: DragEvent, key: string, kind: string): void;
    /**
     * Handle drag leave
     */
    protected handleDragLeave(): void;
    /**
     * Handle drop
     */
    protected handleDrop(event: DragEvent, targetKey: string, targetKind: string): void;
    /**
     * Handle drag end
     */
    protected handleDragEnd(): void;
    /**
     * Handle click on external (read-only) items
     */
    protected handleExternalItemClick(e: MouseEvent, key: string, kind: string, domain: string, parent?: string): void;
    /**
     * Handle single selection for external items
     */
    protected handleExternalSingleSelection(key: string, kind: string, domain: string, parent?: string): void;
    /**
     * Handle multi-selection for external items
     */
    protected handleExternalMultiSelection(key: string, kind: string, domain: string, parent?: string): void;
    /**
     * Get the kind of the first selected item
     */
    protected getFirstSelectedItemKind(): string | undefined;
    /**
     * Get item details for a given key
     */
    protected getItemDetailsForKey(key: string): DomainSelectionInfo | undefined;
    /**
     * Find item details within a specific domain
     */
    protected findItemInDomain(key: string, domain: DataDomain): DomainSelectionInfo | undefined;
    /**
     * Find item in nested namespace structure
     */
    protected findItemInNamespace(key: string, namespace: DomainNamespace, domain: string): DomainSelectionInfo | undefined;
    /**
     * Check if a target is valid for dropping the current selection
     */
    protected isValidDropTarget(targetKey: string, targetKind: string): boolean;
    protected handleSearch(event: CustomEvent<{
        input: string;
    }>): void;
    protected handleSearchClear(): void;
    searchDomain(query: string): void;
    protected handleSearchResultClick(event: MouseEvent, result: DomainSearchResult): void;
    clearSearch(): void;
    handleSearchKeyDown(e: KeyboardEvent): void;
    render(): TemplateResult;
    protected renderEmptyDomain(): TemplateResult;
    protected renderCutItemsInfo(): TemplateResult;
    protected renderDomainTitle(root: DataDomain): TemplateResult;
    protected renderDomainHeader(root: DataDomain): TemplateResult;
    protected renderSearchResults(): TemplateResult;
    protected getSearchIcon(item: DomainElement): IconType;
    protected renderSearchResultItem(result: DomainSearchResult): TemplateResult;
    protected renderMultiSelectionInfo(): TemplateResult;
    protected renderDomainTree(root: DataDomain | DomainNamespace): TemplateResult;
    /**
     * Render external data domains from dependencies
     */
    protected renderExternalDomains(): TemplateResult;
    /**
     * Render a single external domain
     */
    protected renderExternalDomain(domain: DataDomain): TemplateResult;
    /**
     * Render external domain tree (read-only)
     */
    protected renderExternalDomainTree(domain: DataDomain | DomainNamespace): TemplateResult;
    protected renderNamespaceItem(namespace: DomainNamespace, parent: DataDomain | DomainNamespace): TemplateResult;
    protected renderModelItem(model: DomainModel, parent: DataDomain | DomainNamespace): TemplateResult;
    protected renderEntityList(model: DomainModel): TemplateResult;
    protected renderEntityItem(entity: DomainEntity, parent: DomainModel): TemplateResult;
    /**
     * Render external namespace item (read-only)
     */
    protected renderExternalNamespaceItem(namespace: DomainNamespace, parent: DataDomain | DomainNamespace): TemplateResult;
    /**
     * Render external model item (read-only)
     */
    protected renderExternalModelItem(model: DomainModel, parent: DataDomain | DomainNamespace): TemplateResult;
    /**
     * Render external entity list
     */
    protected renderExternalEntityList(model: DomainModel): TemplateResult;
    /**
     * Render external entity item (read-only)
     */
    protected renderExternalEntityItem(entity: DomainEntity, parent: DomainModel): TemplateResult;
}
//# sourceMappingURL=DomainNavigation.d.ts.map