/**
 * Client-side React hook to fetch page data.
 *
 * Use this in client components for dynamic page loading.
 */
import type { RiverbankClient } from '../../client/types';
import type { PageProps } from '../components/Page';
import type { RuntimeSdkConfig } from '../helpers/loadPage';
export type UsePageParams = {
    client: RiverbankClient;
    siteId: string;
    path: string;
    pageId?: string;
    /**
     * If true, fetches draft/unpublished content instead of published content.
     * This affects both the page structure and block data loaders.
     * Requires API key with site access.
     *
     * @default false
     */
    preview?: boolean;
};
export type UsePageResult = {
    loading: true;
    error: null;
    page: null;
    theme: null;
    siteId: string;
    resolvedData: null;
    sdkConfig: null;
} | {
    loading: false;
    error: Error;
    page: null;
    theme: null;
    siteId: string;
    resolvedData: null;
    sdkConfig: null;
} | {
    loading: false;
    error: null;
    sdkConfig: RuntimeSdkConfig | null;
} & Omit<PageProps, 'registry' | 'wrapBlock' | 'usePlaceholders' | 'sdkConfig'>;
/**
 * Client-side React hook to fetch all data needed for <Page> component.
 *
 * Fetches site data, page data, and prefetches block data loaders.
 * Returns loading and error states for proper UI handling.
 *
 * IMPORTANT: The client object should be stable across renders to avoid
 * unnecessary re-fetches. Create it outside your component or use useMemo:
 *
 * ```tsx
 * // ✅ Good - stable reference
 * const client = useMemo(
 *   () => createRiverbankClient({ apiKey, baseUrl }),
 *   [apiKey, baseUrl]
 * );
 *
 * // ❌ Bad - new client on every render (causes infinite loops)
 * const client = createRiverbankClient({ apiKey, baseUrl });
 * ```
 *
 * @example Basic usage
 * ```tsx
 * import { createRiverbankClient } from '@riverbankcms/sdk';
 * import { usePage, Page } from '@riverbankcms/sdk/rendering';
 *
 * const client = createRiverbankClient({
 *   apiKey: process.env.NEXT_PUBLIC_RIVERBANK_API_KEY!,
 *   baseUrl: process.env.NEXT_PUBLIC_DASHBOARD_URL + '/api',
 * });
 *
 * function MyPage({ path }: { path: string }) {
 *   const pageData = usePage({ client, siteId: 'site-123', path });
 *
 *   if (pageData.loading) {
 *     return <div>Loading...</div>;
 *   }
 *
 *   if (pageData.error) {
 *     return <div>Error: {pageData.error.message}</div>;
 *   }
 *
 *   return <Page {...pageData} />;
 * }
 * ```
 *
 * @example With custom loading/error states
 * ```tsx
 * function MyPage({ path }: { path: string }) {
 *   const pageData = usePage({ client, siteId: 'site-123', path });
 *
 *   if (pageData.loading) {
 *     return <Skeleton />;
 *   }
 *
 *   if (pageData.error) {
 *     return (
 *       <ErrorBoundary
 *         error={pageData.error}
 *         onRetry={() => window.location.reload()}
 *       />
 *     );
 *   }
 *
 *   return <Page {...pageData} />;
 * }
 * ```
 */
export declare function usePage(params: UsePageParams): UsePageResult;
