import { InputProps } from '../useInput';
/**
* A hook that returns a validation function checking for a record field uniqueness
* by calling the dataProvider getList function with a filter.
*
* @example // Passing options at declaration time
* const UserCreateForm = () => {
* const unique = useUnique({ message: 'Username is already used'});
* return (
*
*
*
* );
* }
*
* @example // Passing options at call time
* const UserCreateForm = () => {
* const unique = useUnique();
* return (
*
*
*
* );
* }
*
* @example // With additional filters
* const UserCreateForm = () => {
* const unique = useUnique();
* return (
*
*
*
* {({ formData }) => (
*
* )}
*
*
* );
* }
*/
export declare const useUnique: (options?: UseUniqueOptions) => (callTimeOptions?: UseUniqueOptions) => (value: any, allValues: any, props: InputProps) => Promise> | Iterable | null;
};
} | undefined>;
export type UseUniqueOptions = {
debounce?: number;
resource?: string;
message?: string;
filter?: Record;
};
//# sourceMappingURL=useUnique.d.ts.map