import * as React from "react";
import type { ResolverContext } from "./system";
import type { PageOutline } from "./structure/schema";
import type { Theme } from "../../theme-core/src/schema";
import type { SdkCustomBlock } from "./system/manifest/schema";
import type { ThemeTokens } from "./system/theme";
import type { RouteMap } from "./system/transforms";
import { type MediaAssetIndexItem, type ResolveImageUrlContext, type ResolveImageUrlContextInput } from "./system/runtime/nodes/media";
/**
 * Occurrence context for event pages.
 * Passed through to blocks that need occurrence information (e.g., event-registration).
 */
export type OccurrenceContextData = {
    id: string;
    seriesId: string;
    startsAt: string;
    endsAt: string;
    timeZone: string;
    capacityOverride?: number | null;
    overrides?: Record<string, unknown> | null;
};
/**
 * Generic entry subroute context.
 *
 * Subroutes are "one extra segment" URLs under a content entry path, used to
 * scope blocks to a specific occurrence/run without requiring a separate content entry.
 */
export type EntrySubrouteContextData = {
    kind: 'event-occurrence';
    occurrence: OccurrenceContextData;
} | {
    kind: 'course-run';
    run: {
        courseId: string;
        seriesId: string;
        runSlug: string;
        runName: string | null;
    };
};
type PageRendererDataContext = {
    siteId?: string;
    pageId?: string;
    resolvedData?: Record<string, Record<string, unknown>>;
    previewStage?: "published" | "preview";
    routes?: RouteMap;
    pagesByIdentifier?: Record<string, string>;
    entriesByIdentifier?: Record<string, Record<string, string>>;
    occurrenceContext?: OccurrenceContextData | null;
    entrySubrouteContext?: EntrySubrouteContextData | null;
    contentEntry?: Record<string, unknown> | null;
    editableRouteMetadataFieldIds?: ReadonlyArray<string> | null;
    supabaseUrl?: string;
    mediaAssets?: readonly MediaAssetIndexItem[];
    imageResolveContext?: ResolveImageUrlContextInput;
    apiBaseUrl?: string;
    portalToken?: string | null;
};
/**
 * Props passed to block override components.
 *
 * These props are RSC-safe (no functions) so overrides can be Client Components.
 * Unlike internal SDK block components, overrides don't receive `registry` or
 * `fragmentRegistry` which contain function references that can't cross the
 * RSC serialization boundary.
 *
 * @example
 * ```tsx
 * 'use client';
 *
 * import type { BlockOverrideProps, HeroContent } from '@riverbankcms/sdk/rendering';
 *
 * export function CustomHero({ content, theme, data }: BlockOverrideProps<HeroContent>) {
 *   const [expanded, setExpanded] = useState(false);
 *   return <div>...</div>;
 * }
 * ```
 */
export type BlockOverrideProps<TContent = Record<string, unknown>> = {
    /** Block content data */
    content: TContent;
    /** Theme tokens for styling */
    theme?: ThemeTokens;
    /** Full theme configuration */
    themeConfig?: Theme;
    /** Pre-fetched data from data loaders */
    data?: Record<string, unknown>;
    /** Site UUID (useful for media URL resolution in override components) */
    siteId?: string;
    /** Dashboard API URL for client-side block runtime calls. */
    apiBaseUrl?: string;
    /** Customer portal token for Bearer-authenticated block runtime calls. */
    portalToken?: string | null;
    /** Supabase project URL (useful for media URL resolution in override components) */
    supabaseUrl?: string;
    /** Full image-resolution context including canonical media sidecars. */
    imageResolveContext?: ResolveImageUrlContext;
    /** Block instance ID (null for unsaved blocks) */
    blockId: string | null;
    /** Block kind identifier (e.g., "block.hero" or "custom.my-block") */
    blockKind: string;
};
/**
 * Block override component type.
 *
 * Override components can be either Server Components or Client Components.
 * They receive only serializable props (no functions) to support RSC boundaries.
 *
 * @example Server Component override
 * ```tsx
 * export function CustomHero({ content, theme, data }: BlockOverrideProps<HeroContent>) {
 *   return <div className="custom-hero">...</div>;
 * }
 * ```
 *
 * @example Client Component override
 * ```tsx
 * 'use client';
 *
 * export function CustomHero({ content, theme, data }: BlockOverrideProps<HeroContent>) {
 *   const [state, setState] = useState(null);
 *   return <div className="custom-hero">...</div>;
 * }
 * ```
 */
export type BlockOverrideComponent = React.ComponentType<BlockOverrideProps<unknown>>;
/**
 * Map of block kinds to custom override components.
 * Keys can be either:
 * - Full block kind: "block.hero"
 * - Short form: "hero" (will match "block.hero")
 *
 * @example
 * ```tsx
 * const overrides: BlockOverrides = {
 *   'hero': CustomHero,        // CustomHero uses BlockOverrideProps<HeroContent>
 *   'body-text': CustomBodyText, // CustomBodyText uses BlockOverrideProps<BodyTextContent>
 * };
 * ```
 */
export type BlockOverrides = Record<string, BlockOverrideComponent>;
/**
 * SDK site configuration for custom block rendering.
 * Minimal type containing only what PageRenderer needs.
 */
export type SdkConfigForRenderer = {
    customBlocks?: SdkCustomBlock[];
};
interface PageRendererProps {
    theme: Theme;
    page: PageOutline | null;
    usePlaceholders?: boolean;
    dataContext?: PageRendererDataContext;
    routeMap?: RouteMap;
    wrapBlock?: (blockId: string, rendered: React.ReactNode) => React.ReactNode;
    registry?: ResolverContext["registry"];
    themeTokens?: ThemeTokens;
    blockOverrides?: BlockOverrides;
    sdkConfig?: SdkConfigForRenderer | null;
    customBlocks?: SdkCustomBlock[];
}
export default function PageRenderer({ theme, page, usePlaceholders, dataContext, wrapBlock, registry, themeTokens: providedThemeTokens, routeMap, blockOverrides, sdkConfig, customBlocks, }: PageRendererProps): import("react/jsx-runtime").JSX.Element;
export {};
