import { RuntimeModelField, SubmitRelationValue, SubmitValue } from '@oinone/kunlun-engine';
import { FieldEventName, LifeCycleTypes } from '@oinone/kunlun-event';
import { ModelFieldType, ViewType } from '@oinone/kunlun-meta';
import { Constructor, ReturnPromise } from '@oinone/kunlun-shared';
import { SPIOptions, SPISingleSelector, SPITokenFactory } from '@oinone/kunlun-spi';
import { ComputeTrigger } from '@oinone/kunlun-vue-ui-common';
import { InnerWidgetType, PathWidget } from '@oinone/kunlun-vue-widget';
import { ValidatorInfo } from '../../typing';
import { BaseFormItemWidget, BaseFormItemWidgetProps } from '../form-item';
/**
 * Field组件注册可选项
 */
export interface BaseFieldOptions extends SPIOptions {
    /**
     * 指定视图类型
     */
    viewType?: ViewType | ViewType[];
    /**
     * 指定组件名称或别称
     */
    widget?: string | string[];
    /**
     * 指定字段业务类型
     */
    ttype?: ModelFieldType | ModelFieldType[];
    /**
     * 指定是否多值
     */
    multi?: boolean;
    /**
     * 指定模型
     */
    model?: string | string[];
    /**
     * 指定视图名称
     */
    viewName?: string | string[];
    /**
     * 指定字段名称
     */
    name?: string;
}
export interface BaseFieldProps<Field extends RuntimeModelField = RuntimeModelField> extends BaseFormItemWidgetProps {
    field?: Field;
}
export declare type HandlerEvent = (field: BaseFieldWidget) => void;
/**
 * 单字段组件
 */
export declare class BaseFieldWidget<Value = unknown, Field extends RuntimeModelField = RuntimeModelField, Props extends BaseFieldProps<Field> = BaseFieldProps<Field>> extends BaseFormItemWidget<Value, Props> {
    protected $$innerWidgetType: InnerWidgetType;
    static Token: SPITokenFactory<BaseFieldOptions>;
    static Selector: SPISingleSelector<BaseFieldOptions, Constructor<BaseFieldWidget>>;
    private runtimeField;
    get field(): Field;
    get label(): string | undefined;
    get required(): boolean;
    get readonly(): boolean;
    initialize(props: Props): this;
    protected get isSkipValidator(): boolean;
    /**
     * 具体校验逻辑
     * @param needCheckedValue
     */
    protected validatorSpecific(needCheckedValue: any): Promise<ValidatorInfo>;
    change(val: Value | null | undefined): void;
    focus(): void;
    blur(): void;
    executeValidator(): Promise<ValidatorInfo>;
    submit(submitValue: SubmitValue): ReturnPromise<Record<string, unknown> | SubmitRelationValue | undefined>;
    validator(): Promise<ValidatorInfo>;
    protected defaultComputeTrigger: ComputeTrigger[];
    get computeTrigger(): ComputeTrigger[];
    executeCompute(trigger: ComputeTrigger): void;
    protected $$beforeCreated(): void;
    protected $$created(): void;
    protected $$beforeMount(): void;
    protected $$mounted(): void;
    protected $$beforeUpdate(): void;
    protected $$updated(): void;
    protected $$beforeUnmount(): void;
    protected $$unmounted(): void;
    protected fieldWidgetMounted: ((widget: PathWidget) => void) | undefined;
    protected fieldWidgetUnmounted: ((widget: PathWidget) => void) | undefined;
    private ownEventListeners;
    /**
     * 监听字段的事件
     * @param  event 事件名 / 事件对象
     * @param  handler? 回调函数
     *
     * @example
     *
     * 单个事件监听
     * fieldWidget.on('change', (fieldInstance) => {})
     * fieldWidget.on('blur', (fieldInstance) => {})
     *
     */
    on(event: {
        [key in FieldEventName]?: HandlerEvent;
    }): void;
    /**
     * 多个事件监听
     *
     * @example
     *
     * fieldWidget.on({
     *  change(fieldInstance) => {},
     *  blur(fieldInstance) => {},
     * })
     */
    on(event: FieldEventName, handler: HandlerEvent): void;
    protected notify(type: LifeCycleTypes): void;
}
