@itwin/presentation-components
Version:
React components based on iTwin.js Presentation library
53 lines • 2.15 kB
TypeScript
/** @packageDocumentation
* @module PropertyGrid
*/
import { PropsWithChildren } from "react";
import { SelectionHandler } from "@itwin/presentation-frontend";
import { SelectionStorage } from "@itwin/unified-selection";
import { IPresentationPropertyDataProvider } from "./DataProvider.js";
/**
* Props for the [[usePropertyDataProviderWithUnifiedSelection]] hook
* @public
*/
export interface PropertyDataProviderWithUnifiedSelectionProps {
/** The data provider used by the property grid. */
dataProvider: IPresentationPropertyDataProvider;
/**
* Maximum number of instances to request content for.
*
* When the number of selected instances is higher than this value, `dataProvider.keys` is set to an
* empty [KeySet]($presentation-common) and the result of the hook has `isOverLimit = true`.
*
* Defaults to `100`.
*/
requestedContentInstancesLimit?: number;
/**
* Unified selection storage to use for listening and getting active selection.
*
* When not specified, the deprecated `SelectionManager` from `@itwin/presentation-frontend` package
* is used.
*/
selectionStorage?: SelectionStorage;
}
/**
* [[usePropertyDataProviderWithUnifiedSelection]] return type.
* @public
*/
export interface UsePropertyDataProviderWithUnifiedSelectionResult {
/** Whether selected element count is exceeding the limit. */
isOverLimit: boolean;
/** Selected element count. */
numSelectedElements: number;
}
/** @internal */
export declare function SelectionHandlerContextProvider({ selectionHandler, children }: PropsWithChildren<{
selectionHandler: SelectionHandler;
}>): import("react/jsx-runtime").JSX.Element;
/** @internal */
export declare function useSelectionHandlerContext(): SelectionHandler | undefined;
/**
* A React hook that adds unified selection functionality to the provided data provider.
* @public
*/
export declare function usePropertyDataProviderWithUnifiedSelection(props: PropertyDataProviderWithUnifiedSelectionProps): UsePropertyDataProviderWithUnifiedSelectionResult;
//# sourceMappingURL=UseUnifiedSelection.d.ts.map