@uifabric/experiments
Version:
Experimental React components for building experiences for Microsoft 365.
17 lines (16 loc) • 843 B
TypeScript
import { Selection } from '../../../Utilities';
export interface IUseSelectedItemsResponse<T> {
selectedItems: T[];
setSelectedItems: (items: T[]) => void;
addItems: (items: T[]) => void;
dropItemsAt: (insertIndex: number, itemsToAdd: T[], indicesToRemove: number[]) => void;
removeItemAt: (index: number) => void;
removeItem: (item: T) => void;
replaceItem: (itemToReplace: T, itemsToReplaceWith: T[]) => void;
removeItems: (itemsToRemove: T[]) => void;
removeSelectedItems: () => void;
getSelectedItems: () => T[];
hasSelectedItems: () => boolean;
unselectAll: () => void;
}
export declare const useSelectedItems: <T extends {}>(selection: Selection<import("@uifabric/utilities/lib/selection/Selection.types").IObjectWithKey>, selectedItems?: T[] | undefined) => IUseSelectedItemsResponse<T>;