/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import React, { FC } from 'react';
import { UseRequestResult } from '../../api-client';
/**
 * @internal
 */
export declare const BlockRequestLoadingContext: React.Context<boolean>;
export declare function requestParentRecordData({ sourceId, association, parentRecord, api, headers, sourceKey, }: {
    sourceId?: number;
    association?: string;
    parentRecord?: any;
    api?: any;
    headers?: any;
    sourceKey?: string;
}): Promise<any>;
export declare const BlockRequestContextProvider: FC<{
    recordRequest: UseRequestResult<any>;
}>;
export declare const BlockRequestProvider: FC;
export declare const useDataBlockRequest: <T extends {}>() => UseRequestResult<{
    data: T;
}>;
/**
 * Compared to `useDataBlockRequest`, this Hook helps prevent unnecessary re-renders.
 *
 * This Hook returns a stable function reference that won't change between renders. When you only need
 * methods like `refresh` or `run`, using this Hook is recommended because:
 *
 * 1. It returns a memoized object containing only the getter function
 * 2. The getter function accesses the latest request data through a ref, avoiding re-renders
 * 3. Unlike useDataBlockRequest which returns request state directly, this Hook provides indirect access
 *    through a getter, breaking the reactive dependency chain
 *
 * For example:
 * ```ts
 * // This will re-render when request state changes
 * const { refresh } = useDataBlockRequest();
 *
 * // This won't re-render when request state changes
 * const { getDataBlockRequest } = useDataBlockRequestGetter();
 * const refresh = getDataBlockRequest().refresh;
 * ```
 *
 * @returns An object containing the getDataBlockRequest method that provides access to the request instance
 */
export declare const useDataBlockRequestGetter: () => {
    getDataBlockRequest: () => UseRequestResult<any>;
};
/**
 * When only data is needed, it's recommended to use this hook to avoid unnecessary re-renders
 */
export declare const useDataBlockRequestData: () => any;
