/**
* DevExtreme (ui/filter_builder.d.ts)
* Version: 21.1.0 (build 21016-0316)
* Build date: Sat Jan 16 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
    dxElement
} from '../core/element';

import {
    template
} from '../core/templates/template';

import Store from '../data/abstract_store';

import {
    DataSourceOptions
} from '../data/data_source';

import Widget, {
    format,
    WidgetOptions
} from './widget/ui.widget';

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFilterBuilderOptions extends WidgetOptions<dxFilterBuilder> {
    /**
     */
    allowHierarchicalFields?: boolean;
    /**
     */
    customOperations?: Array<dxFilterBuilderCustomOperation>;
    /**
     */
    fields?: Array<dxFilterBuilderField>;
    /**
     */
    filterOperationDescriptions?: {
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      between?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      contains?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      endsWith?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      equal?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      greaterThan?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      greaterThanOrEqual?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      isBlank?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      isNotBlank?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      lessThan?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      lessThanOrEqual?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      notContains?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      notEqual?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      startsWith?: string
    };
    /**
     */
    groupOperationDescriptions?: {
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      and?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      notAnd?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      notOr?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      or?: string
    };
    /**
     */
    groupOperations?: Array<'and' | 'or' | 'notAnd' | 'notOr'>;
    /**
     */
    maxGroupLevel?: number;
    /**
     */
    onEditorPrepared?: ((e: { component?: dxFilterBuilder, element?: dxElement, model?: any, value?: any, setValue?: any, editorElement?: dxElement, editorName?: string, dataField?: string, filterOperation?: string, updateValueTimeout?: number, width?: number, readOnly?: boolean, disabled?: boolean, rtlEnabled?: boolean }) => any);
    /**
     */
    onEditorPreparing?: ((e: { component?: dxFilterBuilder, element?: dxElement, model?: any, value?: any, setValue?: any, cancel?: boolean, editorElement?: dxElement, editorName?: string, editorOptions?: any, dataField?: string, filterOperation?: string, updateValueTimeout?: number, width?: number, readOnly?: boolean, disabled?: boolean, rtlEnabled?: boolean }) => any);
    /**
     */
    onValueChanged?: ((e: { component?: dxFilterBuilder, element?: dxElement, model?: any, value?: any, previousValue?: any }) => any);
    /**
     */
    value?: string | Array<any> | Function;
}
/**
 */
export default class dxFilterBuilder extends Widget {
    constructor(element: Element, options?: dxFilterBuilderOptions)
    constructor(element: JQuery, options?: dxFilterBuilderOptions)
    /**
     */
    getFilterExpression(): string | Array<any> | Function;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFilterBuilderCustomOperation {
    /**
     */
    calculateFilterExpression?: ((filterValue: any, field: dxFilterBuilderField) => string | Array<any> | Function);
    /**
     */
    caption?: string;
    /**
     */
    customizeText?: ((fieldInfo: { value?: string | number | Date, valueText?: string, field?: dxFilterBuilderField }) => string);
    /**
     */
    dataTypes?: Array<'string' | 'number' | 'date' | 'boolean' | 'object' | 'datetime'>;
    /**
     */
    editorTemplate?: template | ((conditionInfo: { value?: string | number | Date, field?: dxFilterBuilderField, setValue?: Function }, container: dxElement) => string | Element | JQuery);
    /**
     */
    hasValue?: boolean;
    /**
     */
    icon?: string;
    /**
     */
    name?: string;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFilterBuilderField {
    /**
     */
    calculateFilterExpression?: ((filterValue: any, selectedFilterOperation: string) => string | Array<any> | Function);
    /**
     */
    caption?: string;
    /**
     */
    customizeText?: ((fieldInfo: { value?: string | number | Date, valueText?: string }) => string);
    /**
     */
    dataField?: string;
    /**
     */
    dataType?: 'string' | 'number' | 'date' | 'boolean' | 'object' | 'datetime';
    /**
     */
    editorOptions?: any;
    /**
     */
    editorTemplate?: template | ((conditionInfo: { value?: string | number | Date, filterOperation?: string, field?: dxFilterBuilderField, setValue?: Function }, container: dxElement) => string | Element | JQuery);
    /**
     */
    falseText?: string;
    /**
     */
    filterOperations?: Array<'=' | '<>' | '<' | '<=' | '>' | '>=' | 'contains' | 'endswith' | 'isblank' | 'isnotblank' | 'notcontains' | 'startswith' | 'between' | string>;
    /**
     */
    format?: format;
    /**
     */
    lookup?: {
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      allowClearing?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      dataSource?: Array<any> | DataSourceOptions | Store,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      displayExpr?: string | ((data: any) => string),
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      valueExpr?: string | ((data: any) => string | number | boolean)
    };
    /**
     */
    name?: string;
    /**
     */
    trueText?: string;
}

declare global {
interface JQuery {
    dxFilterBuilder(): JQuery;
    dxFilterBuilder(options: "instance"): dxFilterBuilder;
    dxFilterBuilder(options: string): any;
    dxFilterBuilder(options: string, ...params: any[]): any;
    dxFilterBuilder(options: dxFilterBuilderOptions): JQuery;
}
}
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export type Options = dxFilterBuilderOptions;

/** @deprecated use Options instead */
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export type IOptions = dxFilterBuilderOptions;
