/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import type { ISchema } from '@formily/react';
import type { ComponentType, ReactNode } from 'react';
import { type FieldFilterable, type FieldFilterOperator } from '../collection-manager/filter-operators';
import type { FieldConfigureItem } from '../collection-manager/field-configure';
import { CollectionFieldInterfaceManager } from './CollectionFieldInterfaceManager';
export type CollectionFieldInterfaceFactory = new (collectionFieldInterfaceManager: CollectionFieldInterfaceManager) => CollectionFieldInterface;
export interface CollectionFieldInterfaceComponentOption {
    label: string;
    value: string;
    useVisible?: () => boolean;
    useProps?: () => any;
}
export type FieldConfigureFormMode = 'create' | 'edit';
export interface FieldConfigureContext {
    mode: FieldConfigureFormMode;
    fieldInterface: CollectionFieldInterface | FieldInterfaceConfigure;
    collection?: Record<string, any>;
    field?: Record<string, any>;
    disabledJSONB?: boolean;
    createOnly?: boolean;
    editMainOnly?: boolean;
}
export type FieldConfigureFormProps = FieldConfigureContext;
export interface FieldConfigurePropertyComponentProps extends FieldConfigureContext {
    name: string;
    namePath: Array<string | number>;
    schema: Record<string, any>;
    form?: any;
    disabled?: boolean;
    collections?: Array<Record<string, any>>;
    context: Record<string, boolean>;
    title?: ReactNode;
    tooltip?: ReactNode;
    componentProps?: Record<string, any>;
}
export interface FieldInterfaceConfigure {
    name?: string;
    title?: ReactNode;
    group?: string;
    order?: number;
    default?: Record<string, any>;
    titleUsable?: boolean;
    isAssociation?: boolean;
    supportDataSourceType?: string[];
    notSupportDataSourceType?: string[];
    properties?: Record<string, any>;
    items?: FieldConfigureItem[];
    getConfigureFormProperties?: (collectionInfo?: Record<string, any>) => Record<string, any>;
    components?: Record<string, ComponentType<FieldConfigurePropertyComponentProps>>;
    initialize?: (values: Record<string, any>, context?: FieldConfigureContext) => void;
    ConfigureForm?: ComponentType<FieldConfigureFormProps>;
    Component?: ComponentType<FieldConfigureFormProps>;
    normalizeValues?: (values: Record<string, any>, context: FieldConfigureContext) => Record<string, any>;
    normalize?: (values: Record<string, any>, context: FieldConfigureContext) => Record<string, any>;
    validate?: (values: Record<string, any>, context: FieldConfigureContext) => Promise<void> | void;
}
export declare abstract class CollectionFieldInterface {
    collectionFieldInterfaceManager: CollectionFieldInterfaceManager;
    constructor(collectionFieldInterfaceManager: CollectionFieldInterfaceManager);
    name: string;
    group: string;
    title?: string;
    description?: string;
    primaryKeyDescription?: string;
    order?: number;
    default?: {
        type: string;
        uiSchema?: ISchema;
        [key: string]: any;
    };
    sortable?: boolean;
    availableTypes?: string[];
    type?: string;
    supportDataSourceType?: string[];
    notSupportDataSourceType?: string[];
    hasDefaultValue?: boolean;
    componentOptions?: CollectionFieldInterfaceComponentOption[];
    isAssociation?: boolean;
    operators?: FieldFilterOperator[];
    properties?: any;
    validationType?: string;
    availableValidationOptions: string[];
    configure?: FieldInterfaceConfigure;
    excludeValidationOptions?: string[];
    /**
     * - 如果该值为空，则在 Filter 组件中该字段会被过滤掉
     * - 如果该值为空，则不会在变量列表中看到该字段
     */
    filterable?: FieldFilterable;
    titleUsable?: boolean;
    usePathOptions?(field: any): any;
    hidden?: boolean;
    creatable?: boolean;
    addComponentOption(componentOption: CollectionFieldInterfaceComponentOption): void;
    getConfigureFormProperties(collectionInfo?: any): Record<string, ISchema>;
    getDefaultValueProperty(): {
        defaultValue: any;
    };
    addOperator(operatorOption: FieldFilterOperator): void;
}
