import { GenericDataProvider, InferResponse, InferMetaType, InferOptions, InferQuery, Persistence, ResourceContextValue, InferContextPluginProps, InferContextPluginTypes } from './DataProvider'; export type ResourceProps = InferQuery, OptionsI extends InferOptions = InferOptions> = { /** DataProvider to be used for requests - must not be changed */ dataProvider?: DataProviderI; /** Resource name */ name: string; /** Query instructions */ query: QueryI; /** Disables fetching data, resulting in an empty data array */ disabled?: boolean; /** Query options for requests */ options?: OptionsI; /** Whether stale data should be retained during the next request - this only applies if name did not change, unless set to "very" */ persistent?: Persistence; }; /** * Provides data based on the given request details and DataProvider. * * Necessary configuration that is not directly specified is taken from the ConfigContext. * * The provided DataProvider must not be changed. */ export default function useResource = InferResponse, QueryI extends InferQuery = InferQuery, OptionsI extends InferOptions = InferOptions, MetaTypeI extends InferMetaType = InferMetaType>({ dataProvider: dataProviderProp, name: nameProp, query: nextQuery, disabled: nextDisabled, options: nextOptions, persistent: nextPersistent, ...rest }: ResourceProps & InferContextPluginProps): ResourceContextValue & InferContextPluginTypes;