import React, { ComponentType, ReactNode } from 'react';
import { Catalog, UIElement, SchemaDefinition, Spec } from '@json-render/core';
import * as react_jsx_runtime from 'react/jsx-runtime';
import { C as Components } from './catalog-types-Dh9gul8V.mjs';
interface ComponentRenderProps
> {
element: UIElement;
children?: ReactNode;
emit: (event: string) => void;
bindings?: Record;
loading?: boolean;
}
type ComponentRenderer> = ComponentType>;
type ComponentRegistry = Record>;
interface RendererProps {
spec: Spec | null;
registry?: ComponentRegistry;
includeStandard?: boolean;
loading?: boolean;
fallback?: ComponentRenderer;
}
declare function Renderer({ spec, registry: customRegistry, includeStandard, loading, fallback, }: RendererProps): react_jsx_runtime.JSX.Element | null;
interface JSONUIProviderProps {
initialState?: Record;
handlers?: Record) => Promise | unknown>;
navigate?: (path: string) => void;
validationFunctions?: Record) => boolean>;
onStateChange?: (path: string, value: unknown) => void;
children: ReactNode;
}
declare function JSONUIProvider({ initialState, handlers, navigate, validationFunctions, onStateChange, children, }: JSONUIProviderProps): react_jsx_runtime.JSX.Element;
interface DefineRegistryResult {
registry: ComponentRegistry;
}
declare function defineRegistry(_catalog: C, options: {
components?: Components;
}): DefineRegistryResult;
interface CreateRendererProps {
spec: Spec | null;
state?: Record;
onAction?: (actionName: string, params?: Record) => void;
onStateChange?: (path: string, value: unknown) => void;
loading?: boolean;
fallback?: ComponentRenderer;
}
type ComponentMap> = {
[K in keyof TComponents]: ComponentType>>;
};
declare function createRenderer;
}>(catalog: Catalog, components: ComponentMap): ComponentType;
declare const standardComponents: ComponentRegistry;
type RenderComponentRegistry = Record>;
interface RenderOptions {
registry?: RenderComponentRegistry;
includeStandard?: boolean;
state?: Record;
}
/**
* Render a json-render spec to an HTML email string.
*
* This is a standalone server-side function that resolves the spec tree
* without React hooks or contexts, making it safe to import in Next.js
* route handlers and other server-only environments.
*/
declare function renderToHtml(spec: Spec, options?: RenderOptions): Promise;
/**
* Render a json-render spec to a plain text email string.
*/
declare function renderToPlainText(spec: Spec, options?: RenderOptions): Promise;
export { type CreateRendererProps as C, type DefineRegistryResult as D, JSONUIProvider as J, Renderer as R, type ComponentMap as a, type ComponentRenderProps as b, createRenderer as c, defineRegistry as d, type ComponentRenderer as e, type ComponentRegistry as f, type RendererProps as g, type JSONUIProviderProps as h, renderToPlainText as i, type RenderOptions as j, type RenderComponentRegistry as k, renderToHtml as r, standardComponents as s };