import * as React from 'react'; import { ComponentProps, ReactNode } from 'react'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { TProps } from 'react-jsx-parser'; interface JSXPreviewContextValue { jsx: string; processedJsx: string; /** * Byte offset in `processedJsx` where the auto-closed tag soup begins. * Equals `processedJsx.length` when nothing was auto-closed (non- * streaming, or streamed input that was already well-formed). Used by * `JSXPreviewContent` to inject the streaming cursor at the exact * boundary between live content and the auto-closed wrapper tags so * the cursor lands inside the deepest still-open element instead of * after the outermost wrapper. */ processedJsxCloseStart: number; isStreaming: boolean; error: Error | null; setError: (error: Error | null) => void; setLastGoodJsx: (jsx: string) => void; components: TProps["components"]; bindings: TProps["bindings"]; onErrorProp?: (error: Error) => void; } declare const useJSXPreview: () => JSXPreviewContextValue; type JSXPreviewProps = ComponentProps<"div"> & { jsx: string; isStreaming?: boolean; components?: TProps["components"]; bindings?: TProps["bindings"]; onError?: (error: Error) => void; }; declare const JSXPreview: React.MemoExoticComponent<({ jsx, isStreaming, components, bindings, onError, className, children, ...props }: JSXPreviewProps) => react_jsx_runtime.JSX.Element>; type JSXPreviewContentProps = Omit, "children">; declare const JSXPreviewContent: React.MemoExoticComponent<({ className, ...props }: JSXPreviewContentProps) => react_jsx_runtime.JSX.Element>; type JSXPreviewErrorProps = ComponentProps<"div"> & { children?: ReactNode | ((error: Error) => ReactNode); }; declare const JSXPreviewError: React.MemoExoticComponent<({ className, children, ...props }: JSXPreviewErrorProps) => react_jsx_runtime.JSX.Element | null>; export { JSXPreview, JSXPreviewContent, type JSXPreviewContentProps, JSXPreviewError, type JSXPreviewErrorProps, type JSXPreviewProps, useJSXPreview };