import type { FieldAccessor, FieldValue } from '@contember/binding';
import type { ControlProps, NonOptionalControlProps } from '@contember/ui';
import { Ref } from 'react';
import type { SimpleRelativeSingleFieldMetadata } from '../auxiliary';
export type ControlValueParser<ControlVal, FieldVal extends FieldValue> = (value: ControlVal | null | undefined, field: FieldAccessor<FieldVal>) => FieldVal | null;
export type FieldValueFormatter<FieldVal extends FieldValue, ControlVal extends FieldValue> = (value: FieldVal | null | undefined, field: FieldAccessor<FieldVal>) => ControlVal | null;
export type UseControlProps<FieldVal extends FieldValue, ControlVal extends FieldValue> = ControlProps<FieldVal> & {
    fieldMetadata: SimpleRelativeSingleFieldMetadata<FieldVal>;
    parse: ControlValueParser<ControlVal, FieldVal>;
    format: FieldValueFormatter<FieldVal, ControlVal>;
};
export declare const useFieldControl: <FieldVal extends FieldValue, ControlVal extends FieldValue, Type extends string | undefined = string | undefined>({ fieldMetadata, parse, format, ...props }: UseControlProps<FieldVal, ControlVal>) => NonOptionalControlProps<ControlVal> & {
    ref: Ref<any>;
};
//# sourceMappingURL=useFieldControl.d.ts.map