import type { ServerWebSocket } from "bun";
import type { ValidatorAdapter } from "./router";
import type { MessageHandler, MessageSchemaType, SendFunction, WebSocketData } from "./types";
/**
 * Handles WebSocket message parsing, validation, and routing.
 *
 * ARCHITECTURE: Maps message types (strings) to their handlers.
 * Only one handler per message type - last registration wins.
 */
export declare class MessageRouter<T extends WebSocketData<Record<string, unknown>>> {
    private readonly validator;
    private readonly messageHandlers;
    constructor(validator: ValidatorAdapter);
    addMessageHandler<Schema extends MessageSchemaType>(schema: Schema, handler: MessageHandler<Schema, T>): void;
    handleMessage(ws: ServerWebSocket<T>, message: string | Buffer, send: SendFunction): void;
}
//# sourceMappingURL=message.d.ts.map