vite-plugin-react-server
Version:
Vite plugin for React Server Components (RSC)
16 lines • 745 B
TypeScript
import type { MessagePort } from "node:worker_threads";
/**
* Type-safe helper to set max listeners on MessagePort.
*
* MessagePort extends EventTarget (at runtime), which has setMaxListeners.
* However, the TypeScript types don't reflect this, so we use a type assertion.
* This is safe because MessagePort is an EventTarget at runtime in Node.js.
*/
export declare function setMaxListenersOnPort(port: MessagePort, maxListeners: number): void;
/**
* Unref a MessagePort so it doesn't keep the event loop alive.
* Always unref ports — only active message listeners should keep the process alive,
* not the port's existence.
*/
export declare function unrefPort(port: MessagePort): void;
//# sourceMappingURL=setMaxListeners.d.ts.map