/**
 * Optional json-render adapter for tree frames (`@adonis-agora/agent/react/genui/json-render`).
 * Needs the optional peer `@json-render/react` (>= 0.21). Use it when your app already renders
 * json-render specs and wants tree frames to go through the same `Renderer` (its state, actions and
 * visibility machinery); otherwise `<GenerativeUI>` renders trees natively.
 *
 * ```tsx
 * import { GenuiProvider } from '@adonis-agora/agent/react/genui/json-render';
 *
 * <GenuiProvider registry={registry} catalog={catalog} jsonRender>…</GenuiProvider>
 * ```
 */
import { type ComponentRegistry } from '@json-render/react';
import { type GenuiProviderProps as BaseGenuiProviderProps } from './generative-ui.js';
import type { GenerativeUIElement, GenuiRegistry, GenuiRenderer } from './types.js';
/** A json-render flat spec: `{ root, elements: { [id]: { type, props, children } } }`. */
export interface JsonRenderFlatSpec {
    root: string;
    elements: Record<string, {
        type: string;
        props: Record<string, unknown>;
        children: string[];
    }>;
}
/** A tree frame's `root` as a json-render flat spec (ids `el-0`, `el-1`, … depth first). */
export declare function treeToJsonRenderSpec(root: GenerativeUIElement): JsonRenderFlatSpec;
/**
 * Adapt a genui registry (renderers taking props + `children`) to a json-render registry (renderers
 * taking `{ element, children }`), so one set of components serves both.
 */
export declare function toJsonRenderRegistry(registry: GenuiRegistry): ComponentRegistry;
export interface JsonRenderTreeProps {
    root?: GenerativeUIElement;
    registry: ComponentRegistry;
    /** json-render state the spec's `$state` expressions read. */
    initialState?: Record<string, unknown>;
}
/** Render a tree frame's `root` with json-render. */
export declare function JsonRenderTree({ root, registry, initialState }: JsonRenderTreeProps): import("react").JSX.Element | null;
/** A registry entry for `genui:tree` that renders through json-render with `registry`. */
export declare function jsonRenderTree(registry: ComponentRegistry): GenuiRenderer<{
    root?: GenerativeUIElement;
}>;
export interface GenuiProviderProps extends BaseGenuiProviderProps {
    /**
     * Draw composed tree frames through json-render: pass your json-render registry, or `true` to
     * derive one from `registry` ({@link toJsonRenderRegistry}). Omitted → trees render natively.
     * An explicit `treeRenderer` wins over it.
     */
    jsonRender?: ComponentRegistry | true;
}
/** `GenuiProvider` from `/genui`, plus the {@link GenuiProviderProps.jsonRender} option. */
export declare function GenuiProvider({ jsonRender, treeRenderer, registry, ...rest }: GenuiProviderProps): import("react").JSX.Element;
//# sourceMappingURL=json-render.d.ts.map