/**
 * 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 MetaTreeNode } from '@nocobase/flow-engine';
import React from 'react';
import { type VariableDelimiters } from './VariableInput';
/**
 * Constant types this input can edit. Subset of v1 `Variable.Input`
 * `useTypedConstant` — drops `'object'` (no v2 JSON editor yet) and `'null'`
 * (handled by the dedicated `nullable` prop).
 */
export type TypedConstantType = 'string' | 'number' | 'boolean' | 'date';
/**
 * One allowed constant type. Either a bare type name (`'number'`) or a
 * `[type, editorProps]` pair (`['number', { min: 1, max: 65535 }]`) where
 * `editorProps` is forwarded to the antd editor for that type — same
 * shape as v1 `useTypedConstant`.
 */
export type TypedConstantSpec = TypedConstantType | [TypedConstantType, Record<string, unknown>];
export interface TypedVariableInputProps {
    /**
     * Stored value. A `{{ ... }}` string is treated as a variable reference;
     * anything else is a constant of the inferred type.
     */
    value?: unknown;
    onChange?: (next: unknown) => void;
    /**
     * Allowed constant types. The `Constant` switcher entry always exposes a
     * typed submenu (matching v1 `Variable.Input`) so users can see what type
     * the constant is, even when only one type is permitted. Default: all four
     * supported types.
     */
    types?: TypedConstantSpec[];
    /**
     * Restrict the variable picker to specific top-level meta-tree namespaces
     * (e.g. `['$env']`). When omitted, every registered top-level property is
     * exposed — matching `VariableInput`'s default behaviour.
     */
    namespaces?: string[];
    /** Additional leaves appended to the picker after the namespace-filtered nodes. */
    extraNodes?: MetaTreeNode[];
    /**
     * When true (default), the switcher exposes a `Null` option that resets the
     * value to `null`. When false, the value is constrained to one of the
     * allowed types or a variable reference.
     */
    nullable?: boolean;
    /** Variable-token delimiters. Default `['{{', '}}']` — see `VariableInput`. */
    delimiters?: VariableDelimiters;
    disabled?: boolean;
    placeholder?: string;
    style?: React.CSSProperties;
    className?: string;
}
/**
 * Constant-or-variable input. Port of v1 `Variable.Input` typed-constant
 * Cascader pattern (the `[Null | Constant<type> | Variable<…namespaces>]`
 * switcher). Use this when a field can accept either a typed literal
 * (number, boolean, date, string) or a variable reference like
 * `{{ $env.SMTP_PORT }}` — see `plugin-notification-email`'s port / secure
 * fields for the canonical example.
 *
 * Pure literal fields should keep using the antd primitive
 * (`InputNumber`, `Select`, `DatePicker`). Pure variable fields should keep
 * using `EnvVariableInput` / `VariableInput`. This component carries the
 * Cascader switcher overhead, so reach for it only when the field
 * genuinely accepts both shapes.
 */
export declare function TypedVariableInput(props: TypedVariableInputProps): React.JSX.Element;
export default TypedVariableInput;
