import { ServerUnhead } from 'unhead/server'; import { CreateStreamableServerHeadOptions } from 'unhead/types'; export { UnheadContext } from '../server.mjs'; export { StreamingTemplateParts, WebStreamableHeadContext, prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, wrapStream } from 'unhead/stream/server'; import 'solid-js'; /** * Solid-js streaming context returned by createStreamableHead. */ interface SolidStreamableHeadContext { head: ServerUnhead; /** * Callback to pass to renderToStream's onCompleteShell option. * This captures head entries from shell components before streaming starts. */ onCompleteShell: () => void; /** * Wrap a web ReadableStream to handle head injection automatically. * Must be called after onCompleteShell has fired. */ wrapStream: (stream: ReadableStream, template: string) => ReadableStream; } /** * Creates a head instance configured for Solid-js streaming SSR. * * @example * ```tsx * const { head, onCompleteShell, wrapStream } = createStreamableHead() * * const stream = renderToStream(() => ( * * * * ), { onCompleteShell }) * * return wrapStream(stream, template) * ``` */ declare function createStreamableHead(options?: CreateStreamableServerHeadOptions): SolidStreamableHeadContext; /** * Streaming script component - outputs inline script with current head state. * The Vite plugin with streaming: true auto-injects this. * * Note: In SolidJS, this only outputs content AFTER the shell is complete. * During shell rendering, we accumulate entries which are captured by onCompleteShell. */ declare function HeadStream(): { t: string; } | null; export { HeadStream, createStreamableHead }; export type { SolidStreamableHeadContext };