import type { CatalogItemRenderMap, CatalogListRenderMap } from "@x12i/catalox-contracts/render-map.js"; import type { CatalogRendererMode, CatalogRendererRole, CatalogRendererSyntax } from "@x12i/catalox-contracts/renderer-snippets.js"; export type TranspileRendererSourceToModuleSourceInput = { rendererSource: string; /** * Declares how to interpret `rendererSource`. * Only `jsx` and `tsx` can be transpiled to an ESM module. */ syntax?: CatalogRendererSyntax; /** * Optional label used in sourcemaps and diagnostics. */ sourceFileName?: string; }; export declare function transpileRendererSourceToModuleSource(input: TranspileRendererSourceToModuleSourceInput): Promise; export type TypecheckRendererSnippetIoInput = { rendererSource: string; syntax?: CatalogRendererSyntax; role: CatalogRendererRole; mode?: CatalogRendererMode; /** * If true, any inability to typecheck (e.g. missing typescript) becomes an error. */ strict?: boolean; }; export type TypecheckRendererSnippetIoError = { file: string; message: string; line?: number; column?: number; }; export type TypecheckRendererSnippetIoResult = { isValid: boolean; errors: TypecheckRendererSnippetIoError[]; /** * Present when typecheck couldn't be performed (and strict=false). */ skipped?: { reason: string; }; }; export declare function typecheckRendererSnippetIo(input: TypecheckRendererSnippetIoInput): Promise; export type UnsafeCreateRendererFunctionInput = { transpiledModuleSource: string; }; /** * UNSAFE: Evaluates code. Only call with trusted snippets. * * Loads a transpiled ESM module source via a data URL and returns its default export. */ export declare function unsafeCreateRendererFunction(input: UnsafeCreateRendererFunctionInput): Promise; export type RenderToHtmlInput = { renderer: unknown; /** * If renderer is a component, it will be called with these props. * If renderer is a function expecting a map, pass `{ map }` and use a wrapper. */ props: Record; }; /** * Best-effort HTML rendering. If React is not installed, returns a string error. * If the renderer returns a string, it is returned as-is. */ export declare function renderRendererToHtml(input: RenderToHtmlInput): Promise; export type CatalogRendererIo = { map: CatalogListRenderMap | CatalogItemRenderMap; role: CatalogRendererRole; mode?: CatalogRendererMode; }; //# sourceMappingURL=index.d.ts.map