import "./DisposePolyfill.js";
import { ECClassHierarchyInspector, ECSqlQueryExecutor } from "@itwin/presentation-shared";
import { CachingHiliteSetProvider } from "./CachingHiliteSetProvider.js";
import { HiliteSetProvider } from "./HiliteSetProvider.js";
import { SelectionScope } from "./SelectionScope.js";
import { SelectionStorage } from "./SelectionStorage.js";
import { CoreIModelHiliteSet, CoreIModelSelectionSet } from "./types/IModel.js";
/**
 * Props for `enableUnifiedSelectionSyncWithIModel`.
 * @public
 */
export interface EnableUnifiedSelectionSyncWithIModelProps {
    /**
     * Provides access to different iModel's features: query executing, class hierarchy, selection and hilite sets.
     *
     * It's recommended to use `@itwin/presentation-core-interop` to create `key`, `ECSqlQueryExecutor` and `ECSchemaProvider` from
     * [IModelConnection](https://www.itwinjs.org/reference/core-frontend/imodelconnection/imodelconnection/), and map its
     * `hilited` and `selectionSet` attributes like this:
     *
     * ```ts
     * import { createECSqlQueryExecutor, createECSchemaProvider, createIModelKey } from "@itwin/presentation-core-interop";
     * import { createCachingECClassHierarchyInspector } from "@itwin/presentation-shared";
     * import { IModelConnection } from "@itwin/core-frontend";
     *
     * const imodel: IModelConnection = ...
     * const imodelAccess = {
     *   ...createECSqlQueryExecutor(imodel),
     *   ...createCachingECClassHierarchyInspector({ schemaProvider: createECSchemaProvider(MyAppFrontend.getSchemaContext(imodel)) }),
     *   key: createIModelKey(imodel),
     *   hiliteSet: imodel.hilited,
     *   selectionSet: imodel.selectionSet,
     * };
     * ```
     */
    imodelAccess: ECSqlQueryExecutor & ECClassHierarchyInspector & {
        /** Key of the iModel. Generally taken from `IModelConnection.key`. */
        readonly key: string;
        /** The set of currently hilited elements taken from `IModelConnection.hilited`. */
        readonly hiliteSet: CoreIModelHiliteSet;
        /** The set of currently selected elements taken from `IModelConnection.selectionSet`. */
        readonly selectionSet: CoreIModelSelectionSet;
    };
    /**
     * Unified selection storage to synchronize IModel's tool selection with. The storage should be shared
     * across all components in the application to ensure unified selection experience.
     */
    selectionStorage: SelectionStorage;
    /** Active selection scope provider. */
    activeScopeProvider: () => SelectionScope;
    /**
     * A caching hilite set provider used to retrieve hilite sets for an iModel. If not provided, a new `CachingHiliteSetProvider`
     * will be created for the given iModel using the provided `imodelAccess`.
     * If the consuming application already has a `CachingHiliteSetProvider` defined, it should be provided instead
     * to reuse the cache and avoid creating new providers for each iModel.
     *
     * The type is defined in a way that makes it required for provider to have either the deprecated `dispose` or the
     * new `Symbol.dispose` method.
     */
    cachingHiliteSetProvider?: CachingHiliteSetProvider | (Omit<CachingHiliteSetProvider, "dispose"> & {
        [Symbol.dispose]: () => void;
    });
}
/**
 * Enables synchronization between iModel selection and unified selection.
 * @returns function for disposing the synchronization.
 * @public
 */
export declare function enableUnifiedSelectionSyncWithIModel(props: EnableUnifiedSelectionSyncWithIModelProps): () => void;
/**
 * A handler that syncs selection between unified selection storage (`SelectionStorage`) and
 * an iModel (`iModel.selectionSet`, `iModel.hilited`).
 *
 * @internal
 */
export declare class IModelSelectionHandler {
    private _selectionSourceName;
    private _imodelAccess;
    private _selectionStorage;
    private _hiliteSetProvider;
    private _cachingHiliteSetProvider;
    private _activeScopeProvider;
    private _isSuspended;
    private _cancelOngoingChanges;
    private _unregisterUnifiedSelectionListener;
    private _unregisterIModelSelectionSetListener;
    private _hasCustomCachingHiliteSetProvider;
    constructor(props: EnableUnifiedSelectionSyncWithIModelProps & {
        hiliteSetProvider?: HiliteSetProvider;
    });
    [Symbol.dispose](): void;
    /** Temporarily suspends tool selection synchronization until the returned disposable object is disposed. */
    suspendIModelToolSelectionSync(): {
        [Symbol.dispose]: () => void;
    };
    private handleUnifiedSelectionChange;
    private onUnifiedSelectionChanged;
    private applyCurrentHiliteSet;
    private addHiliteSet;
    private removeHiliteSet;
    private onIModelSelectionChanged;
    private handleIModelSelectionChange;
    private getSelectionSetChangeIds;
}
//# sourceMappingURL=EnableUnifiedSelectionSyncWithIModel.d.ts.map