/**
 * Client-side React hook to fetch content (page or entry) by path.
 *
 * Use this in client components for dynamic routing where a path
 * could resolve to either a page or content entry.
 */
import type { MediaAssetIndexItem, Theme } from '../../contracts';
import type { RiverbankClient } from '../../client/types';
import type { PageProps } from '../components/Page';
import type { ResolvedBlockData } from '../../data/prefetchBlockData';
import type { ContentEntryData } from '../helpers/loadContent';
export type UseContentParams = {
    client: RiverbankClient;
    siteId: string;
    path: string;
    /**
     * If true, fetches draft/unpublished content instead of published content.
     * This affects both pages and entries.
     * Requires API key with site access.
     *
     * @default false
     */
    preview?: boolean;
};
/**
 * Loading state
 */
type LoadingState = {
    loading: true;
    error: null;
    type: null;
    page: null;
    entry: null;
    theme: null;
    siteId: string;
    resolvedData: null;
};
/**
 * Error state
 */
type ErrorState = {
    loading: false;
    error: Error;
    type: null;
    page: null;
    entry: null;
    theme: null;
    siteId: string;
    resolvedData: null;
};
/**
 * Success state for page content
 */
type PageSuccessState = {
    loading: false;
    error: null;
    type: 'page';
    page: PageProps['page'];
    entry: null;
    theme: Theme;
    siteId: string;
    resolvedData: ResolvedBlockData;
    supabaseUrl?: string;
    mediaAssets?: readonly MediaAssetIndexItem[];
};
/**
 * Success state for entry content
 */
type EntrySuccessState = {
    loading: false;
    error: null;
    type: 'entry';
    page: null;
    entry: ContentEntryData;
    theme: Theme;
    siteId: string;
    resolvedData: null;
};
export type UseContentResult = LoadingState | ErrorState | PageSuccessState | EntrySuccessState;
/**
 * Type guard to check if result is loading
 */
export declare function isContentLoading(result: UseContentResult): result is LoadingState;
/**
 * Type guard to check if result has an error
 */
export declare function isContentError(result: UseContentResult): result is ErrorState;
/**
 * Type guard to check if result is a page
 */
export declare function isPageContentResult(result: UseContentResult): result is PageSuccessState;
/**
 * Type guard to check if result is an entry
 */
export declare function isEntryContentResult(result: UseContentResult): result is EntrySuccessState;
/**
 * Client-side React hook to fetch content by path.
 *
 * Returns a discriminated union with loading/error states, and either
 * page data (ready for `<Page>` component) or raw entry data (for custom rendering).
 *
 * IMPORTANT: The client object should be stable across renders to avoid
 * unnecessary re-fetches. Create it outside your component or use useMemo.
 *
 * @example Dynamic routing with both pages and entries
 * ```tsx
 * "use client";
 *
 * import { useContent, Page, isPageContentResult } from '@riverbankcms/sdk/client';
 *
 * function DynamicPage({ path }: { path: string }) {
 *   const content = useContent({ client, siteId: 'site-123', path });
 *
 *   if (content.loading) return <div>Loading...</div>;
 *   if (content.error) return <div>Error: {content.error.message}</div>;
 *
 *   if (isPageContentResult(content)) {
 *     return <Page page={content.page} theme={content.theme} siteId={content.siteId} resolvedData={content.resolvedData} />;
 *   }
 *
 *   // Render entry with custom UI
 *   return (
 *     <article>
 *       <h1>{content.entry.title}</h1>
 *       <div>{content.entry.content.body}</div>
 *     </article>
 *   );
 * }
 * ```
 *
 * @example Entry-specific rendering based on content type
 * ```tsx
 * const content = useContent({ client, siteId, path });
 *
 * if (content.loading) return <Spinner />;
 * if (content.error) return <Error error={content.error} />;
 *
 * if (content.type === 'entry') {
 *   switch (content.entry.type) {
 *     case 'blog-post':
 *       return <BlogPost entry={content.entry} theme={content.theme} />;
 *     case 'product':
 *       return <ProductPage entry={content.entry} theme={content.theme} />;
 *   }
 * }
 *
 * return <Page {...content} />;
 * ```
 */
export declare function useContent(params: UseContentParams): UseContentResult;
export {};
