import { Record, SortPayload } from '../../types'; import { FieldInputProps } from 'react-final-form'; import { ListControllerProps } from '../useListController'; import { ReferenceArrayInputContextValue } from './ReferenceArrayInputContext'; /** * Prepare data for the ReferenceArrayInput components * * @example * * const { choices, error, loaded, loading } = useReferenceArrayInputController({ * basePath: 'resource'; * record: { referenceIds: ['id1', 'id2']}; * reference: 'reference'; * resource: 'resource'; * source: 'referenceIds'; * }); * * @param {Object} props * @param {string} props.basePath basepath to current resource * @param {Object} props.record The current resource record * @param {string} props.reference The linked resource name * @param {string} props.resource The current resource name * @param {string} props.source The key of the linked resource identifier * * @param {Props} props * * @return {Object} controllerProps Fetched data and callbacks for the ReferenceArrayInput components */ export declare const useReferenceArrayInputController: (props: UseReferenceArrayInputOptions) => ReferenceArrayInputContextValue & Omit; export interface UseReferenceArrayInputOptions { basePath?: string; filter?: any; filterToQuery?: (filter: any) => any; input: FieldInputProps; options?: any; page?: number; perPage?: number; record?: Record; reference: string; resource?: string; sort?: SortPayload; source: string; }