vite-plugin-react-server
Version:
Vite plugin for React Server Components (RSC)
30 lines • 1.44 kB
TypeScript
import type { Logger } from "vite";
import type { IncomingMessage, ServerResponse } from "node:http";
import type { Worker } from "node:worker_threads";
import { PassThrough } from "node:stream";
import type { ServerActionHandlerOptions } from "./handleServerActionHelper.js";
/**
* Creates a pass-through stream for server action responses.
*/
export declare function createServerActionStream(res: ServerResponse): PassThrough;
/**
* Handles errors in server action processing.
*/
export declare function handleServerActionError(error: unknown, res: ServerResponse, logger?: Logger): void;
/**
* Client-side server action handler that delegates to worker
*/
export declare function handleServerAction(req: IncomingMessage, res: ServerResponse, options: ServerActionHandlerOptions & {
worker?: Worker;
}): Promise<void>;
/**
* Client-side ViteDevServer-specific handler that delegates to worker
*/
export declare function handleServerActionWithViteServer(req: IncomingMessage, res: ServerResponse, server: any, handlerOptions: {
verbose?: boolean;
projectRoot: string;
worker?: Worker;
}): Promise<void>;
export { parseServerActionRequest, parseServerActionRequestBody, createServerActionResponse, setupServerActionHeaders } from "./handleServerActionHelper.js";
export type { ServerActionRequest, ServerActionHandlerOptions } from "./handleServerActionHelper.js";
//# sourceMappingURL=handleServerAction.client.d.ts.map