import type { IncomingMessage } from "node:http"; import type { Duplex } from "node:stream"; import { WebSocketServer } from "ws"; import type { JinnConfig } from "../shared/types.js"; /** The plugin id this upgrade path names, or null when it is not ours. */ export declare function matchPluginEventsPath(pathname: string): string | null; export interface PluginEventsChannel { /** Its own server, kept out of the `/ws` broadcast set: these sockets carry one * plugin's events and nothing else. The gateway that made it owns closing it. */ wss: WebSocketServer; /** * Upgrade one events socket, after the gateway's auth gate has passed. * * The enable gate is the one the rest of the plugin API uses, and it answers a * disabled plugin and an unknown id identically: the socket is destroyed, * which is what an unmatched upgrade path already gets. */ handleUpgrade(req: IncomingMessage, socket: Duplex, head: Buffer, id: string): void; } /** One gateway's events channel. Owned per gateway rather than per module so an * in-process restart does not inherit a closed server from the last one. */ export declare function createPluginEventsChannel(getConfig: () => Pick): PluginEventsChannel; //# sourceMappingURL=plugin-events-ws.d.ts.map