@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
81 lines (80 loc) • 2.79 kB
TypeScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { HistoryItem, SmartBoxMode } from '../interfaces/index.js';
import { GridSmartBoxHistoryProps } from '../interfaces/utilTypes.js';
/**
* Represents the props for the useSmartBoxHistory hook.
*
* @hidden
*/
export interface UseSmartBoxHistoryProps {
/**
* The currently selected view mode.
*/
selectedView: SmartBoxMode | null;
/**
* The history settings for search mode.
*/
searchHistorySettings: GridSmartBoxHistoryProps | null;
/**
* The history settings for semantic search mode.
*/
semanticSearchHistorySettings: GridSmartBoxHistoryProps | null;
/**
* The history settings for AI assistant mode.
*/
aiAssistantHistorySettings: GridSmartBoxHistoryProps | null;
}
/**
* Represents the return value of the useSmartBoxHistory hook.
*
* @hidden
*/
export interface UseSmartBoxHistoryReturn {
/**
* The history items for search mode.
*/
searchHistory: HistoryItem[];
/**
* The history items for semantic search mode.
*/
semanticSearchHistory: HistoryItem[];
/**
* The history items for AI assistant mode.
*/
aiAssistantHistory: HistoryItem[];
/**
* The history items for the currently selected mode.
*/
currentHistory: HistoryItem[];
/**
* The history settings for the currently selected mode.
*/
currentHistorySettings: GridSmartBoxHistoryProps | null;
/**
* Function to add a new item to the history for a specific mode.
*
* @param mode - The mode to add the history item to.
* @param value - The text value to add to history.
* @param historySettings - The history settings for the mode.
*/
addToHistory: (mode: SmartBoxMode, value: string, historySettings: GridSmartBoxHistoryProps | null) => void;
}
/**
* Hook to manage SmartBox history for all modes.
*
* This hook maintains separate history lists for each mode (search, semantic search,
* and AI assistant) and provides functions to add items to history while respecting
* the configured history size limits.
*
* @param props - The hook properties.
* @returns An object containing history arrays and management functions.
*
* @hidden
*/
export declare function useSmartBoxHistory({ selectedView, searchHistorySettings, semanticSearchHistorySettings, aiAssistantHistorySettings }: UseSmartBoxHistoryProps): UseSmartBoxHistoryReturn;