/**
* DevExtreme (ui/tree_view.d.ts)
* Version: 21.1.0 (build 21016-0316)
* Build date: Sat Jan 16 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import '../jquery_augmentation';

import {
    dxElement
} from '../core/element';

import DataSource, {
    DataSourceOptions
} from '../data/data_source';

import {
    event
} from '../events/index';

import {
    CollectionWidgetItem
} from './collection/ui.collection_widget.base';

import HierarchicalCollectionWidget, {
    HierarchicalCollectionWidgetOptions
} from './hierarchical_collection/ui.hierarchical_collection_widget';

import {
    SearchBoxMixinOptions
} from './widget/ui.search_box_mixin';

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions<dxTreeView>, SearchBoxMixinOptions<dxTreeView> {
    /**
     */
    animationEnabled?: boolean;
    /**
     */
    createChildren?: ((parentNode: dxTreeViewNode) => Promise<any> | JQueryPromise<any> | Array<any>);
    /**
     */
    dataSource?: string | Array<dxTreeViewItem> | DataSource | DataSourceOptions;
    /**
     */
    dataStructure?: 'plain' | 'tree';
    /**
     */
    expandAllEnabled?: boolean;
    /**
     */
    expandEvent?: 'dblclick' | 'click';
    /**
     */
    expandNodesRecursive?: boolean;
    /**
     */
    expandedExpr?: string | Function;
    /**
     */
    hasItemsExpr?: string | Function;
    /**
     */
    items?: Array<dxTreeViewItem>;
    /**
     */
    onItemClick?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number | any, event?: event, node?: dxTreeViewNode }) => any);
    /**
     */
    onItemCollapsed?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number, event?: event, node?: dxTreeViewNode }) => any);
    /**
     */
    onItemContextMenu?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number | any, event?: event, node?: dxTreeViewNode }) => any);
    /**
     */
    onItemExpanded?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number, event?: event, node?: dxTreeViewNode }) => any);
    /**
     */
    onItemHold?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number, event?: event, node?: dxTreeViewNode }) => any);
    /**
     */
    onItemRendered?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number, node?: dxTreeViewNode }) => any);
    /**
     */
    onItemSelectionChanged?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, node?: dxTreeViewNode, itemElement?: dxElement }) => any);
    /**
     */
    onSelectAllValueChanged?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, value?: boolean }) => any);
    /**
     */
    onSelectionChanged?: ((e: { component?: dxTreeView, element?: dxElement, model?: any }) => any);
    /**
     */
    parentIdExpr?: string | Function;
    /**
     */
    rootValue?: any;
    /**
     */
    scrollDirection?: 'both' | 'horizontal' | 'vertical';
    /**
     */
    selectAllText?: string;
    /**
     */
    selectByClick?: boolean;
    /**
     */
    selectNodesRecursive?: boolean;
    /**
     */
    selectionMode?: 'multiple' | 'single';
    /**
     */
    showCheckBoxesMode?: 'none' | 'normal' | 'selectAll';
    /**
     */
    virtualModeEnabled?: boolean;
}
/**
 */
export default class dxTreeView extends HierarchicalCollectionWidget {
    constructor(element: Element, options?: dxTreeViewOptions)
    constructor(element: JQuery, options?: dxTreeViewOptions)
    /**
     */
    collapseAll(): void;
    /**
     */
    collapseItem(itemData: any): Promise<void> & JQueryPromise<void>;
    /**
     */
    collapseItem(itemElement: Element): Promise<void> & JQueryPromise<void>;
    /**
     */
    collapseItem(key: any): Promise<void> & JQueryPromise<void>;
    /**
     */
    expandAll(): void;
    /**
     */
    expandItem(itemData: any): Promise<void> & JQueryPromise<void>;
    /**
     */
    expandItem(itemElement: Element): Promise<void> & JQueryPromise<void>;
    /**
     */
    expandItem(key: any): Promise<void> & JQueryPromise<void>;
    /**
     */
    getNodes(): Array<dxTreeViewNode>;
    /**
     */
    getSelectedNodes(): Array<dxTreeViewNode>;
    /**
     */
    getSelectedNodeKeys(): Array<any>;
    /**
     */
    selectAll(): void;
    /**
     */
    selectItem(itemData: any): boolean;
    /**
     */
    selectItem(itemElement: Element): boolean;
    /**
     */
    selectItem(key: any): boolean;
    /**
     */
    unselectAll(): void;
    /**
     */
    unselectItem(itemData: any): boolean;
    /**
     */
    unselectItem(itemElement: Element): boolean;
    /**
     */
    unselectItem(key: any): boolean;
    /**
     */
    updateDimensions(): Promise<void> & JQueryPromise<void>;
    /**
     */
    scrollToItem(itemData: any): Promise<void> & JQueryPromise<void>;
    /**
     */
    scrollToItem(itemElement: Element): Promise<void> & JQueryPromise<void>;
    /**
     */
    scrollToItem(key: any): Promise<void> & JQueryPromise<void>;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxTreeViewItem extends CollectionWidgetItem {
    /**
     */
    expanded?: boolean;
    /**
     */
    hasItems?: boolean;
    /**
     */
    icon?: string;
    /**
     */
    items?: Array<dxTreeViewItem>;
    /**
     */
    parentId?: number | string;
    /**
     */
    selected?: boolean;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxTreeViewNode {
    /**
     */
    children?: Array<dxTreeViewNode>;
    /**
     */
    disabled?: boolean;
    /**
     */
    expanded?: boolean;
    /**
     */
    itemData?: any;
    /**
     */
    key?: any;
    /**
     */
    parent?: dxTreeViewNode;
    /**
     */
    selected?: boolean;
    /**
     */
    text?: string;
}

declare global {
interface JQuery {
    dxTreeView(): JQuery;
    dxTreeView(options: "instance"): dxTreeView;
    dxTreeView(options: string): any;
    dxTreeView(options: string, ...params: any[]): any;
    dxTreeView(options: dxTreeViewOptions): JQuery;
}
}
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export type Options = dxTreeViewOptions;

/** @deprecated use Options instead */
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export type IOptions = dxTreeViewOptions;
