import { Filter, TableDropdownFilterData } from '../../../../types/src/table';
import { ReactiveController, ReactiveControllerHost } from 'lit';
import { default as CxTable } from './table';

export type FilterSource = 'search' | `dropdown:${string}`;
/**
 * A reactive controller to manage programmatic filter state across multiple sources (search, dropdowns).
 * Coordinates filter operations to prevent conflicts between different filter sources.
 *
 * Note: This controller only manages programmatic filters (set via search and dropdown sources).
 * Header filters (set directly on table columns) are managed separately by the Filter class
 * and are not affected by this controller's operations.
 *
 * The controller also preserves initialFilter (if set) when applying filters, ensuring that
 * initial filters are not lost when FilterController-managed filters are applied.
 */
export declare class FilterController implements ReactiveController {
    private readonly host;
    private readonly filters;
    private isConnected;
    constructor(host: ReactiveControllerHost & CxTable);
    hostConnected(): void;
    hostDisconnected(): void;
    hostUpdated(): void;
    /**
     * Set filters for a specific source, replacing any existing filters for that source.
     * @param source - The filter source identifier
     * @param filters - Array of filters to set for this source
     */
    setSourceFilters(source: FilterSource, filters: Filter[]): void;
    /**
     * Add a single filter to a specific source.
     * @param source - The filter source identifier
     * @param filterEntry - The filter to add
     */
    addFilter(source: FilterSource, filter: Filter): void;
    /**
     * Clear all filters for a specific source, or all filters if no source is provided.
     * @param source - Optional filter source identifier. If not provided, clears all filters.
     */
    clearSourceFilters(source?: FilterSource): void;
    /**
     * Removes sources for dropdown ids no longer present, clears sources when `defaultOption` is unset,
     * and applies filters for each configured `defaultOption`
     */
    syncDropdownFilterSources(configs: readonly TableDropdownFilterData[]): void;
    /**
     * Remove filters for a specific field, optionally scoped to a specific source.
     * @param field - The field name to remove filters for
     * @param source - Optional source to limit removal to
     */
    removeFieldFilters(field: string, source?: FilterSource): void;
    /**
     * Get all active programmatic filters from all sources managed by this controller.
     * Note: This does not include header filters (managed separately) or initialFilter
     * (which is included separately when applying filters).
     * @returns Array of all active programmatic filters from controller-managed sources
     */
    getFilters(): Filter[];
    /**
     * Get filters for a specific source.
     * @param source - The filter source identifier
     * @returns Array of filters for the specified source, or empty array if none exist
     */
    getSourceFilters(source: FilterSource): Filter[];
    /**
     * Check if a specific source has any active filters.
     * @param source - The filter source identifier
     * @returns True if the source has active filters
     */
    hasSourceFilters(source: FilterSource): boolean;
    /**
     * Reconcile all programmatic filters from all sources and apply them to the Tabulator instance.
     * This method replaces all existing programmatic filters (filterList) in Tabulator and
     * re-applies all filters from all sources to ensure consistency.
     *
     * Note: This only affects programmatic filters. Header filters are managed separately
     * by the Filter class and are not modified by this method.
     *
     * This method also includes initialFilter (if set) to ensure it is preserved when
     * FilterController applies its filters.
     */
    applyFilters(): void;
}
