UNPKG

rasengan

Version:

The modern React Framework

44 lines (43 loc) 1.73 kB
import type * as Express from 'express'; /** * This function is used to create a Rasengan request from an Express request. * Reference: https://github.com/remix-run/react-router/blob/main/packages/react-router-express/server.ts#L86 */ export default function createRasenganRequest(req: Express.Request, res: Express.Response): Request; /** * This function is used to send a Rasengan response to an Express response. * @param res * @param nodeResponse */ export declare function sendRasenganResponse(res: Express.Response, nodeResponse: Response): Promise<void>; /** * This function is used to create a Rasengan headers from Express request headers. * @param requestHeaders * @returns */ export declare function createRasenganHeaders(requestHeaders: Record<string, string | string[]>): Headers; /** * Creates a fake Express-like request and response for static prerendering. * This mimics the shape expected by `createRasenganRequest(req, res)`. */ export declare function createFakeRasenganRequest(pathname: string, options?: { host?: string; protocol?: 'http' | 'https'; method?: string; headers?: Record<string, string>; body?: string | Buffer; }): { req: any; res: any; }; /** * Log formatted and grouped HTML build output, similar to Vite/Next.js style. * @param files List of absolute or relative HTML file paths */ export declare function logRenderedPagesGrouped(files: string[]): Promise<void>; /** * Match a route pattern like "/blog/**" or "/profile" * to a list of available page paths. */ export declare function filterRoutesForPrerender(routes: string[], availablePages: string[]): string[]; export declare function convertSecondsToMinutes(seconds: number): string;