/**
 * 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 { FilterGroupType } from '@nocobase/utils/client';
import React from 'react';
import { FieldAssignValueInput } from './FieldAssignValueInput';
import type { FieldAssignCascaderOption } from './fieldAssignOptions';
export type AssignMode = 'default' | 'assign';
type CollectionFieldLike = {
    name?: unknown;
    title?: unknown;
    type?: unknown;
    interface?: unknown;
    uiSchema?: unknown;
    targetKey?: unknown;
    targetCollectionTitleFieldName?: unknown;
    targetCollection?: any;
    isAssociationField?: () => boolean;
};
export type SyncAssociationTitleFieldParams = {
    ruleItem: FieldAssignRuleItem;
    ruleIndex: number;
    targetPath?: string;
    associationField: CollectionFieldLike;
    targetCollection: any;
    titleField: string;
};
export interface FieldAssignRuleItem {
    key: string;
    enable?: boolean;
    /** 赋值目标路径，例如 `title` / `users.nickname` / `user.name` */
    targetPath?: string;
    /** 仅当前规则生效的 title field 覆盖（不改 collection 全局配置） */
    valueTitleField?: string;
    mode?: AssignMode;
    condition?: FilterGroupType;
    value?: any;
}
export interface FieldAssignRulesEditorProps {
    t: (key: string) => string;
    fieldOptions: FieldAssignCascaderOption[] | any[];
    /** 根集合（用于构建“上级对象/属性”变量树） */
    rootCollection?: any;
    value?: FieldAssignRuleItem[];
    onChange?: (value: FieldAssignRuleItem[]) => void;
    /** 默认 mode（新建条目时使用） */
    defaultMode?: AssignMode;
    /** 固定 mode：用于“仅默认值/仅赋值”的场景 */
    fixedMode?: AssignMode;
    /** 是否显示 condition */
    showCondition?: boolean;
    /** 是否显示 enable 开关 */
    showEnable?: boolean;
    /** 未选字段时也展示 Value 编辑器（用于表单设置里的占位体验） */
    showValueEditorWhenNoField?: boolean;
    /** 为 Value 编辑器补充额外 props（例如按筛选操作符适配输入组件） */
    getValueInputProps?: (item: FieldAssignRuleItem, index: number) => Partial<React.ComponentProps<typeof FieldAssignValueInput>>;
    /** 可选：用于筛选关系集合中可作为 Title field 的候选字段 */
    isTitleFieldCandidate?: (field: any, targetCollection: any) => boolean;
    /** 可选：点击同步按钮后，将选中的 title field 持久化到关系集合 */
    onSyncAssociationTitleField?: (params: SyncAssociationTitleFieldParams) => Promise<void> | void;
    /** 在日期字段下启用“日期变量替换 Constant 位”。 */
    enableDateVariableAsConstant?: boolean;
}
export declare const FieldAssignRulesEditor: React.FC<FieldAssignRulesEditorProps>;
export {};
