import { Record, SortPayload } from '../../types'; import { ListControllerProps } from '../useListController'; interface Option { basePath?: string; filter?: any; page?: number; perPage?: number; record?: Record; reference: string; resource: string; sort?: SortPayload; source: string; } /** * Hook that fetches records from another resource specified * by an array of *ids* in current record. * * @example * * const { ids, data, error, loaded, loading, referenceBasePath } = useReferenceArrayFieldController({ * 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 * * @returns {ReferenceArrayProps} The reference props */ declare const useReferenceArrayFieldController: (props: Option) => ListControllerProps; export default useReferenceArrayFieldController;