/*!
 * Copyright 2019 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { ClrDatagridFilter, ClrDatagridFilterInterface } from '@clr/angular';
import { Subject } from 'rxjs';
import { SubscriptionTracker } from '../../common/subscription/subscription-tracker';
import { ComponentRenderer, ComponentRendererConstructor, ComponentRendererSpec } from '../interfaces/component-renderer.interface';
import * as i0 from "@angular/core";
/**
 * Number of milliseconds delayed before emitting the filter has changed observable
 */
export declare const DEBOUNCE_TIME_FOR_GRID_FILTER_CHANGES = 300;
/**
 * Properties required by all the grid filters
 */
export interface FilterConfig<V> {
    /**
     * Used as a query field for server side filtering of the grid column
     */
    queryField?: string;
    /**
     * Value with which grid data can be filtered before initially being rendered
     */
    value?: V;
}
/**
 * Renderer specification of a column that contains component type to be rendered in a filter widget and configuration for that
 * component. used by the {@link ComponentRendererOutletDirective}
 */
export interface FilterRendererSpec<C> extends ComponentRendererSpec<C> {
    /**
     *  Config object required for the configuration of component that will be rendered in the column filter widget
     */
    config: C;
}
/**
 * Extended by filter components used in {@link DatagridComponent}. Those components can only be used inside a
 * clr-dg-filter component and are dynamically rendered by {@link ComponentRendererOutletDirective} using
 * {@link GridColumn.filter}
 * V is the type of filter input value that is passed into setValue method
 * C extends FilterConfig<V> is configuration of a filter that contains queryField and a value of type V
 * F is the specific FormGroup type used by the implementing filter component so that it can have type safety
 *   while the base class still knows that it's a FormGroup but doesn't care about its internal shape.
 */
export declare abstract class DatagridFilter<V, C extends FilterConfig<V>, F extends FormGroup = FormGroup> implements OnInit, ClrDatagridFilterInterface<V>, ComponentRenderer<C> {
    private subscriptionTracker;
    abstract formGroup: F;
    protected constructor(filterContainer: ClrDatagridFilter, subscriptionTracker: SubscriptionTracker);
    /**
     * Sets the configuration needed for a filter UI widget and also it's value.
     * Assigned from {@link ComponentRendererOutletDirective#assignValue} after the filter component is created.
     * Used by the getValue method in subclasses to format the FIQL string output.
     */
    protected _config: C;
    set config(val: C);
    get config(): C;
    /**
     * Emits whenever a filter form inputs changes
     */
    changes: Subject<void>;
    ngOnInit(): void;
    /**
     * To override the default delay time for emission of changes
     */
    protected getDebounceTimeMs(): number;
    /**
     * Called inside setter of {@link DatagridFilter#config} and Defined in the derived classes to perform some logic before
     * assigning the UI widget configuration and setting a value
     */
    protected onBeforeSetConfig(config: C): void;
    /**
     * Used for assigning a value to a filter from outside
     */
    abstract setValue(value: V): void;
    /**
     * For getting the filter UI widget values in FIQL formatted string
     */
    abstract getValue(): string;
    /**
     * Return true if the filter is currently activated (e.g. a value is provided)
     */
    abstract isActive(): boolean;
    /**
     * Required by Clarity but ignored since we don't support client side filtering
     */
    accepts(): boolean;
    /**
     * @see unit tests of subclass {@link DatagridStringFilterComponent} for unit tests of following methods
     */
    /**
     * Used in the {@link #getValue} method to make it part of the FIQL formatted string
     */
    get queryField(): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatagridFilter<any, any, any>, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<DatagridFilter<any, any, any>, never, never, { "config": "config"; }, {}, never, never, false, never>;
}
/**
 * Utility function to enforce type safety on config object of components of {@link ComponentRenderer} type. Used for creating
 * component renderer specifications of {@link FilterRendererSpec} type
 *
 * Example usage:
 * const gridColumn = {
 *   filterRendererSpec: FilterComponentRendererSpec({type: DatagridNumericFilterComponent, config: {value: [1, 2]}}),
 * }
 *
 * In the above examples these methods help in making sure that:
 * - Value "v" of the config property is of [number, number] type for gridColumn.filterRendererSpec
 *
 * #Note: 'C & {}' below makes the inference site for C be the constructor type from the first argument.
 * {@link https://stackoverflow.com/questions/59055154/typescript-generics-infer-type-from-the-type-of-function-arguments}
 */
export declare function FilterComponentRendererSpec<R, C>(componentRendererSpec: {
    type: ComponentRendererConstructor<C>;
    config: C & {};
}): FilterRendererSpec<C>;
