bun-ws-router
Version:
A simple and efficient WebSocket router for Bun with Zod/Valibot message validation.
8 lines • 539 B
TypeScript
import type { Server, ServerWebSocket } from "bun";
import type { MessageSchemaType, WebSocketData } from "./types";
import type { ValidatorAdapter } from "./router";
/**
* Generic publish function that works with any validator adapter.
*/
export declare function publishWithValidator<T extends WebSocketData<Record<string, unknown>>>(validator: ValidatorAdapter, server: Server | ServerWebSocket<T>, topic: string, schema: MessageSchemaType, messageType: string, payload: any, meta?: any): boolean;
//# sourceMappingURL=publish.d.ts.map