import React from 'react';
import { Form, Schema } from '@tachybase/schema';
import { CollectionFieldOptions_deprecated } from '../../collection-manager';
import { VariableOption, VariablesContextType } from '../../variables/types';
import { Option } from './type';
interface GetShouldChangeProps {
    collectionField: CollectionFieldOptions_deprecated;
    variables: VariablesContextType;
    localVariables: VariableOption | VariableOption[];
    /** `useCollectionManager_deprecated` 返回的 */
    getAllCollectionsInheritChain: (collectionName: string) => string[];
}
interface RenderSchemaComponentProps {
    value: any;
    onChange: (value: any) => void;
}
type Props = {
    value: any;
    onChange: (value: any, optionPath?: any[]) => void;
    renderSchemaComponent: (props: RenderSchemaComponentProps) => any;
    schema?: any;
    /** 消费变量值的字段 */
    targetFieldSchema?: Schema;
    children?: any;
    className?: string;
    style?: React.CSSProperties;
    collectionField: CollectionFieldOptions_deprecated;
    contextCollectionName?: string;
    /**
     * 根据 `onChange` 的第一个参数，判断是否需要触发 `onChange`
     * @param value `onChange` 的第一个参数
     * @returns 返回为 `true` 时，才会触发 `onChange`
     */
    shouldChange?: (value: any, optionPath?: any[]) => Promise<boolean>;
    form?: Form;
    /**
     * 当前表单的记录，数据来自数据库
     */
    record?: Record<string, any>;
    /**
     * 可以用该方法对内部的 scope 进行筛选和修改
     * @param scope
     * @returns
     */
    returnScope?: (scope: Option[]) => any[];
};
/**
 * 注意：该组件存在以下问题：
 * - 在选中选项的时候该组件不能触发重渲染
 * - 如果触发重渲染可能会导致无法展开子选项列表
 * @param props
 * @returns
 */
export declare const VariableInput: (props: Props) => import("react/jsx-runtime").JSX.Element;
/**
 * 通过限制用户的选择，来防止用户选择错误的变量
 */
export declare const getShouldChange: ({ collectionField, variables, localVariables, getAllCollectionsInheritChain, }: GetShouldChangeProps) => (value: any, optionPath: any[]) => Promise<boolean>;
export interface FormatVariableScopeParam {
    children: any[];
    disabled: boolean;
    name: string;
    title: string;
}
export interface FormatVariableScopeReturn {
    value: string;
    key: string;
    label: string;
    disabled: boolean;
    children?: any[];
}
/**
 * 兼容老版本的变量
 * @param variables
 */
export declare function useCompatOldVariables(props: {
    uiSchema: any;
    collectionField: CollectionFieldOptions_deprecated;
    blockCollectionName: string;
    noDisabled?: boolean;
    targetFieldSchema?: Schema;
}): {
    compatOldVariables: (variables: Option[], { value }: {
        value: any;
    }) => Option[];
};
export {};
