/**
* DevExtreme (ui/tree_view.d.ts)
* Version: 19.2.5 (build 19359-1956)
* Build date: Wed Dec 25 2019
*
* Copyright (c) 2012 - 2019 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
    JQueryEventObject,
    JQueryPromise
} from '../common';

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

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

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

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! Do not import this directly */
export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions<dxTreeView>, SearchBoxMixinOptions<dxTreeView> {
    /**
     * @docid dxTreeViewOptions.animationEnabled
     * @type boolean
     * @default true
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    animationEnabled?: boolean;
    /**
     * @docid dxTreeViewOptions.createChildren
     * @type function
     * @type_function_param1 parentNode:dxTreeViewNode
     * @type_function_return Promise<any>|Array<Object>
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    createChildren?: ((parentNode: dxTreeViewNode) => Promise<any> | JQueryPromise<any> | Array<any>);
    /**
     * @docid  dxTreeViewOptions.dataSource
     * @type string|Array<dxTreeViewItem>|DataSource|DataSourceOptions
     * @default null
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    dataSource?: string | Array<dxTreeViewItem> | DataSource | DataSourceOptions;
    /**
     * @docid dxTreeViewOptions.dataStructure
     * @type Enums.TreeViewDataStructure
     * @default 'tree'
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    dataStructure?: 'plain' | 'tree';
    /**
     * @docid dxTreeViewOptions.expandAllEnabled
     * @type boolean
     * @default false
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    expandAllEnabled?: boolean;
    /**
     * @docid dxTreeViewOptions.expandEvent
     * @type Enums.TreeViewExpandEvent
     * @default "dblclick"
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    expandEvent?: 'dblclick' | 'click';
    /**
     * @docid dxTreeViewOptions.expandNodesRecursive
     * @type boolean
     * @default true
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    expandNodesRecursive?: boolean;
    /**
     * @docid dxTreeViewOptions.expandedExpr
     * @type string|function
     * @default 'expanded'
     * @hidden false
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    expandedExpr?: string | Function;
    /**
     * @docid dxTreeViewOptions.hasItemsExpr
     * @type string|function
     * @default 'hasItems'
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    hasItemsExpr?: string | Function;
    /**
     * @docid dxTreeViewOptions.items
     * @type Array<dxTreeViewItem>
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    items?: Array<dxTreeViewItem>;
    /**
     * @docid dxTreeViewOptions.onItemClick
     * @extends Action
     * @type function(e)
     * @type_function_param1 e:object
     * @type_function_param1_field4 itemData:object
     * @type_function_param1_field5 itemElement:dxElement
     * @type_function_param1_field6 itemIndex:number | object
     * @type_function_param1_field7 jQueryEvent:jQuery.Event:deprecated(event)
     * @type_function_param1_field8 event:event
     * @type_function_param1_field9 node:dxTreeViewNode
     * @action
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    onItemClick?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number | any, jQueryEvent?: JQueryEventObject, event?: event, node?: dxTreeViewNode }) => any);
    /**
     * @docid dxTreeViewOptions.onItemCollapsed
     * @extends Action
     * @type function(e)
     * @type_function_param1 e:object
     * @type_function_param1_field4 itemData:object
     * @type_function_param1_field5 itemElement:dxElement
     * @type_function_param1_field6 itemIndex:Number
     * @type_function_param1_field7 jQueryEvent:jQuery.Event:deprecated(event)
     * @type_function_param1_field8 event:event
     * @type_function_param1_field9 node:dxTreeViewNode
     * @action
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    onItemCollapsed?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number, jQueryEvent?: JQueryEventObject, event?: event, node?: dxTreeViewNode }) => any);
    /**
     * @docid dxTreeViewOptions.onItemContextMenu
     * @extends Action
     * @type function(e)
     * @type_function_param1 e:object
     * @type_function_param1_field4 itemData:object
     * @type_function_param1_field5 itemElement:dxElement
     * @type_function_param1_field6 itemIndex:number | object
     * @type_function_param1_field7 jQueryEvent:jQuery.Event:deprecated(event)
     * @type_function_param1_field8 event:event
     * @type_function_param1_field9 node:dxTreeViewNode
     * @action
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    onItemContextMenu?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number | any, jQueryEvent?: JQueryEventObject, event?: event, node?: dxTreeViewNode }) => any);
    /**
     * @docid dxTreeViewOptions.onItemExpanded
     * @extends Action
     * @type function(e)
     * @type_function_param1 e:object
     * @type_function_param1_field4 itemData:object
     * @type_function_param1_field5 itemElement:dxElement
     * @type_function_param1_field6 itemIndex:Number
     * @type_function_param1_field7 jQueryEvent:jQuery.Event:deprecated(event)
     * @type_function_param1_field8 event:event
     * @type_function_param1_field9 node:dxTreeViewNode
     * @action
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    onItemExpanded?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number, jQueryEvent?: JQueryEventObject, event?: event, node?: dxTreeViewNode }) => any);
    /**
     * @docid dxTreeViewOptions.onItemHold
     * @extends Action
     * @type function(e)
     * @type_function_param1 e:object
     * @type_function_param1_field4 itemData:object
     * @type_function_param1_field5 itemElement:dxElement
     * @type_function_param1_field6 itemIndex:number
     * @type_function_param1_field7 event:event
     * @type_function_param1_field8 node:dxTreeViewNode
     * @action
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    onItemHold?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number, event?: event, node?: dxTreeViewNode }) => any);
    /**
     * @docid dxTreeViewOptions.onItemRendered
     * @extends Action
     * @type function(e)
     * @type_function_param1 e:object
     * @type_function_param1_field4 itemData:object
     * @type_function_param1_field5 itemElement:dxElement
     * @type_function_param1_field6 itemIndex:number
     * @type_function_param1_field7 node:dxTreeViewNode
     * @action
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    onItemRendered?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number, node?: dxTreeViewNode }) => any);
    /**
     * @docid dxTreeViewOptions.onItemSelectionChanged
     * @extends Action
     * @type function(e)
     * @type_function_param1 e:object
     * @type_function_param1_field4 node:dxTreeViewNode
     * @type_function_param1_field5 itemElement:dxElement
     * @action
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    onItemSelectionChanged?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, node?: dxTreeViewNode, itemElement?: dxElement }) => any);
    /**
     * @docid dxTreeViewOptions.onSelectAllValueChanged
     * @extends Action
     * @type function(e)
     * @type_function_param1 e:object
     * @type_function_param1_field4 value:boolean
     * @action
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    onSelectAllValueChanged?: ((e: { component?: dxTreeView, element?: dxElement, model?: any, value?: boolean }) => any);
    /**
     * @docid dxTreeViewOptions.onSelectionChanged
     * @extends Action
     * @action
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    onSelectionChanged?: ((e: { component?: dxTreeView, element?: dxElement, model?: any }) => any);
    /**
     * @docid dxTreeViewOptions.parentIdExpr
     * @type string|function
     * @default 'parentId'
     * @hidden false
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    parentIdExpr?: string | Function;
    /**
     * @docid dxTreeViewOptions.rootValue
     * @type Object
     * @default 0
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    rootValue?: any;
    /**
     * @docid dxTreeViewOptions.scrollDirection
     * @type Enums.ScrollDirection
     * @default "vertical"
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    scrollDirection?: 'both' | 'horizontal' | 'vertical';
    /**
     * @docid dxTreeViewOptions.selectAllText
     * @type string
     * @default "Select All"
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    selectAllText?: string;
    /**
     * @docid dxTreeViewOptions.selectByClick
     * @type boolean
     * @default false
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    selectByClick?: boolean;
    /**
     * @docid dxTreeViewOptions.selectNodesRecursive
     * @type boolean
     * @default true
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    selectNodesRecursive?: boolean;
    /**
     * @docid dxTreeViewOptions.selectionMode
     * @type Enums.NavSelectionMode
     * @default "multiple"
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    selectionMode?: 'multiple' | 'single';
    /**
     * @docid dxTreeViewOptions.showCheckBoxesMode
     * @type Enums.TreeViewCheckBoxMode
     * @default 'none'
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    showCheckBoxesMode?: 'none' | 'normal' | 'selectAll';
    /**
     * @docid dxTreeViewOptions.virtualModeEnabled
     * @type boolean
     * @default false
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    virtualModeEnabled?: boolean;
}
/** The TreeView widget is a tree-like representation of textual data. */
export default class dxTreeView extends HierarchicalCollectionWidget {
    constructor(element: Element, options?: dxTreeViewOptions)
    constructor(element: JQuery, options?: dxTreeViewOptions)
    /**
     * @docid dxTreeViewMethods.collapseAll
     * @publicName collapseAll()
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    collapseAll(): void;
    /**
     * @docid dxTreeViewMethods.collapseItem
     * @publicName collapseItem(itemData)
     * @param1 itemData:Object
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    collapseItem(itemData: any): void;
    /**
     * @docid dxTreeViewMethods.collapseItem
     * @publicName collapseItem(itemElement)
     * @param1 itemElement:Node
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    collapseItem(itemElement: Element): void;
    /**
     * @docid dxTreeViewMethods.collapseItem
     * @publicName collapseItem(key)
     * @param1 key:any
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    collapseItem(key: any): void;
    /**
     * @docid dxTreeViewMethods.expandAll
     * @publicName expandAll()
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    expandAll(): void;
    /**
     * @docid dxTreeViewMethods.expandItem
     * @publicName expandItem(itemData)
     * @param1 itemData:Object
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    expandItem(itemData: any): void;
    /**
     * @docid dxTreeViewMethods.expandItem
     * @publicName expandItem(itemElement)
     * @param1 itemElement:Node
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    expandItem(itemElement: Element): void;
    /**
     * @docid dxTreeViewMethods.expandItem
     * @publicName expandItem(key)
     * @param1 key:any
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    expandItem(key: any): void;
    /**
     * @docid dxTreeViewMethods.getNodes
     * @publicName getNodes()
     * @return Array<dxTreeViewNode>
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    getNodes(): Array<dxTreeViewNode>;
    /**
     * @docid dxTreeViewMethods.selectAll
     * @publicName selectAll()
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    selectAll(): void;
    /**
     * @docid dxTreeViewMethods.selectItem
     * @publicName selectItem(itemData)
     * @param1 itemData:Object
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    selectItem(itemData: any): void;
    /**
     * @docid dxTreeViewMethods.selectItem
     * @publicName selectItem(itemElement)
     * @param1 itemElement:Node
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    selectItem(itemElement: Element): void;
    /**
     * @docid dxTreeViewMethods.selectItem
     * @publicName selectItem(key)
     * @param1 key:any
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    selectItem(key: any): void;
    /**
     * @docid dxTreeViewMethods.unselectAll
     * @publicName unselectAll()
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    unselectAll(): void;
    /**
     * @docid dxTreeViewMethods.unselectItem
     * @publicName unselectItem(itemData)
     * @param1 itemData:Object
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    unselectItem(itemData: any): void;
    /**
     * @docid dxTreeViewMethods.unselectItem
     * @publicName unselectItem(itemElement)
     * @param1 itemElement:Node
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    unselectItem(itemElement: Element): void;
    /**
     * @docid dxTreeViewMethods.unselectItem
     * @publicName unselectItem(key)
     * @param1 key:any
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    unselectItem(key: any): void;
    /**
     * @docid dxTreeViewMethods.updateDimensions
     * @publicName updateDimensions()
     * @return Promise<void>
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    updateDimensions(): Promise<void> & JQueryPromise<void>;
}

/** Warning! Do not import this directly */
export interface dxTreeViewItem extends CollectionWidgetItem {
    /**
     * @docid dxTreeViewItem.expanded
     * @type boolean
     * @default false
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    expanded?: boolean;
    /**
     * @docid dxTreeViewItem.hasItems
     * @type boolean
     * @default undefined
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    hasItems?: boolean;
    /**
     * @docid dxTreeViewItem.icon
     * @type String
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    icon?: string;
    /**
     * @docid dxTreeViewItem.items
     * @type Array<dxTreeViewItem>
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    items?: Array<dxTreeViewItem>;
    /**
     * @docid dxTreeViewItem.parentId
     * @type number|string
     * @default undefined
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    parentId?: number | string;
    /**
     * @docid dxTreeViewItem.selected
     * @type boolean
     * @default false
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    selected?: boolean;
}

/** Warning! Do not import this directly */
export interface dxTreeViewNode {
    /**
     * @docid dxTreeViewNode.children
     * @type Array<dxTreeViewNode>
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    children?: Array<dxTreeViewNode>;
    /**
     * @docid dxTreeViewNode.disabled
     * @type boolean
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    disabled?: boolean;
    /**
     * @docid dxTreeViewNode.expanded
     * @type boolean
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    expanded?: boolean;
    /**
     * @docid dxTreeViewNode.itemData
     * @type object
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    itemData?: any;
    /**
     * @docid dxTreeViewNode.key
     * @type any
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    key?: any;
    /**
     * @docid dxTreeViewNode.parent
     * @type dxTreeViewNode
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    parent?: dxTreeViewNode;
    /**
     * @docid dxTreeViewNode.selected
     * @type boolean
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    selected?: boolean;
    /**
     * @docid dxTreeViewNode.text
     * @type string
     * @prevFileNamespace DevExpress.ui
     * @public
     */
    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! Do not import this directly */
export type Options = dxTreeViewOptions;

/** @deprecated use Options instead */
/** Warning! Do not import this directly */
export type IOptions = dxTreeViewOptions;