/**
 * 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 FlowModelContext, type SubModelItem } from '@nocobase/flow-engine';
export interface TransformOptions {
    fieldUseModel: string;
    refreshTargets: string[];
}
/**
 * 递归将 SubModelItem 列表中的叶子节点 createModelOptions 重写为指定的 JS 字段模型。
 * - 保留 children 的形态：数组或函数；
 * - 对函数型 children 做一层包裹，确保返回结果继续被转换；
 * - 对已有 createModelOptions（对象或函数）做二次包装并追加 subModels.field.use。
 */
export declare function transformChildrenToJS(items: SubModelItem[] | false | undefined, options: TransformOptions): SubModelItem[];
/**
 * 构造“关联字段（JS 化）”分组节点，支持懒加载 children 并在返回时完成 JS 化。
 */
export declare function buildAssociationJSGroup(ctx: FlowModelContext, provider: (ctx: FlowModelContext) => SubModelItem[] | Promise<SubModelItem[]>, options: TransformOptions & {
    key?: string;
    label?: string;
    searchable?: boolean;
    searchPlaceholder?: string;
}): SubModelItem;
export declare function buildFormAssociationChildren(ctx: FlowModelContext): SubModelItem[];
export interface JSFieldMenuChildrenOptions {
    useModel: string;
    fieldUseModel: string;
    refreshTargets: string[];
    associationPathName?: string;
    /**
     * 仅在需要“关系字段”入口时传入（例如 Table / Details 区块）；
     * 表单的 JS field 菜单默认不展示关系字段。
     */
    associationProvider?: (ctx: FlowModelContext) => SubModelItem[] | Promise<SubModelItem[]>;
}
export declare function buildJSFieldMenuChildren(ctx: FlowModelContext, opts: JSFieldMenuChildrenOptions): Promise<SubModelItem[]>;
