UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

24 lines (23 loc) 816 B
/** * Streaming SSR renderer. Accepts an HTML string containing RanUI custom elements * and yields HTML chunks with Declarative Shadow DOM (DSD) inlined. * * Static HTML is yielded immediately; custom elements are instantiated via the * SSR registry and serialized before yielding. * * @example * ```ts * import { renderToStream } from 'ranui/ssr-stream'; * * const stream = renderToStream(` * <r-button type="primary">Submit</r-button> * <r-progress percent="65"></r-progress> * `); * for await (const chunk of stream) res.write(chunk); * ``` */ export declare function renderToStream(html: string): AsyncGenerator<string>; /** * Non-streaming convenience wrapper. Collects all chunks and returns a single string. */ export declare function renderHTMLToString(html: string): Promise<string>;