import { Query } from '@vizzly/sqlbuilder-public';
import { QueryAttributes } from '../QueryAttributes/types';
import * as FilterType from './constants';
export declare type FilterConfig = {
    /** Quick-access filters added to each view */
    localFilters?: Array<AdditionalFilter>;
    /** Filters existing on the dashboard level */
    globalFilters?: Array<AdditionalFilter>;
    /** Filters existing in the "advanced" section of the data panel */
    viewFilters?: QueryAttributes['filter'];
};
export declare type AdditionalFilter = NumericFilter | SingleSelectFilter | DateFilter | DateAndTimeFilter | DateTimeFilter | MultiSelectFilter | AdvancedFilter;
export declare type Field = {
    dataSetId: string;
    fieldId: QueryAttributes.Field;
};
declare type AdditionalFilterType = typeof FilterType.DATE_FILTER | typeof FilterType.DATE_TIME_FILTER | typeof FilterType.DATE_AND_TIME_FILTER | typeof FilterType.SINGLE_SELECT_FILTER | typeof FilterType.MULTI_SELECT_FILTER | typeof FilterType.NUMERIC_FILTER | typeof FilterType.ADVANCED_FILTER;
export declare type OptionalFilters = {
    [dataSetId: string]: Query['filter'];
};
declare type BaseAdditionalFilter<T extends AdditionalFilterType> = {
    /**
     * NOTE:
     * - The "dateTimeFilter" type value has been deprecated. Use "dateFilter".
     * - The "dateAndTimeFilter" type value has been deprecated. Use "dateFilter".
     * - The "numericFilter" type value has been deprecated. Use "advancedFilter".
     */
    type: T;
    appliesToFields: Array<Field>;
    /**
     * Has this additional filter been defined by a configuration?
     * Either as a prop to the dashboard, or in the data set config.
     */
    managedByConfiguration: boolean;
    /**
     * Does this filter require a value before it
     * can allow a chart or entire dashboard to
     * render?
     * */
    requiresValue: boolean;
    title?: string;
    optionsFilters?: OptionalFilters;
    options?: Array<{
        value: any;
        label: string;
    }>;
    hidden?: boolean;
};
export declare type RelativeRangeValue = {
    type: 'relativeRange';
    filters: Array<QueryAttributes.Filter>[];
};
declare type FixedRangeValue = {
    type: 'fixedRange';
    before: Date | null;
    after: Date | null;
};
declare type RelativeValue = {
    type: 'relative';
    value: string;
};
export declare type DateFilter = BaseAdditionalFilter<typeof FilterType.DATE_FILTER> & {
    value: FixedRangeValue | RelativeValue | RelativeRangeValue | null;
    inclusiveDate?: boolean;
    allowTimeSelection?: boolean;
};
/**
 * @deprecated The "dateAndTimeFilter" has been deprecated. Use "dateFilter" and set the option "allowTimeSelection" to true.
 */
export declare type DateAndTimeFilter = BaseAdditionalFilter<typeof FilterType.DATE_AND_TIME_FILTER> & {
    value: FixedRangeValue | RelativeValue | RelativeRangeValue | null;
    inclusiveDate?: boolean;
};
/**
 * @deprecated The "dateTimeFilter" has been deprecated. Use "dateFilter".
 */
export declare type DateTimeFilter = BaseAdditionalFilter<typeof FilterType.DATE_TIME_FILTER> & {
    value: FixedRangeValue | RelativeValue | null;
};
export declare type LegacyNumericFilterValue = {
    op: '>' | '<' | '=' | '!=' | '>=' | '<=';
    value: number;
};
export declare type NumericFilter = BaseAdditionalFilter<typeof FilterType.NUMERIC_FILTER> & {
    value: LegacyNumericFilterValue | QueryAttributes.Filter[][] | null;
};
export declare type SingleSelectFilter = BaseAdditionalFilter<typeof FilterType.SINGLE_SELECT_FILTER> & {
    value: string | number | boolean | null;
    optionsPulledFrom?: Array<Field>;
};
export declare type MultiSelectFilter = BaseAdditionalFilter<typeof FilterType.MULTI_SELECT_FILTER> & {
    value: string[] | number[] | null | QueryAttributes.Filter[][];
    optionsPulledFrom?: Array<Field>;
};
export declare type AdvancedFilter = BaseAdditionalFilter<typeof FilterType.ADVANCED_FILTER> & {
    value: QueryAttributes.Filter[][] | null;
    optionsPulledFrom?: Array<Field>;
};
export declare type TimeRangeOptions = {
    [id: string]: {
        range: {
            after: Date;
            before: Date;
        };
        description: string;
    };
};
export declare type DateAndTimeRangeOptions = {
    [id: string]: {
        range: {
            afterDate: Date;
            afterTime: string;
            beforeDate: Date;
            beforeTime: string;
        };
        description: string;
    };
};
export {};
