"use client";
import { useReadonlySet } from "../useReadonlySet.js";
/**
 * @see {@link https://react-md.dev/components/tree | Tree Demos}
 * @since 6.0.0 Renamed from `useTreeItemSelection` and uses a Set
 * instead of a list to increase performance.
 */ export function useTreeSelection(defaultSelectedIds, multiSelect = false) {
    const { value, setValue, toggleValue } = useReadonlySet({
        toggleType: multiSelect ? "multiple" : "single-select",
        defaultValue: defaultSelectedIds
    });
    return {
        multiSelect,
        selectedIds: value,
        toggleTreeItemSelection: toggleValue,
        selectMultipleTreeItems: setValue
    };
}

//# sourceMappingURL=useTreeSelection.js.map