import { Key, Keyed } from '@synnaxlabs/x';
import { FC, ReactElement } from 'react';
import { ContextValue, FieldState, UseFieldProps, UseNullableFieldProps } from './Form';
import { Input } from '../input';
import { Select } from '../select';
import { RenderProp } from '../util/renderProp';
interface FieldChild<I extends Input.Value, O extends Input.Value> extends Input.Control<I, O> {
    variant?: Input.Variant;
}
export type FieldProps<I extends Input.Value = string | number, O extends Input.Value = I> = (UseFieldProps<I, O> | UseNullableFieldProps<I, O>) & Omit<Input.ItemProps, "children" | "onChange" | "defaultValue"> & {
    children?: RenderProp<FieldChild<I, O>>;
    padHelpText?: boolean;
    visible?: boolean | ((state: FieldState<I>, ctx: ContextValue) => boolean);
    hideIfNull?: boolean;
};
export type FieldT<I extends Input.Value, O extends Input.Value = I> = (props: FieldProps<I, O>) => ReactElement | null;
export declare const Field: <I extends Input.Value = string | number, O extends Input.Value = I>({ path, children, label, padHelpText, visible, hideIfNull, optional, onChange, className, ...props }: FieldProps<I, O>) => ReactElement | null;
export interface FieldBuilderProps<I extends Input.Value, O extends Input.Value, P extends {}> {
    fieldKey?: string;
    fieldProps?: Partial<FieldProps<I, O>>;
    inputProps?: Partial<P>;
}
export type BuiltFieldProps<I extends Input.Value, O extends Input.Value, P extends {}> = FieldProps<I, O> & {
    inputProps?: Partial<P>;
    fieldKey?: string;
};
export declare const fieldBuilder: <I extends Input.Value, O extends Input.Value, P extends {}>(Component: FC<P & Input.Control<I, O>>) => ({ fieldKey: baseFieldKey, fieldProps, inputProps: baseInputProps, }: FieldBuilderProps<I, O, P>) => FC<BuiltFieldProps<I, O, P>>;
export declare const buildNumericField: ({ fieldKey: baseFieldKey, fieldProps, inputProps: baseInputProps, }: FieldBuilderProps<number, number, Input.NumericProps & import('react').RefAttributes<HTMLInputElement>>) => FC<BuiltFieldProps<number, number, Input.NumericProps & import('react').RefAttributes<HTMLInputElement>>>;
export declare const NumericField: FC<BuiltFieldProps<number, number, Input.NumericProps & import('react').RefAttributes<HTMLInputElement>>>;
export declare const buildTextField: ({ fieldKey: baseFieldKey, fieldProps, inputProps: baseInputProps, }: FieldBuilderProps<string, string, Input.TextProps & import('react').RefAttributes<HTMLInputElement>>) => FC<BuiltFieldProps<string, string, Input.TextProps & import('react').RefAttributes<HTMLInputElement>>>;
export declare const TextField: FC<BuiltFieldProps<string, string, Input.TextProps & import('react').RefAttributes<HTMLInputElement>>>;
export declare const buildSwitchField: ({ fieldKey: baseFieldKey, fieldProps, inputProps: baseInputProps, }: FieldBuilderProps<boolean, boolean, Input.SwitchProps & import('react').RefAttributes<HTMLInputElement>>) => FC<BuiltFieldProps<boolean, boolean, Input.SwitchProps & import('react').RefAttributes<HTMLInputElement>>>;
export declare const SwitchField: FC<BuiltFieldProps<boolean, boolean, Input.SwitchProps & import('react').RefAttributes<HTMLInputElement>>>;
export declare const buildSelectSingleField: <K extends Key, E extends Keyed<K>>({ fieldProps, inputProps, }: FieldBuilderProps<K, K, Select.SingleProps<K, E>>) => FC<BuiltFieldProps<K, K, Select.SingleProps<K, E>>>;
export declare const buildSelectMultiField: <K extends Key, E extends Keyed<K>>({ fieldProps, inputProps, }: FieldBuilderProps<K, K, Select.MultipleProps<K, E>>) => FC<BuiltFieldProps<K, K, Select.MultipleProps<K, E>>>;
export declare const buildDropdownButtonSelectField: <K extends Key, E extends Keyed<K>>({ fieldProps, inputProps, }: FieldBuilderProps<K, K, Select.DropdownButtonProps<K, E>>) => FC<BuiltFieldProps<K, K, Select.DropdownButtonProps<K, E>>>;
export {};
//# sourceMappingURL=Field.d.ts.map