/********************************************************************************** * Copyright (c) 2024-2025 EclipseSource and others. * * This program and the accompanying materials are made available under the * terms of the MIT License as outlined in the LICENSE file. **********************************************************************************/ import React from 'react'; import { CDTTreeItem, CDTTreeItemResource } from '../../common'; /** * Recursively filters the tree to include items that match the search text * and their ancestor hierarchy. If children are not to be filtered, all children * of a matched item are included. Elements that match the search text are marked. */ export declare function filterTree(items: CDTTreeItem[], searchText: string, options?: { filterChildren?: boolean; }): CDTTreeItem[]; /** * Options for traversing the tree. */ export interface TraverseOptions { /** * A predicate function to determine if an item should be included. * If omitted, all items are included. */ predicate?: (item: CDTTreeItem) => boolean; /** * A mapping function to transform items. * If omitted, items are returned as-is. */ mapper?: (item: CDTTreeItem) => U; } /** * Recursively traverses the tree, optionally filtering and mapping items. * * @param items - The root items of the tree. * @param options - Optional traversal options including predicate and mapFn. * @returns An array of items that satisfy the predicate and are optionally mapped. */ export declare function traverseTree>(items: CDTTreeItem[], options?: TraverseOptions): U[]; export declare function getAncestors(item: CDTTreeItem): CDTTreeItem[]; export type ClickHookHandler = (event: React.MouseEvent, payload: any) => void; type UseClickHookProps = { onSingleClick?: ClickHookHandler; onDoubleClick?: ClickHookHandler; delay?: number; }; export declare function useClickHook({ onSingleClick, onDoubleClick, delay }: UseClickHookProps): ClickHookHandler; export {}; //# sourceMappingURL=utils.d.ts.map