UNPKG

react-native-tree-multi-select

Version:

Super-fast, customizable tree view component for React Native with drag-and-drop reordering, multi-selection, and search filtering.

18 lines 1.19 kB
import type { CheckboxValueType } from "../types/treeView.types"; /** Derive the tri-state checkbox value from checked and indeterminate booleans. */ export declare function getCheckboxValue(isChecked: boolean, isIndeterminate: boolean): CheckboxValueType; /** * Function to toggle checkbox state for a tree structure. * It sets the checked and indeterminate state for all affected nodes in the tree after an action to check/uncheck is made. * @param {string[]} ids - The ids of nodes that need to be checked or unchecked. * @param {boolean} [forceCheck] - Optional. If provided, will force the check state of the nodes to be this value. * If not provided, the check state will be toggled based on the current state. */ export declare function toggleCheckboxes<ID>(storeId: string, ids: ID[], forceCheck?: boolean): void; /** * Recalculates checked/indeterminate state for all parent nodes bottom-up. * Should be called after tree structure changes (e.g., drag-drop moves) to ensure * parent states correctly reflect their children's checked states. */ export declare function recalculateCheckedStates<ID>(storeId: string): void; //# sourceMappingURL=toggleCheckbox.helper.d.ts.map