preact-render-to-string
Version:
Render JSX to an HTML string, with support for Preact components.
20 lines (16 loc) • 461 B
TypeScript
import { VNode } from 'preact';
import { WritableStream } from 'node:stream';
interface RenderToPipeableStreamOptions {
onShellReady?: () => void;
onAllReady?: () => void;
onError?: (error: any) => void;
}
interface PipeableStream {
abort: (reason?: unknown) => void;
pipe: (writable: WritableStream) => void;
}
export function renderToPipeableStream<P = {}>(
vnode: VNode<P>,
options: RenderToPipeableStreamOptions,
context?: any
): PipeableStream;