import { type ReactNode } from 'react'; import type { AIUIDocument } from './AIUIDocument'; import type { AIUIHost } from './AIUIHost'; /** * Loads the runtime of a renderer, its format's packages, once and in the browser only, when a * reply first shows the format: the packages may not run on a server, and are of no use to an * app whose agent never writes it. When the runtime can't load, such as when a deploy replaced * the file it is in, the replies already written show their text, the next reply the agent * writes in the format tries again, and the failure is reported once. */ export declare class AIUIRuntimeLoader { /** The runtime, once loaded. */ runtime?: Runtime; private failed; private readonly host; private readonly importRuntime; private loading?; private readonly onFailure; constructor(host: AIUIHost, importRuntime: () => Promise, onFailure: (error: unknown) => void); /** Loads the runtime, once while it loads; again after it failed to. */ load(): Promise; /** * Whether a reply shows its text because the runtime couldn't load: one already written does, * and one the agent is writing shows its placeholder while the runtime loads again. */ showsText(document: AIUIDocument): boolean; } export type AIUIRuntimeViewProps = { loader: AIUIRuntimeLoader; /** What shows while the runtime loads. */ placeholder: ReactNode; /** The reply's UI, once the runtime has loaded. */ render: (runtime: Runtime) => ReactNode; }; /** A reply's UI from a renderer's runtime, which it loads the first time one shows. */ export declare const AIUIRuntimeView: ({ loader, placeholder, render, }: AIUIRuntimeViewProps) => import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=AIUIRuntimeLoader.d.ts.map