/**
 * Core block data prefetching logic (framework-agnostic).
 *
 * This module provides the shared implementation for prefetching block data loaders.
 * It works with any API client by accepting it as a parameter (dependency injection).
 *
 * Usage:
 * - Frontend: provide internal API client
 * - SDK: provide SDK client with endpoint mapping
 */
import { type BlockDataLoader } from '../registry';
import type { PageOutline } from '../../structure/schema';
import type { ApiClient, PrefetchContext, ResolvedBlockData } from './types';
export type PrefetchBlockDataOptions = {
    /**
     * API client function that makes the actual requests.
     * This allows the caller to provide their own client (internal or SDK).
     */
    apiClient: ApiClient;
    /**
     * Validation function to check if endpoint is valid.
     * Different environments have different endpoint registries.
     */
    isValidEndpoint?: (endpoint: string) => boolean;
    /**
     * Error handler for failed data fetches.
     * By default, errors are logged and suppressed (data loading is best-effort).
     */
    onError?: (error: unknown, context: {
        block: string;
        loader: string;
    }) => void;
    /**
     * Custom block data loader lookup.
     *
     * Called for blocks that aren't found in the system registry.
     * Returns data loaders for SDK custom blocks.
     *
     * @param blockKind - The block's kind (e.g., 'custom.team-member')
     * @returns Record of data loaders, or undefined if not a custom block
     */
    getCustomBlockLoaders?: (blockKind: string) => Record<string, BlockDataLoader> | undefined;
};
/**
 * Core data prefetching logic (framework-agnostic).
 *
 * This function is shared between frontend and SDK implementations.
 * It handles:
 * - Extracting data loaders from block definitions
 * - Resolving loader params with block content
 * - Executing server-mode loaders in parallel
 * - Organizing results by block ID and loader key
 *
 * @example
 * ```typescript
 * const resolved = await prefetchBlockData(page, context, {
 *   apiClient: async ({ endpoint, params }) => {
 *     return await myApiClient({ endpoint, params });
 *   },
 *   isValidEndpoint: (endpoint) => endpoint in API_ENDPOINTS,
 * });
 * ```
 */
export declare function prefetchBlockData(page: PageOutline, context: PrefetchContext, options: PrefetchBlockDataOptions): Promise<ResolvedBlockData>;
