/**
* DevExtreme (ui/form.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 '../jquery_augmentation';

import {
    dxElement
} from '../core/element';

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

import dxButton, {
    dxButtonOptions
} from './button';

import Editor from './editor/editor';

import {
    dxTabPanelOptions
} from './tab_panel';

import {
    AsyncRule,
    CompareRule,
    CustomRule,
    EmailRule,
    NumericRule,
    PatternRule,
    RangeRule,
    RequiredRule,
    StringLengthRule
} from './validation_rules';

import {
    dxValidationGroupResult
} from './validation_group';

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

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFormOptions extends WidgetOptions<dxForm> {
    /**
     */
    alignItemLabels?: boolean;
    /**
     */
    alignItemLabelsInAllGroups?: boolean;
    /**
     */
    colCount?: number | 'auto';
    /**
     */
    colCountByScreen?: any;
    /**
     */
    customizeItem?: ((item: dxFormSimpleItem | dxFormGroupItem | dxFormTabbedItem | dxFormEmptyItem | dxFormButtonItem) => any);
    /**
     */
    formData?: any;
    /**
     */
    items?: Array<dxFormSimpleItem | dxFormGroupItem | dxFormTabbedItem | dxFormEmptyItem | dxFormButtonItem>;
    /**
     */
    labelLocation?: 'left' | 'right' | 'top';
    /**
     */
    minColWidth?: number;
    /**
     */
    onEditorEnterKey?: ((e: { component?: dxForm, element?: dxElement, model?: any, dataField?: string }) => any);
    /**
     */
    onFieldDataChanged?: ((e: { component?: dxForm, element?: dxElement, model?: any, dataField?: string, value?: any }) => any);
    /**
     */
    optionalMark?: string;
    /**
     */
    readOnly?: boolean;
    /**
     */
    requiredMark?: string;
    /**
     */
    requiredMessage?: string;
    /**
     */
    screenByWidth?: Function;
    /**
     */
    scrollingEnabled?: boolean;
    /**
     */
    showColonAfterLabel?: boolean;
    /**
     */
    showOptionalMark?: boolean;
    /**
     */
    showRequiredMark?: boolean;
    /**
     */
    showValidationSummary?: boolean;
    /**
     */
    validationGroup?: string;
}
/**
 */
export default class dxForm extends Widget {
    constructor(element: Element, options?: dxFormOptions)
    constructor(element: JQuery, options?: dxFormOptions)
    /**
     */
    getButton(name: string): dxButton | undefined;
    /**
     */
    getEditor(dataField: string): Editor | undefined;
    /**
     */
    itemOption(id: string): any;
    /**
     */
    itemOption(id: string, option: string, value: any): void;
    /**
     */
    itemOption(id: string, options: any): void;
    /**
     */
    resetValues(): void;
    /**
     */
    updateData(data: any): void;
    /**
     */
    updateData(dataField: string, value: any): void;
    /**
     */
    updateDimensions(): Promise<void> & JQueryPromise<void>;
    /**
     */
    validate(): dxValidationGroupResult;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFormButtonItem {
    /**
     */
    buttonOptions?: dxButtonOptions;
    /**
     */
    colSpan?: number;
    /**
     */
    cssClass?: string;
    /**
     */
    horizontalAlignment?: 'center' | 'left' | 'right';
    /**
     */
    itemType?: 'empty' | 'group' | 'simple' | 'tabbed' | 'button';
    /**
     */
    name?: string;
    /**
     */
    verticalAlignment?: 'bottom' | 'center' | 'top';
    /**
     */
    visible?: boolean;
    /**
     */
    visibleIndex?: number;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFormEmptyItem {
    /**
     */
    colSpan?: number;
    /**
     */
    cssClass?: string;
    /**
     */
    itemType?: 'empty' | 'group' | 'simple' | 'tabbed' | 'button';
    /**
     */
    name?: string;
    /**
     */
    visible?: boolean;
    /**
     */
    visibleIndex?: number;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFormGroupItem {
    /**
     */
    alignItemLabels?: boolean;
    /**
     */
    caption?: string;
    /**
     */
    colCount?: number;
    /**
     */
    colCountByScreen?: any;
    /**
     */
    colSpan?: number;
    /**
     */
    cssClass?: string;
    /**
     */
    itemType?: 'empty' | 'group' | 'simple' | 'tabbed' | 'button';
    /**
     */
    items?: Array<dxFormSimpleItem | dxFormGroupItem | dxFormTabbedItem | dxFormEmptyItem | dxFormButtonItem>;
    /**
     */
    name?: string;
    /**
     */
    template?: template | ((data: { component?: dxForm, formData?: any }, itemElement: dxElement) => string | Element | JQuery);
    /**
     */
    visible?: boolean;
    /**
     */
    visibleIndex?: number;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFormSimpleItem {
    /**
     */
    colSpan?: number;
    /**
     */
    cssClass?: string;
    /**
     */
    dataField?: string;
    /**
     */
    editorOptions?: any;
    /**
     */
    editorType?: 'dxAutocomplete' | 'dxCalendar' | 'dxCheckBox' | 'dxColorBox' | 'dxDateBox' | 'dxDropDownBox' | 'dxHtmlEditor' | 'dxLookup' | 'dxNumberBox' | 'dxRadioGroup' | 'dxRangeSlider' | 'dxSelectBox' | 'dxSlider' | 'dxSwitch' | 'dxTagBox' | 'dxTextArea' | 'dxTextBox';
    /**
     */
    helpText?: string;
    /**
     */
    isRequired?: boolean;
    /**
     */
    itemType?: 'empty' | 'group' | 'simple' | 'tabbed' | 'button';
    /**
     */
    label?: {
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      alignment?: 'center' | 'left' | 'right',
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      location?: 'left' | 'right' | 'top',
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      showColon?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      text?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      visible?: boolean
    };
    /**
     */
    name?: string;
    /**
     */
    template?: template | ((data: { component?: dxForm, dataField?: string, editorOptions?: any, editorType?: string, name?: string }, itemElement: dxElement) => string | Element | JQuery);
    /**
     */
    validationRules?: Array<RequiredRule | NumericRule | RangeRule | StringLengthRule | CustomRule | CompareRule | PatternRule | EmailRule | AsyncRule>;
    /**
     */
    visible?: boolean;
    /**
     */
    visibleIndex?: number;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFormTabbedItem {
    /**
     */
    colSpan?: number;
    /**
     */
    cssClass?: string;
    /**
     */
    itemType?: 'empty' | 'group' | 'simple' | 'tabbed' | 'button';
    /**
     */
    name?: string;
    /**
     */
    tabPanelOptions?: dxTabPanelOptions;
    /**
     */
    tabs?: Array<{
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      alignItemLabels?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      badge?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      colCount?: number,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      colCountByScreen?: any,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      disabled?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      icon?: string,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      items?: Array<dxFormSimpleItem | dxFormGroupItem | dxFormTabbedItem | dxFormEmptyItem | dxFormButtonItem>,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      tabTemplate?: template | ((tabData: any, tabIndex: number, tabElement: dxElement) => any),
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      template?: template | ((tabData: any, tabIndex: number, tabElement: dxElement) => any),
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      title?: string
    }>;
    /**
     */
    visible?: boolean;
    /**
     */
    visibleIndex?: number;
}

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

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