burdy
Version:
Open Source Headless Platform
19 lines (18 loc) • 921 B
TypeScript
import { IObjectWithKey, ISelectionOptionsWithRequiredGetKey, Selection } from '@fluentui/react';
export declare type ItemsOrKeys<T> = T[] | string[] | number[];
interface IExtendedSelectionOptions<T> extends ISelectionOptionsWithRequiredGetKey<T> {
defaultSelectedItems?: ItemsOrKeys<T>;
}
declare class ExtendedSelection<T = IObjectWithKey> extends Selection<T> {
private defaultSelectedItems;
select(itemsOrKeys: ItemsOrKeys<T>, clearRest?: boolean): void;
deselect(itemsOrKeys: ItemsOrKeys<T>): void;
deselectAll(): void;
selectAll(): void;
setDefaultSelectedItems(itemsOrKeys: ItemsOrKeys<T>): void;
clearDefaultSelectedItems(): void;
setItems(items: T[], shouldClear?: boolean): void;
private convertToKey;
}
export declare const useSelection: <T extends {}>(constructor: IExtendedSelectionOptions<T>, deps?: any[]) => ExtendedSelection<T>;
export default ExtendedSelection;