import { FC, ReactElement } from 'react'; import { UseReferenceProps, getResourceLinkPath, LinkToType, Record } from '../../features/core'; import { PublicFieldProps, InjectedFieldProps } from './types'; /** * Fetch reference record, and delegate rendering to child component. * * The reference prop should be the name of one of the components * added as child. * * @example * * * * * @default * By default, includes a link to the page of the related record * (`/users/:userId` in the previous example). * * Set the `link` prop to "show" to link to the page instead. * * @example * * * * * @default * You can also prevent `` from adding link to children by setting * `link` to false. * * @example * * * * * @default * Alternatively, you can also pass a custom function to `link`. It must take reference and record * as arguments and return a string * * @example * "/path/to/${reference}/${record}"}> * * * * @default * In previous versions of React-Admin, the prop `linkType` was used. It is now deprecated and replaced with `link`. However * backward-compatibility is still kept */ declare const ReferenceField: FC; export interface ReferenceFieldProps extends PublicFieldProps, InjectedFieldProps { children: ReactElement; reference: string; resource?: string; source: string; translateChoice?: Function | boolean; linkType?: LinkToType; link?: LinkToType; } /** * This intermediate component is made necessary by the useReference hook, * which cannot be called conditionally when get(record, source) is empty. */ export declare const NonEmptyReferenceField: FC>; export declare const ReferenceFieldView: FC; export interface ReferenceFieldViewProps extends PublicFieldProps, InjectedFieldProps, UseReferenceProps { reference: string; resource?: string; translateChoice?: Function | boolean; resourceLinkPath?: ReturnType; children?: ReactElement; } export default ReferenceField;