import type { ReactElement, ReactNode } from 'react';
import { FieldErrors } from '@contember/ui';
export declare namespace ChoiceFieldData {
    interface SingleOption<Value = unknown> {
        label: ReactNode;
        searchKeywords: string;
        description?: ReactNode;
        value: Value;
        key: string;
    }
    type Options<Value = unknown> = SingleOption<Value>[];
    interface BaseChoiceMetadata<Value = unknown> {
        data: Options<Value>;
        errors: FieldErrors | undefined;
        onSearch?: (input: string) => void;
        isLoading?: boolean;
        onAddNew?: () => void;
    }
    interface SingleChoiceFieldMetadata<Value = unknown> extends BaseChoiceMetadata<Value> {
        currentValue: SingleOption<Value> | null;
        onSelect: (newValue: SingleOption<Value>) => void;
        onClear: () => void;
    }
    interface MultipleChoiceFieldMetadata<Value> extends BaseChoiceMetadata<Value> {
        currentValues: SingleOption<Value>[];
        onClear: () => void;
        onAdd: (option: SingleOption<Value>) => void;
        onRemove: (option: SingleOption<Value>) => void;
        onMove?: (oldIndex: number, newIndex: number) => void;
    }
    interface SingleChoiceFieldProps<Value = unknown> {
        children: (metadata: SingleChoiceFieldMetadata<Value>) => ReactElement | null;
    }
    interface MultiChoiceFieldProps<Value = unknown> {
        children: (metadata: MultipleChoiceFieldMetadata<Value>) => ReactElement | null;
    }
}
//# sourceMappingURL=ChoiceFieldData.d.ts.map