/** * @file Server Integration Module Index * @description Central export point for server-side streaming utilities. * * This module provides all utilities needed for integrating the Dynamic HTML * Streaming Engine with server-side rendering frameworks. It includes * middleware factories, serialization utilities, and SSR helpers. * * @module streaming/server * @version 1.0.0 * @author Harbor Framework Team * * @example * ```typescript * import { * createStreamingMiddleware, * createServerStreamContext, * createReactStreamOptions, * generateNonce, * } from '@/lib/streaming/server'; * * // Set up Express middleware * app.use(createStreamingMiddleware({ compress: true })); * * // Handle streaming SSR * app.get('/', (req, res) => { * const nonce = generateNonce(); * const context = createServerStreamContext( * (chunk) => res.write(chunk), * () => res.flush?.(), * { nonce } * ); * * // Render with React streaming * const options = createReactStreamOptions({ * nonce, * onShellReady() { * res.statusCode = 200; * stream.pipe(res); * }, * }); * * const { pipe } = renderToPipeableStream(, options); * }); * ``` */ export { createStreamingMiddleware, createServerStreamContext, createStreamingHeaders, createEarlyHints, DEFAULT_MIDDLEWARE_OPTIONS, STREAMING_HEADERS, type StreamingRequest, type StreamingResponse, type NextFunction, type StreamingMiddleware, type PreloadResource, } from './streaming-middleware'; export { serializeStreamState, deserializeStreamState, createHydrationScript, } from './streaming-middleware'; export { StreamMarkers, wrapBoundaryContent, createServerChunk, } from './streaming-middleware'; export { createStreamingPipeline, createFlushSchedule, type FlushScheduleEntry, } from './streaming-middleware'; export { createReactStreamOptions, createShellHtml, type RenderToStreamOptions, type ShellOptions, } from './streaming-middleware'; export { generateNonce, } from './streaming-middleware'; export type { ServerStreamContext, StreamingMiddlewareOptions, SerializedStreamState, } from '../types';