import { DataRowProps } from '../../../../../types'; import type { ITree } from '../../tree/ITree'; import { NOT_FOUND_RECORD } from '../../tree/constants'; import { CommonTreeConfig, GetItemStatus } from '../../tree/hooks/strategies/types'; import { CascadeSelectionService } from './useCascadeSelectionService'; /** * Checking service configuration. */ export interface UseCheckingServiceProps extends Pick, 'getParentId' | 'dataSourceState' | 'setDataSourceState' | 'rowOptions' | 'getRowOptions' | 'cascadeSelection'>, CascadeSelectionService, GetItemStatus { /** * Tree-like data, selection should be performed on. */ tree: ITree; } /** * Service, which provides checking functionality and checking/parially checking info. */ export interface CheckingService { /** * Provides knowledge about checked state of the row. * @param row - row, which checked state info should be returned. * @returns if row is checked. */ isRowChecked: (row: DataRowProps) => boolean; /** * Provides knowledge about children checked state of the row. * @param row - row, which children checked state info should be returned. * @returns if row children are checked. */ isRowChildrenChecked: (row: DataRowProps) => boolean; /** * Checking handler of a row. * @param row - row, which should be checked. */ handleOnCheck: (row: DataRowProps) => void; /** * Select all handler of a row. * @param selectAll - specifies, if select all or clear all should be performed. */ handleSelectAll: (selectAll: boolean) => void; /** * Clears all checked. */ clearAllChecked: () => void; /** * Provides info about the ability to check and item. * @param id - id of the item to check if checkable. * @param item - record, if it is present or not found record symbol. * @returns if item with some id is checkable. */ isItemCheckable: (id: TId, item: TItem | typeof NOT_FOUND_RECORD) => boolean; } /** * Service, which provides checking functionality. * @returns checking service. */ export declare function useCheckingService({ tree, getParentId, dataSourceState, setDataSourceState, cascadeSelection, getRowOptions, rowOptions, getCompleteTreeForCascadeSelection, getItemStatus, }: UseCheckingServiceProps): CheckingService; //# sourceMappingURL=useCheckingService.d.ts.map