/** @packageDocumentation * @module UnifiedSelection */ import { Id64Arg, IDisposable } from "@bentley/bentleyjs-core"; import { IModelConnection } from "@bentley/imodeljs-frontend"; import { Keys, KeySet, SelectionScope, SelectionScopeProps } from "@bentley/presentation-common"; import { HiliteSet } from "./HiliteSetProvider"; import { ISelectionProvider } from "./ISelectionProvider"; import { SelectionChangeEvent } from "./SelectionChangeEvent"; import { SelectionScopesManager } from "./SelectionScopesManager"; /** * Properties for creating [[SelectionManager]]. * @public */ export interface SelectionManagerProps { /** A manager for [selection scopes]($docs/learning/presentation/Unified-Selection/Terminology#selection-scope) */ scopes: SelectionScopesManager; } /** * The selection manager which stores the overall selection. * @public */ export declare class SelectionManager implements ISelectionProvider { private _selectionContainerMap; private _imodelToolSelectionSyncHandlers; private _hiliteSetProviders; /** An event which gets broadcasted on selection changes */ readonly selectionChange: SelectionChangeEvent; /** Manager for [selection scopes]($docs/learning/presentation/Unified-Selection/Terminology#selection-scope) */ readonly scopes: SelectionScopesManager; /** * Creates an instance of SelectionManager. */ constructor(props: SelectionManagerProps); private onConnectionClose; private getContainer; /** * Request the manager to sync with imodel's tool selection (see `IModelConnection.selectionSet`). */ setSyncWithIModelToolSelection(imodel: IModelConnection, sync?: boolean): void; /** * Temporarily suspends tool selection synchronization until the returned `IDisposable` * is disposed. */ suspendIModelToolSelectionSync(imodel: IModelConnection): IDisposable; /** Get the selection levels currently stored in this manager for the specified imodel */ getSelectionLevels(imodel: IModelConnection): number[]; /** Get the selection currently stored in this manager */ getSelection(imodel: IModelConnection, level?: number): Readonly; private handleEvent; /** * Add keys to the selection * @param source Name of the selection source * @param imodel iModel associated with the selection * @param keys Keys to add * @param level Selection level (see [Selection levels]($docs/learning/presentation/Unified-Selection/Terminology#selection-level)) * @param rulesetId ID of the ruleset in case the selection was changed from a rules-driven control */ addToSelection(source: string, imodel: IModelConnection, keys: Keys, level?: number, rulesetId?: string): void; /** * Remove keys from current selection * @param source Name of the selection source * @param imodel iModel associated with the selection * @param keys Keys to remove * @param level Selection level (see [Selection levels]($docs/learning/presentation/Unified-Selection/Terminology#selection-level)) * @param rulesetId ID of the ruleset in case the selection was changed from a rules-driven control */ removeFromSelection(source: string, imodel: IModelConnection, keys: Keys, level?: number, rulesetId?: string): void; /** * Replace current selection * @param source Name of the selection source * @param imodel iModel associated with the selection * @param keys Keys to add * @param level Selection level (see [Selection levels]($docs/learning/presentation/Unified-Selection/Terminology#selection-level)) * @param rulesetId ID of the ruleset in case the selection was changed from a rules-driven control */ replaceSelection(source: string, imodel: IModelConnection, keys: Keys, level?: number, rulesetId?: string): void; /** * Clear current selection * @param source Name of the selection source * @param imodel iModel associated with the selection * @param level Selection level (see [Selection levels]($docs/learning/presentation/Unified-Selection/Terminology#selection-level)) * @param rulesetId ID of the ruleset in case the selection was changed from a rules-driven control */ clearSelection(source: string, imodel: IModelConnection, level?: number, rulesetId?: string): void; /** * Add keys to selection after applying [selection scope]($docs/learning/presentation/Unified-Selection/Terminology#selection-scope) on them. * @param source Name of the selection source * @param imodel iModel associated with the selection * @param ids Element IDs to add * @param scope Selection scope to apply * @param level Selection level (see [Selection levels]($docs/learning/presentation/Unified-Selection/Terminology#selection-level)) * @param rulesetId ID of the ruleset in case the selection was changed from a rules-driven control */ addToSelectionWithScope(source: string, imodel: IModelConnection, ids: Id64Arg, scope: SelectionScopeProps | SelectionScope | string, level?: number, rulesetId?: string): Promise; /** * Remove keys from current selection after applying [selection scope]($docs/learning/presentation/Unified-Selection/Terminology#selection-scope) on them. * @param source Name of the selection source * @param imodel iModel associated with the selection * @param ids Element IDs to remove * @param scope Selection scope to apply * @param level Selection level (see [Selection levels]($docs/learning/presentation/Unified-Selection/Terminology#selection-level)) * @param rulesetId ID of the ruleset in case the selection was changed from a rules-driven control */ removeFromSelectionWithScope(source: string, imodel: IModelConnection, ids: Id64Arg, scope: SelectionScopeProps | SelectionScope | string, level?: number, rulesetId?: string): Promise; /** * Replace current selection with keys after applying [selection scope]($docs/learning/presentation/Unified-Selection/Terminology#selection-scope) on them. * @param source Name of the selection source * @param imodel iModel associated with the selection * @param ids Element IDs to replace with * @param scope Selection scope to apply * @param level Selection level (see [Selection levels]($docs/learning/presentation/Unified-Selection/Terminology#selection-level)) * @param rulesetId ID of the ruleset in case the selection was changed from a rules-driven control */ replaceSelectionWithScope(source: string, imodel: IModelConnection, ids: Id64Arg, scope: SelectionScopeProps | SelectionScope | string, level?: number, rulesetId?: string): Promise; /** * Get the current hilite set for the specified imodel * @public */ getHiliteSet(imodel: IModelConnection): Promise; } /** @internal */ export declare const TRANSIENT_ELEMENT_CLASSNAME = "/TRANSIENT"; /** @internal */ export declare class ToolSelectionSyncHandler implements IDisposable { private _selectionSourceName; private _logicalSelection; private _imodel; private _imodelToolSelectionListenerDisposeFunc; private _asyncsTracker; isSuspended?: boolean; constructor(imodel: IModelConnection, logicalSelection: SelectionManager); dispose(): void; /** note: used only it tests */ get pendingAsyncs(): Set; private onToolSelectionChanged; } //# sourceMappingURL=SelectionManager.d.ts.map