import powerbi from "powerbi-visuals-api"; import IVisualHost = powerbi.extensibility.visual.IVisualHost; import { IBehaviorOptions, BaseDataPoint, InteractivityBaseService, IInteractivityService, ISelectionHandler } from "./interactivityBaseService"; export interface SelectableDataPoint extends BaseDataPoint { identity: powerbi.extensibility.ISelectionId; /** * A specific identity for when data points exist at a finer granularity than * selection is performed. For example, if your data points should select based * only on series even if they exist as category/series intersections. */ specificIdentity?: powerbi.extensibility.ISelectionId; } export declare class InteractivitySelectionService extends InteractivityBaseService> implements IInteractivityService, ISelectionHandler { private selectionManager; constructor(hostServices: IVisualHost); /** * Sets the selected state of all selectable data points to false and invokes the behavior's select command. */ clearSelection(): void; handleContextMenu(dataPoint: SelectableDataPoint, point: powerbi.extensibility.IPoint): void; applySelectionStateToData(dataPoints: SelectableDataPoint[], hasHighlights?: boolean): boolean; /** * Apply new selections to change internal state of interactivity service */ restoreSelection(): void; /** * Checks whether there is at least one item selected. */ hasSelection(): boolean; /** * Syncs the selection state for all data points that have the same category. Returns * true if the selection state was out of sync and corrections were made; false if * the data is already in sync with the service. * * If the data is not compatible with the current service's current selection state, * the state is cleared and the cleared selection is sent to the host. * * Ignores series for now, since we don't support series selection at the moment. */ syncSelectionState(): void; protected select(dataPoints: SelectableDataPoint | SelectableDataPoint[], multiSelect: boolean): void; protected takeSelectionStateFromDataPoints(dataPoints: SelectableDataPoint[]): void; protected sendSelectionToHost(): void; private syncSelectionStateInverted; private updateSelectableDataPointsBySelectedIds; private isDataPointSelected; } /** * Factory method to create an IInteractivityService instance. */ export declare function createInteractivitySelectionService(hostServices: IVisualHost): IInteractivityService;