/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { BaseEvent } from '@progress/kendo-react-common'; import { TreeView } from './TreeView.js'; /** * Represents the object of the `onExpandChange` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview)). */ export interface TreeViewExpandChangeEvent extends BaseEvent { /** * The item that is expanded or collapsed. */ item: any; /** * The hierarchical index of the item. The indices are zero-based. The first root item has a `0` (zero) index. If the first root item has children, the first child acquires a `0_0` index and the second acquires a `0_1` index. */ itemHierarchicalIndex: string; } /** * Represents the object of the `onItemClick` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview)). */ export interface TreeViewItemClickEvent extends BaseEvent { /** * The item that is clicked. */ item: any; /** * The hierarchical index of the item. The indices are zero-based. * The first root item has a `0` (zero) index. If the first root item has children, the first child acquires a `0_0` index and the second acquires a `0_1` index. */ itemHierarchicalIndex: string; } /** * Represents the object of the `onCheckChange` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/checkboxes/helper-functions)). */ export interface TreeViewCheckChangeEvent extends BaseEvent { /** * The item that is selected or deselected. */ item: any; /** * The hierarchical index of the item. The indices are zero-based. * The first root item has a `0` (zero) index. If the first root item has children, the first child acquires a `0_0` index and the second acquires a `0_1` index. */ itemHierarchicalIndex: string; } /** * Represents the object of the `onContextMenu` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview)). */ export interface TreeViewContextMenuEvent extends BaseEvent { /** * An event target. */ target: TreeView; /** * The data object that represents the current item. */ item: any; /** * The ID of the current item. */ itemID: string; /** * A React Synthetic Event. */ syntheticEvent: React.MouseEvent; } /** * Represents the object of the `onItemDragStart` event. */ export interface TreeViewItemDragStartEvent { /** * An event target. */ target: TreeView; /** * The item that is dragged. */ item: any; /** * The hierarchical index of the dragged item. The indices are zero-based. * The first root item has a `0` (zero) index. If the first root item has children, the first child acquires a `0_0` index and the second acquires a `0_1` index. */ itemHierarchicalIndex: string; } /** * Represents the object of the `onItemDragOver` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)). */ export interface TreeViewItemDragOverEvent { /** * The target that is associated with the dragged item. */ target: TreeView; /** * The item that is dragged. */ item: any; /** * The hierarchical index of the dragged item. The indices are zero-based. * The first root item has a `0` (zero) index. If the first root item has children, the first child acquires a `0_0` index and the second acquires a `0_1` index. */ itemHierarchicalIndex: string; /** * The X (horizontal) coordinate (in pixels) at which the event occurred that is relative to the left edge of the entire document. * Includes any portion of the document which is not currently visible. */ pageX: number; /** * The Y (vertical) coordinate (in pixels) at which the event occurred that is relative to the whole document. * `pageY` observes any vertical scrolling of the page. */ pageY: number; /** * Provides the horizontal coordinate within the client area of the application at which the event occurred * (as opposed to the coordinate within the page). */ clientX: number; /** * Provides the vertical coordinate within the client area of the application at which the event occurred * (as opposed to the coordinate within the page). */ clientY: number; } /** * Represents the object of the `onItemDragEnd` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)). */ export interface TreeViewItemDragEndEvent { /** * The target that is associated with the dragged item. */ target: TreeView; /** * The item that is dragged. */ item: any; /** * The hierarchical index of the dragged item. The indices are zero-based. * The first root item has a `0` (zero) index. If the first root item has children, the first child acquires a `0_0` index and the second acquires a `0_1` index. */ itemHierarchicalIndex: string; /** * The X (horizontal) coordinate (in pixels) at which the event occured that is relative to the left edge of the entire document. * `pageX` includes any portion of the document that is not currently visible. */ pageX: number; /** * The Y (vertical) coordinate (in pixels) at which the event occured that is relative to the whole document. * `pageY` observes any vertical scrolling of the page. */ pageY: number; /** * Provides the horizontal coordinate within the client area of the application at which the event occurred * (as opposed to the coordinate within the page). */ clientX: number; /** * Provides the vertical coordinate within the client area of the application at which the event occurred * (as opposed to the coordinate within the page). */ clientY: number; }