import { default as CxButton } from '../../../../../atoms/src/components/button/button.ts';
import { default as CxTree } from '../../../../../atoms/src/components/tree/tree.ts';
import { default as CxTreeItem } from '../../../../../atoms/src/components/tree-item/tree-item.ts';
import { default as CortexElement } from '../../../../../base/src/cortex-element.ts';
import { CxSelectionChangeEvent } from '../../../../../events/src/events.ts';
import { Folder, FolderSelectApi } from '../../../../../types/src/folder-select';
import { TemplateResult } from 'lit';
import { default as CxFolderSelectTreeItem } from '../folder-select-tree-item/folder-select-tree-item';

export default class CxFolderSelectTree extends CortexElement {
    #private;
    static readonly dependencies: {
        'cx-button': typeof CxButton;
        'cx-folder-select-tree-item': typeof CxFolderSelectTreeItem;
        'cx-tree': typeof CxTree;
    };
    private readonly localize;
    minQueryLength: number;
    selection: 'multiple' | 'single';
    searchTerm: string;
    selectedValue: string;
    token: string;
    bearerToken: string;
    baseUrl: string;
    extraFolderId: string;
    extraFolderTitle: string;
    extraFolderIcon: string;
    seeThru: boolean;
    extraFolderData: Folder | null;
    api?: FolderSelectApi;
    excludeVirtualFolders: boolean;
    firstFetchCallback: ((data: Folder[]) => void) | null;
    data: Folder[];
    hasMore: boolean;
    loading: boolean;
    /**
     * Selected folders encoded as `${path}-${id}`. Owned by this component
     * and forwarded down to all cx-folder-select-tree-items so they can
     * recompute their selected/indeterminate state declaratively.
     */
    currentRootIDsSet: Set<string>;
    /**
     * IDs (`${path}-${id}`) explicitly unselected while their ancestor was
     * selected. Used so a selected ancestor renders as indeterminate when a
     * descendant has been unchecked.
     */
    removedIDs: string[];
    get empty(): boolean;
    /**
     * This is used to render the cx-tree inside the cx-folder-select without the shadow root so that the cx-folder-select can query select the cx-tree inside
     */
    createRenderRoot(): this;
    runFirstUpdated(): void;
    handleExtraFolderIdChange(): Promise<void>;
    /**
     * Update `currentRootIDsSet` from a tree-item's toggle. Per-folder
     * selection: each folder is independent, so a click only adds/removes
     * the clicked folder — never its ancestors or descendants. Parents
     * showing an indeterminate hint is purely visual (computed in
     * `cx-folder-select-tree-item.syncBoxes` from path-prefix matches),
     * not a real selection.
     *
     * Only runs in multiple mode — single mode is still driven by `selectedValue`.
     */
    handleSelectedChange(event: CxSelectionChangeEvent<CxTreeItem>): Promise<void>;
    loadMore(event: MouseEvent): Promise<void>;
    handleFetchFolders(): Promise<void>;
    private fetchFolders;
    private renderFolder;
    render(): TemplateResult;
}
declare global {
    interface HTMLElementTagNameMap {
        'cx-folder-select-tree': CxFolderSelectTree;
    }
}
