import { T as Theme } from './types-5XdVD2J1.js';
import './schema-Bpy9N5ZI.js';
import { R as RiverbankClient } from './types-CAnC529E.js';
import { P as PageProps } from './loadPage-BElEkA_J.js';
import { R as ResolvedBlockData } from './types-DSFvXKhO.js';

/**
 * Server-side helper to fetch content (page or entry) by path.
 *
 * Use this for dynamic routing where a path could resolve to either
 * a page or a content entry.
 */

type LoadContentParams = {
    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;
};
/**
 * Content entry data returned when a path resolves to an entry
 */
type ContentEntryData = {
    id: string;
    /** Content type key (e.g., 'blog-post', 'product') */
    type: string | null;
    title: string;
    slug: string | null;
    path: string | null;
    status: string;
    publishAt: string | null;
    /** The raw content fields - use these to render your own UI */
    content: Record<string, unknown>;
    metaTitle: string | null;
    metaDescription: string | null;
    createdAt: string;
    updatedAt: string;
};
/**
 * Result when path resolves to a page
 */
type PageContentResult = {
    type: 'page';
    /** Page outline ready for rendering with <Page> component */
    page: PageProps['page'];
    /** Site theme for styling */
    theme: Theme;
    /** Site ID */
    siteId: string;
    /** Pre-fetched block data for data loaders */
    resolvedData: ResolvedBlockData;
};
/**
 * Result when path resolves to a content entry
 */
type EntryContentResult = {
    type: 'entry';
    /** Raw entry data - render this however you want */
    entry: ContentEntryData;
    /** Template page for rendering the entry (if available) */
    templatePage: PageProps['page'] | null;
    /** Pre-fetched block data for template page data loaders */
    resolvedData: ResolvedBlockData;
    /** Data context for template blocks (includes entry content for bindings) */
    dataContext: {
        contentEntry: Record<string, unknown>;
    };
    /** Site theme for styling (useful if rendering with SDK components) */
    theme: Theme;
    /** Site ID */
    siteId: string;
};
/**
 * Discriminated union result from loadContent
 */
type LoadContentResult = PageContentResult | EntryContentResult;
/**
 * Type guard to check if result is a page
 */
declare function isPageContent(result: LoadContentResult): result is PageContentResult;
/**
 * Type guard to check if result is an entry
 */
declare function isEntryContent(result: LoadContentResult): result is EntryContentResult;
/**
 * Server-side helper to fetch content by path.
 *
 * Returns a discriminated union - either page data (ready for `<Page>` component)
 * or raw entry data (for custom rendering).
 *
 * @example Dynamic routing with both pages and entries
 * ```tsx
 * import { loadContent, Page, isPageContent } from '@riverbankcms/sdk';
 *
 * export default async function DynamicRoute({ params }) {
 *   const content = await loadContent({
 *     client,
 *     siteId: 'site-123',
 *     path: `/${params.slug?.join('/') || ''}`,
 *   });
 *
 *   if (isPageContent(content)) {
 *     return <Page {...content} />;
 *   }
 *
 *   // 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 = await loadContent({ client, siteId, path });
 *
 * 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} />;
 *     default:
 *       return <GenericEntry entry={content.entry} />;
 *   }
 * }
 *
 * return <Page {...content} />;
 * ```
 *
 * @example Preview mode for draft content
 * ```tsx
 * const content = await loadContent({
 *   client,
 *   siteId,
 *   path,
 *   preview: true, // Fetches draft content for both pages and entries
 * });
 * ```
 */
declare function loadContent(params: LoadContentParams): Promise<LoadContentResult>;

export { type ContentEntryData as C, type EntryContentResult as E, type LoadContentParams as L, type PageContentResult as P, isEntryContent as a, type LoadContentResult as b, isPageContent as i, loadContent as l };
