import powerbi from "powerbi-visuals-api"; import { IFilterColumnTarget } from "powerbi-models"; import IVisualHost = powerbi.extensibility.visual.IVisualHost; import { IBehaviorOptions, BaseDataPoint, InteractivityBaseService, IInteractivityService, ISelectionHandler } from "./interactivityBaseService"; export interface FilterDataPoint extends BaseDataPoint { category: powerbi.PrimitiveValue; } export interface IFilterBehaviorOptions extends IBehaviorOptions { dataView: DataView; category: powerbi.DataViewCategoryColumn; jsonFilters: powerbi.IFilter[]; } export declare function extractFilterColumnTarget(categoryColumn: powerbi.DataViewCategoryColumn | powerbi.DataViewMetadataColumn): IFilterColumnTarget; export declare class InteractivityFilterService extends InteractivityBaseService implements IInteractivityService, ISelectionHandler { private hostServices; private selectedCategories; private filterColumnTarget; private filterObjectProperty; constructor(hostServices: IVisualHost); bind(options: IFilterBehaviorOptions): void; applySelectionStateToData(dataPoints: FilterDataPoint[], hasHighlights?: boolean): boolean; /** * 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: FilterDataPoint | FilterDataPoint[], multiSelect: boolean): void; protected takeSelectionStateFromDataPoints(dataPoints: FilterDataPoint[]): void; protected sendSelectionToHost(): void; private syncSelectionStateInverted; private selectSingleDataPoint; private removeCategory; private updateSelectableDataPointsBySelectedCategories; private isDataPointSelected; } /** * Factory method to create an IInteractivityService instance. */ export declare function createInteractivityFilterService(hostServices: IVisualHost): IInteractivityService;