@itwin/presentation-frontend
Version:
Frontend of iModel.js Presentation library
57 lines • 2.76 kB
TypeScript
/** @packageDocumentation
* @module UnifiedSelection
*/
import { BeEvent } from "@itwin/core-bentley";
import { IModelConnection } from "@itwin/core-frontend";
import { KeySet } from "@itwin/presentation-common";
import { ISelectionProvider } from "./ISelectionProvider.js";
/**
* An interface for selection change listeners.
* @public
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `StorageSelectionChangesListener` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md) package instead.
*/
export declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;
/**
* An event broadcasted on selection changes
* @public
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `Event<StorageSelectionChangesListener>` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md) package instead.
*/
export declare class SelectionChangeEvent extends BeEvent<SelectionChangesListener> {
}
/**
* The type of selection change
* @public
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `StorageSelectionChangeType` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md) package instead.
*/
export declare enum SelectionChangeType {
/** Added to selection. */
Add = 0,
/** Removed from selection. */
Remove = 1,
/** Selection was replaced. */
Replace = 2,
/** Selection was cleared. */
Clear = 3
}
/**
* The event object that's sent when the selection changes.
* @public
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `StorageSelectionChangeEventArgs` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md) package instead.
*/
export interface SelectionChangeEventArgs {
/** The name of the selection source which caused the selection change. */
source: string;
/** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */
level: number;
/** The selection change type. */
changeType: SelectionChangeType;
/** Set of keys affected by this selection change event. */
keys: Readonly<KeySet>;
/** iModel connection with which the selection is associated with. */
imodel: IModelConnection;
/** The timestamp of when the selection change happened */
timestamp: Date;
/** Id of the ruleset associated with the selection change. */
rulesetId?: string;
}
//# sourceMappingURL=SelectionChangeEvent.d.ts.map