import { FocusMonitor } from '@angular/cdk/a11y';
import { Clipboard } from '@angular/cdk/clipboard';
import { SelectionModel } from '@angular/cdk/collections';
import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, IterableDiffer, IterableDiffers, OnDestroy, QueryList, ViewContainerRef } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { FocusKeyManager } from '@koobiq/cdk/a11y';
import { MultipleMode } from '@koobiq/components/core';
import { Observable } from 'rxjs';
import { AsyncScheduler } from 'rxjs/internal/scheduler/AsyncScheduler';
import { FlatTreeControl } from './control/flat-tree-control';
import { KbqTreeNodeOutlet } from './outlet';
import { KbqTreeBase } from './tree-base';
import { KbqTreeOption, KbqTreeOptionEvent } from './tree-option.component';
import * as i0 from "@angular/core";
export declare const KBQ_SELECTION_TREE_VALUE_ACCESSOR: any;
export declare class KbqTreeSelectAllEvent<T> {
    source: KbqTreeSelection;
    options: T[];
    constructor(source: KbqTreeSelection, options: T[]);
}
/**
 * Event class that occurs when copying an item from the KbqTreeSelection.
 * Used to pass data about the copied item and copy context.
 *
 * @param source - instance of KbqTreeSelection
 * @param option - instance of KbqTreeOption
 * @param event - original keyboard event (optional) that triggered the copy
 */
export declare class KbqTreeCopyEvent<T> {
    source: KbqTreeSelection;
    option: T;
    event?: KeyboardEvent | undefined;
    constructor(source: KbqTreeSelection, option: T, event?: KeyboardEvent | undefined);
}
export declare class KbqTreeNavigationChange<T> {
    source: KbqTreeSelection;
    option: T;
    constructor(source: KbqTreeSelection, option: T);
}
export declare class KbqTreeSelectionChange<T> {
    source: KbqTreeSelection;
    option: T;
    constructor(source: KbqTreeSelection, option: T);
}
interface SelectionModelOption {
    id: number | string;
    value: string;
}
export declare class KbqTreeSelection extends KbqTreeBase<any> implements ControlValueAccessor, AfterContentInit, AfterViewInit, OnDestroy {
    private elementRef;
    private scheduler;
    private clipboard;
    protected readonly focusMonitor: FocusMonitor;
    renderedOptions: QueryList<KbqTreeOption>;
    keyManager: FocusKeyManager<KbqTreeOption>;
    selectionModel: SelectionModel<SelectionModelOption>;
    resetFocusedItemOnBlur: boolean;
    multipleMode: MultipleMode | null;
    userTabIndex: number | null;
    optionShouldHoldFocusOnBlur: boolean;
    nodeOutlet: KbqTreeNodeOutlet;
    unorderedOptions: QueryList<KbqTreeOption>;
    treeControl: FlatTreeControl<any>;
    readonly navigationChange: EventEmitter<KbqTreeNavigationChange<KbqTreeOption>>;
    readonly selectionChange: EventEmitter<KbqTreeSelectionChange<KbqTreeOption>>;
    readonly onSelectAll: EventEmitter<KbqTreeSelectAllEvent<KbqTreeOption>>;
    readonly onCopy: EventEmitter<KbqTreeCopyEvent<KbqTreeOption>>;
    private sortedNodes;
    get autoSelect(): boolean;
    set autoSelect(value: boolean);
    private _autoSelect;
    get optionFocusChanges(): Observable<KbqTreeOptionEvent>;
    get optionBlurChanges(): Observable<KbqTreeOptionEvent>;
    get multiple(): boolean;
    get noUnselectLast(): boolean;
    set noUnselectLast(value: boolean);
    private _noUnselectLast;
    get disabled(): boolean;
    set disabled(rawValue: boolean);
    private _disabled;
    get tabIndex(): any;
    set tabIndex(value: any);
    private _tabIndex;
    get showCheckbox(): boolean;
    get isEmpty(): boolean;
    private optionFocusSubscription;
    private optionBlurSubscription;
    constructor(elementRef: ElementRef<HTMLElement>, scheduler: AsyncScheduler, differs: IterableDiffers, changeDetectorRef: ChangeDetectorRef, multiple: MultipleMode, clipboard: Clipboard);
    ngAfterContentInit(): void;
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    focus($event: any): void;
    highlightSelectedOption(): void;
    blur(): void;
    onKeyDown(event: KeyboardEvent): void;
    updateScrollSize(): void;
    setSelectedOptionsByKey(option: KbqTreeOption, shiftKey: boolean, ctrlKey: boolean): void;
    setSelectedOptionsByClick(option: KbqTreeOption, shiftKey: boolean, ctrlKey: boolean): void;
    selectActiveOptions(): void;
    setFocusedOption(option: KbqTreeOption): void;
    toggleFocusedOption(): void;
    renderNodeChanges(data: KbqTreeOption[], dataDiffer?: IterableDiffer<KbqTreeOption>, viewContainer?: ViewContainerRef, parentData?: KbqTreeOption): void;
    emitNavigationEvent(option: KbqTreeOption): void;
    emitChangeEvent(option: KbqTreeOption): void;
    selectAllOptions(): void;
    copyActiveOption(event: KeyboardEvent): void;
    writeValue(value: any): void;
    /** `View -> model callback called when value changes` */
    onChange: (value: any) => void;
    registerOnChange(fn: (value: any) => void): void;
    /** `View -> model callback called when select has been touched` */
    onTouched: () => void;
    registerOnTouched(fn: () => {}): void;
    /**
     * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
     */
    setDisabledState(isDisabled: boolean): void;
    setOptionsFromValues(values: any[]): void;
    getSelectedValues(): any[];
    getItemHeight(): number;
    setStateChildren(option: KbqTreeOption, state: boolean): void;
    private onCopyDefaultHandler;
    private getHeight;
    private updateTabIndex;
    private updateRenderedOptions;
    private getSortedNodes;
    private allowFocusEscape;
    private resetOptions;
    private dropSubscriptions;
    private listenToOptionsFocus;
    /**
     * Utility to ensure all indexes are valid.
     * @param index The index to be checked.
     * @returns True if the index is valid for our list of options.
     */
    private isValidIndex;
    /** Checks whether any of the options is focused. */
    private hasFocusedOption;
    private markOptionsForCheck;
    private updateOptionsFocus;
    private canDeselectLast;
    private isFocusReceivedFromNestedOption;
    static ɵfac: i0.ɵɵFactoryDeclaration<KbqTreeSelection, [null, null, null, null, { attribute: "multiple"; }, { optional: true; }]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<KbqTreeSelection, "kbq-tree-selection", ["kbqTreeSelection"], { "treeControl": { "alias": "treeControl"; "required": false; }; "autoSelect": { "alias": "autoSelect"; "required": false; }; "noUnselectLast": { "alias": "noUnselectLast"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; }, { "navigationChange": "navigationChange"; "selectionChange": "selectionChange"; "onSelectAll": "onSelectAll"; "onCopy": "onCopy"; }, ["unorderedOptions"], never, false, never>;
}
export {};
