import type { ReactNode } from 'react';
import type { IFormFeedback as InnerFormFeedback, Form as FormType, FieldPatternTypes } from '@formily/core';
import type { IFormLayoutProps } from '@teamix/formily';
import type { CommonRequestConfig } from '@teamix/utils';
import type { UrlStateOptions } from '@teamix/hooks';
import React from 'react';
interface AnyObject {
    [propName: string]: any;
}
declare type FieldDisplayTypes = 'none' | 'hidden' | 'visible';
export interface ProFormInitializeItem {
    (item: ProFormSchemaItem, props?: any): ProFormSchemaItem;
}
/**
 * ProForm 实例类型
 */
export declare type ProFormType = FormType;
/**
 * ProForm 反馈类型
 */
export declare type IFormFeedback = InnerFormFeedback;
declare type IBaseComponent = 'Input' | 'Password' | 'TextArea' | 'NumberPicker' | 'Percent' | 'Money' | 'Select' | 'MultipleSelect' | 'TreeSelect' | 'Cascader' | 'MultipleCascader' | 'ArbitraryCascader' | 'Radio' | 'Checkbox' | 'Switch' | 'DatePicker' | 'TimePicker' | 'DateTimePicker' | 'WeekPicker' | 'MonthPicker' | 'YearPicker' | 'QuarterPicker' | 'DateRangePicker' | 'TimeRangePicker' | 'DateTimeRangePicker' | 'WeekRangePicker' | 'MonthRangePicker' | 'YearRangePicker' | 'QuarterRangePicker' | 'Transfer' | 'Upload' | 'ColorPicker' | 'ColorRadio' | 'IconPicker' | 'JsonInput' | 'TagPicker' | 'MultipleTagPicker' | 'Range' | 'Search' | 'SelectGroup' | 'SelectTable' | 'SelectTable.Column';
declare type IButtonComponent = 'Submit' | 'Reset';
declare type IComboComponent = 'ArrayCards' | 'ArrayCards.Addition' | 'ArrayCards.Remove' | 'ArrayCards.MoveUp' | 'ArrayCards.MoveDown' | 'ArrayCards.Index' | 'ArrayCollapse' | 'ArrayCollapse.CollapsePanel' | 'ArrayCollapse.Addition' | 'ArrayCollapse.Remove' | 'ArrayCollapse.MoveUp' | 'ArrayCollapse.MoveDown' | 'ArrayCollapse.Index' | 'ArrayTable' | 'ArrayTable.Column' | 'ArrayTable.SortHandle' | 'ArrayTable.Addition' | 'ArrayTable.Remove' | 'ArrayTable.MoveDown' | 'ArrayTable.MoveUp' | 'ArrayTable.Index' | 'ArrayItems' | 'ArrayItems.Item' | 'ArrayItems.SortHandle' | 'ArrayItems.Addition' | 'ArrayItems.Remove' | 'ArrayItems.MoveDown' | 'ArrayItems.MoveUp' | 'ArrayItems.Index' | 'Editable' | 'Editable.Popover' | 'Editable.Dialog' | 'Editable.Drawer';
declare type ILayoutComponent = 'FormFlex' | 'FormGrid' | 'FormGroup' | 'FormGroup.GroupPanel' | 'Search' | 'Search.SearchPanel' | 'FormTab' | 'FormTab.TabPane' | 'FormStep' | 'FormStep.StepPane' | 'FormCollapse' | 'FormCollapse.CollapsePanel' | 'FormButtonGroup' | 'FormDialog' | 'FormDrawer' | 'FormDialog.Footer' | 'FormDrawer.Footer';
export interface ProFormCommonRequestConfig extends CommonRequestConfig {
    beforeRequest?: (field?: any, context?: any) => any;
    formatResult?: (res?: any, field?: any, context?: any) => any;
    onSuccess?: (res?: any, field?: any, context?: any) => any;
}
export interface ProFormRequestConfig extends Omit<ProFormCommonRequestConfig, 'url'> {
    url?: string;
    customRequest?: (field?: any, context?: any) => Promise<any>;
    extraConfig?: AnyObject;
    onComplete?: (res?: any, field?: any, context?: any) => any;
}
export interface CascadeWhen {
    left: string;
    op: string;
    right: any;
}
export interface Cascade {
    when: CascadeWhen[];
    logic?: '||' | '&&';
    props?: any;
    state?: any;
    dataSourceFilter?: any[];
    dataSourceHide?: any[];
}
export interface OnChange {
    when: CascadeWhen[];
    logic?: '||' | '&&';
    values: any;
}
export interface ProFormSchemaItem {
    type?: string;
    name?: string;
    description?: React.ReactNode;
    title?: string;
    component?: IBaseComponent | IButtonComponent | IComboComponent | ILayoutComponent | any;
    props?: AnyObject | any;
    decorator?: string | null;
    decoratorProps?: AnyObject;
    dataSource?: any[] | string | ProFormRequestConfig;
    reactions?: any;
    rules?: any;
    items?: ProFormSchemaItem;
    children?: ProFormSchemaItem[];
    content?: any;
    tooltip?: string;
    required?: boolean;
    display?: FieldDisplayTypes;
    visible?: boolean | string;
    hidden?: boolean | string;
    disabled?: boolean | string;
    readOnly?: boolean | string;
    readPretty?: boolean | string;
    pattern?: FieldPatternTypes;
    default?: any;
    request?: ProFormRequestConfig | ProFormRequestConfig[];
    data?: AnyObject;
    cascade?: Cascade[];
    onChange?: OnChange[];
}
export declare type ProFormSchema = ProFormSchemaItem[];
interface AutoLayout {
    autoLabel?: boolean;
}
export interface ProFormProps extends Omit<IFormLayoutProps, 'breakpoints'> {
    form?: FormType | false;
    schema?: ProFormSchema;
    scope?: any;
    context?: any;
    components?: {
        [key: string]: React.FC | React.ComponentClass;
    };
    children?: React.ReactNode;
    initialValues?: AnyObject;
    initialRequest?: ProFormCommonRequestConfig;
    previewTextPlaceholder?: ReactNode;
    validateFirst?: boolean;
    onChangeType?: 'form';
    onChange?: (values: any, fieldValue?: any, fieldName?: any) => any;
    onSubmit?: ((values: any) => any) | CommonRequestConfig;
    onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
    onInitialComplete?: (form: FormType) => void;
    breakpoints?: number[] | boolean;
    autoLayout?: AutoLayout | boolean;
    component?: any;
}
export interface FilterProps extends ProFormProps {
    form: FormType;
    defaultFilterValue?: string;
    filterValues?: string[];
    activeFilterValueRef?: React.MutableRefObject<any>;
    forceClear?: boolean;
    onReset?: (payload?: any) => void;
}
export interface QueryFilterLayoutProps {
    prefixCls?: string;
    className?: string;
    addonBefore?: ReactNode | any;
    addonAfter?: ReactNode | any;
    inlineContent?: ReactNode;
    panelContent?: ReactNode;
    count?: number;
    expand?: boolean;
    onExpand?: (expand: boolean) => void;
    children?: React.ReactNode;
}
export interface QueryFilterProps extends ProFormProps {
    /**
     * @deprecated triggerType已弃用
     */
    triggerType?: 'keydown' | 'change' | 'submit';
    /** 表单展示形式 */
    mode?: 'inline' | 'panel';
    /** 面板模式下是否仅展示面板 */
    purePanel?: boolean;
    /** 面板是否默认展开，仅在 mode='panel' 时生效 */
    expand?: boolean;
    gridProps?: any;
    /** 是否强制清除 */
    forceClear?: boolean;
    /** 顶部筛选区前缀 */
    addonBefore?: ReactNode | any;
    /** 顶部筛选区后缀 */
    addonAfter?: ReactNode | any;
    /** 顶部筛选区默认筛选项 */
    defaultFilterValue?: string;
    /** 顶部筛选区筛选项配置 */
    filterValues?: string[];
    /** 透出内部表单实例 */
    formRef?: React.MutableRefObject<any>;
    /** onChange事件的防抖时间 */
    filterDebounce?: number;
    /** 绑定URL参数 */
    bindUrl?: boolean | UrlStateOptions;
    /** 表单初始化（含异步默认值）后回调函数 */
    onInit?: (values: any) => void;
    /** 表单筛选回调函数 */
    onFilter?: (values: any) => void;
    /** 表单重置回调函数 */
    onReset?: (payload?: any) => void;
    /** 高级筛选按钮切换 */
    onExpand?: (expand: boolean) => void;
}
/**
 * 兼容性导出
 */
/**
 * @deprecated 将在未来移除该组件，建议使用 QueryFilter 代替
 */
export interface IFilterProps extends ProFormProps {
    triggerType?: 'keydown' | 'change' | 'submit';
    onFilter?: (values: any) => void;
    onReset?: (payload?: any) => void;
}
/**
 * @deprecated 将在未来移除，建议使用 ProFormSchemaItem 代替
 */
export interface IFormSchemaItem extends ProFormSchemaItem {
}
/**
 * @deprecated 将在未来移除，建议使用 ProFormSchema 代替
 */
export interface IFormSchema extends ProFormSchema {
}
/**
 * @deprecated 将在未来移除，建议使用 ProFormProps 代替
 */
export interface IFormProps extends ProFormProps {
}
export {};
